From 18d43a30e8770098a98d186b8f0efe3f47f32f08 Mon Sep 17 00:00:00 2001 From: Titus TC Date: Wed, 11 Mar 2026 12:07:27 +0200 Subject: [PATCH 1/2] fix: enable decimal input in Number field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Number component was rejecting decimal input due to two issues: 1. No `formatOptions` passed to react-aria's `useNumberFieldState` and `useNumberField`, so the NumberParser rejected decimal characters during input validation. 2. The `` value was overridden with `Number.isInteger(state.numberValue) ? state.numberValue : 0`, which collapsed any non-integer to 0 — preventing the user from ever typing a decimal point. Fix: pass memoized `formatOptions` with `maximumFractionDigits: 10` to both hooks (must be memoized — react-stately uses reference equality), remove the value override so react-aria controls the input natively, and expose a `step` prop (default 1) for +/- button increment granularity. Co-Authored-By: Claude Opus 4.6 --- assets/build/example.min.js | 8 +++---- assets/build/index.min.js | 22 +++++++++---------- assets/src/components/field/number/Number.tsx | 18 +++++++++------ 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/assets/build/example.min.js b/assets/build/example.min.js index 1cb5dcab..ede9820a 100644 --- a/assets/build/example.min.js +++ b/assets/build/example.min.js @@ -9,7 +9,7 @@ var Nne=Object.defineProperty;var u=(om,Ic)=>Nne(om,"name",{value:Ic,configurabl * { overscroll-behavior: contain; } -}`.trim(),document.head.prepend(r);let i=u(s=>{if(!(s.touches.length===2||e)){if(!t||t===document.documentElement||t===document.body){s.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&s.preventDefault()}},"onTouchMove"),l=u(s=>{let c=s.target,d=s.relatedTarget;if(d&&ym(d))d.focus({preventScroll:!0}),dk(d,ym(c));else if(!d){var f;let h=(f=c.parentElement)===null||f===void 0?void 0:f.closest("[tabindex]");h?.focus({preventScroll:!0})}},"onBlur"),a=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(s){let c=document.activeElement!=null&&ym(document.activeElement);a.call(this,{...s,preventScroll:!0}),(!s||!s.preventScroll)&&dk(this,c)};let o=vr(Ug(document,"touchstart",n,{passive:!1,capture:!0}),Ug(document,"touchmove",i,{passive:!1,capture:!0}),Ug(document,"blur",l,!0));return()=>{o(),r.remove(),HTMLElement.prototype.focus=a}}u(IN,"$49c51c25361d4cd2$var$preventScrollMobileSafari");function Kg(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}u(Kg,"$49c51c25361d4cd2$var$setStyle");function Ug(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}u(Ug,"$49c51c25361d4cd2$var$addEvent");function dk(t,e){e||!ds?fk(t):ds.addEventListener("resize",()=>fk(t),{once:!0})}u(dk,"$49c51c25361d4cd2$var$scrollIntoViewWhenReady");function fk(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=Yc(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect(),l=n.getBoundingClientRect();if(l.topi.top+n.clientHeight){let a=i.bottom;ds&&(a=Math.min(a,ds.offsetTop+ds.height));let o=l.top-i.top-((a-i.top)/2-l.height/2);r.scrollTo({top:Math.max(0,Math.min(r.scrollHeight-r.clientHeight,r.scrollTop+o)),behavior:"smooth"})}}n=r.parentElement}}u(fk,"$49c51c25361d4cd2$var$scrollIntoView");const LN=(0,wp.element.createContext)({});function zN(){var t;return(t=(0,wp.element.useContext)(LN))!==null&&t!==void 0?t:{}}u(zN,"$96b38030c423d352$export$9fc1347d4195ccb3");const Gg=wp.element.createContext(null);function ZN(t){let{children:e}=t,n=(0,wp.element.useContext)(Gg),[r,i]=(0,wp.element.useState)(0),l=(0,wp.element.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(a=>a+1),n&&n.addModal()},removeModal(){i(a=>a-1),n&&n.removeModal()}}),[n,r]);return wp.element.createElement(Gg.Provider,{value:l},e)}u(ZN,"$f57aed4a881a3485$export$178405afcd8c5eb");function XN(){let t=(0,wp.element.useContext)(Gg);return{modalProviderProps:{"aria-hidden":t&&t.modalCount>0?!0:void 0}}}u(XN,"$f57aed4a881a3485$export$d9aaed4c3ece1bc0");function jN(t){let{modalProviderProps:e}=XN();return wp.element.createElement("div",{"data-overlay-container":!0,...t,...e})}u(jN,"$f57aed4a881a3485$var$OverlayContainerDOM");function hk(t){return wp.element.createElement(ZN,null,wp.element.createElement(jN,t))}u(hk,"$f57aed4a881a3485$export$bf688221f59024e5");var pk={};pk={dismiss:"\u062A\u062C\u0627\u0647\u0644"};var mk={};mk={dismiss:"\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435"};var gk={};gk={dismiss:"Odstranit"};var Ok={};Ok={dismiss:"Luk"};var bk={};bk={dismiss:"Schlie\xDFen"};var yk={};yk={dismiss:"\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7"};var vk={};vk={dismiss:"Dismiss"};var $k={};$k={dismiss:"Descartar"};var wk={};wk={dismiss:"L\xF5peta"};var xk={};xk={dismiss:"Hylk\xE4\xE4"};var Sk={};Sk={dismiss:"Rejeter"};var Ck={};Ck={dismiss:"\u05D4\u05EA\u05E2\u05DC\u05DD"};var kk={};kk={dismiss:"Odbaci"};var Dk={};Dk={dismiss:"Elutas\xEDt\xE1s"};var Pk={};Pk={dismiss:"Ignora"};var Ek={};Ek={dismiss:"\u9589\u3058\u308B"};var Tk={};Tk={dismiss:"\uBB34\uC2DC"};var Ak={};Ak={dismiss:"Atmesti"};var Qk={};Qk={dismiss:"Ner\u0101d\u012Bt"};var Mk={};Mk={dismiss:"Lukk"};var Bk={};Bk={dismiss:"Negeren"};var Rk={};Rk={dismiss:"Zignoruj"};var Vk={};Vk={dismiss:"Descartar"};var Nk={};Nk={dismiss:"Dispensar"};var Fk={};Fk={dismiss:"Revocare"};var Ik={};Ik={dismiss:"\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C"};var Lk={};Lk={dismiss:"Zru\u0161i\u0165"};var zk={};zk={dismiss:"Opusti"};var Zk={};Zk={dismiss:"Odbaci"};var Xk={};Xk={dismiss:"Avvisa"};var jk={};jk={dismiss:"Kapat"};var qk={};qk={dismiss:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438"};var Wk={};Wk={dismiss:"\u53D6\u6D88"};var Yk={};Yk={dismiss:"\u95DC\u9589"};var Kk={};Kk={"ar-AE":pk,"bg-BG":mk,"cs-CZ":gk,"da-DK":Ok,"de-DE":bk,"el-GR":yk,"en-US":vk,"es-ES":$k,"et-EE":wk,"fi-FI":xk,"fr-FR":Sk,"he-IL":Ck,"hr-HR":kk,"hu-HU":Dk,"it-IT":Pk,"ja-JP":Ek,"ko-KR":Tk,"lt-LT":Ak,"lv-LV":Qk,"nb-NO":Mk,"nl-NL":Bk,"pl-PL":Rk,"pt-BR":Vk,"pt-PT":Nk,"ro-RO":Fk,"ru-RU":Ik,"sk-SK":Lk,"sl-SI":zk,"sr-SP":Zk,"sv-SE":Xk,"tr-TR":jk,"uk-UA":qk,"zh-CN":Wk,"zh-TW":Yk};function qN(t){return t&&t.__esModule?t.default:t}u(qN,"$parcel$interopDefault$7");function fs(t){let{onDismiss:e,...n}=t,r=Yt(qN(Kk),"@react-aria/overlays"),i=zn(n,r.format("dismiss")),l=u(()=>{e&&e()},"onClick");return wp.element.createElement(gn,null,wp.element.createElement("button",{...i,tabIndex:-1,onClick:l,style:{width:1,height:1}}))}u(fs,"$86ea4cb521eb2e37$export$2317d149ed6f78c4");const WN=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;let hs=new WeakMap,Nt=[];function _g(t,e){let n=bt(t?.[0]),r=e instanceof n.Element?{root:e}:e;var i;let l=(i=r?.root)!==null&&i!==void 0?i:document.body,a=r?.shouldUseInert&&WN,o=new Set(t),s=new Set,c=u(g=>a&&g instanceof n.HTMLElement?g.inert:g.getAttribute("aria-hidden")==="true","getHidden"),d=u((g,O)=>{a&&g instanceof n.HTMLElement?g.inert=O:O?g.setAttribute("aria-hidden","true"):(g.removeAttribute("aria-hidden"),g instanceof n.HTMLElement&&(g.inert=!1))},"setHidden"),f=u(g=>{for(let $ of g.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))o.add($);let O=u($=>{if(s.has($)||o.has($)||$.parentElement&&s.has($.parentElement)&&$.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let v of o)if($.contains(v))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},"acceptNode"),b=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode:O}),y=O(g);if(y===NodeFilter.FILTER_ACCEPT&&h(g),y!==NodeFilter.FILTER_REJECT){let $=b.nextNode();for(;$!=null;)h($),$=b.nextNode()}},"walk"),h=u(g=>{var O;let b=(O=hs.get(g))!==null&&O!==void 0?O:0;c(g)&&b===0||(b===0&&d(g,!0),s.add(g),hs.set(g,b+1))},"hide");Nt.length&&Nt[Nt.length-1].disconnect(),f(l);let p=new MutationObserver(g=>{for(let O of g)if(O.type==="childList"&&![...o,...s].some(b=>b.contains(O.target)))for(let b of O.addedNodes)(b instanceof HTMLElement||b instanceof SVGElement)&&(b.dataset.liveAnnouncer==="true"||b.dataset.reactAriaTopLayer==="true")?o.add(b):b instanceof Element&&f(b)});p.observe(l,{childList:!0,subtree:!0});let m={visibleNodes:o,hiddenNodes:s,observe(){p.observe(l,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return Nt.push(m),()=>{p.disconnect();for(let g of s){let O=hs.get(g);O!=null&&(O===1?(d(g,!1),hs.delete(g)):hs.set(g,O-1))}m===Nt[Nt.length-1]?(Nt.pop(),Nt.length&&Nt[Nt.length-1].observe()):Nt.splice(Nt.indexOf(m),1)}}u(_g,"$5e3802645cc19319$export$1c3ebcada18427bf");function YN(t){let e=Nt[Nt.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}u(YN,"$5e3802645cc19319$export$1020fa7f77e17884");function KN(t,e){let{triggerRef:n,popoverRef:r,groupRef:i,isNonModal:l,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o,...s}=t,c=s.trigger==="SubmenuTrigger",{overlayProps:d,underlayProps:f}=uk({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!l||c,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o},i??r),{overlayProps:h,arrowProps:p,placement:m,triggerAnchorPoint:g}=RN({...s,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:l&&!c?e.close:null});return ck({isDisabled:l||!e.isOpen}),(0,wp.element.useEffect)(()=>{if(e.isOpen&&r.current){var O,b;return l?YN((O=i?.current)!==null&&O!==void 0?O:r.current):_g([(b=i?.current)!==null&&b!==void 0?b:r.current],{shouldUseInert:!0})}},[l,e.isOpen,r,i]),{popoverProps:ne(d,h),arrowProps:p,underlayProps:f,placement:m,triggerAnchorPoint:g}}u(KN,"$f2f8a6077418541e$export$542a6fd13ac93354");const Uk=wp.element.createContext(null);function Gk(t){let e=fm(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[i,l]=(0,wp.element.useState)(!1),a=(0,wp.element.useMemo)(()=>({contain:i,setContain:l}),[i,l]),{getContainer:o}=zN();if(!t.portalContainer&&o&&(n=o()),!n)return null;let s=t.children;return t.disableFocusManagement||(s=wp.element.createElement($d,{restoreFocus:!0,contain:(t.shouldContainFocus||i)&&!r},s)),s=wp.element.createElement(Uk.Provider,{value:a},wp.element.createElement(yR,null,s)),wp.element.createPortal(s,n)}u(Gk,"$337b884510726a0d$export$c6fdb837b070b4ff");function _k(){let t=(0,wp.element.useContext)(Uk),e=t?.setContain;Pe(()=>{e?.(!0)},[e])}u(_k,"$337b884510726a0d$export$14c98a7594375490");function UN(t,e,n){let{overlayProps:r,underlayProps:i}=uk({...t,isOpen:e.isOpen,onClose:e.close},n);return ck({isDisabled:!e.isOpen}),_k(),(0,wp.element.useEffect)(()=>{if(e.isOpen&&n.current)return _g([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:ne(r),underlayProps:i}}u(UN,"$8ac8429251c45e4b$export$dbc0f175b25fb0fb");const Qd=new WeakMap;function GN(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}u(GN,"$b1f0cad8af73213b$var$normalizeKey");function Hk(t,e){let n=Qd.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${GN(e)}`}u(Hk,"$b1f0cad8af73213b$export$9145995848b05025");function Hg(t){return qc()?t.altKey:t.ctrlKey}u(Hg,"$feb5ffebff200149$export$d3e3bd3e26688c04");function Md(t,e){var n,r;let i=`[data-key="${CSS.escape(String(e))}"]`,l=(n=t.current)===null||n===void 0?void 0:n.dataset.collection;return l&&(i=`[data-collection="${CSS.escape(l)}"]${i}`),(r=t.current)===null||r===void 0?void 0:r.querySelector(i)}u(Md,"$feb5ffebff200149$export$c3d8340acf92597f");const Jk=new WeakMap;function _N(t){let e=Ie();return Jk.set(t,e),e}u(_N,"$feb5ffebff200149$export$881eb0d9f3605d9d");function HN(t){return Jk.get(t)}u(HN,"$feb5ffebff200149$export$6aeb1680a0ae8741");const JN=1e3;function eD(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,i=(0,wp.element.useRef)({search:"",timeout:void 0}).current,l=u(a=>{let o=eF(a.key);if(!(!o||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target)||i.search.length===0&&o===" ")){if(o===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=o,e.getKeyForSearch!=null){let s=e.getKeyForSearch(i.search,n.focusedKey);s==null&&(s=e.getKeyForSearch(i.search)),s!=null&&(n.setFocusedKey(s),r&&r(s))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},JN)}},"onKeyDown");return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?l:void 0}}}u(eD,"$fb3050f43d946246$export$e32c88dfddc6e1d8");function eF(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}u(eF,"$fb3050f43d946246$var$getStringForKey");function tD(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:l=!1,disallowEmptySelection:a=!1,disallowSelectAll:o=!1,escapeKeyBehavior:s="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:h=!1,isVirtualized:p,scrollRef:m=r,linkBehavior:g="action"}=t,{direction:O}=Re(),b=Wc(),y=u(P=>{var R;if(P.altKey&&P.key==="Tab"&&P.preventDefault(),!(!((R=r.current)===null||R===void 0)&&R.contains(P.target)))return;const L=u((Z,ee)=>{if(Z!=null){if(e.isLink(Z)&&g==="selection"&&c&&!Hg(P)){(0,wp.element.flushSync)(()=>{e.setFocusedKey(Z,ee)});let De=Md(r,Z),qt=e.getItemProps(Z);De&&b.open(De,P,qt.href,qt.routerOptions);return}if(e.setFocusedKey(Z,ee),e.isLink(Z)&&g==="override")return;P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&!Hg(P)&&e.replaceSelection(Z)}},"navigateToKey");switch(P.key){case"ArrowDown":if(n.getKeyBelow){var k,F,N;let Z=e.focusedKey!=null?(k=n.getKeyBelow)===null||k===void 0?void 0:k.call(n,e.focusedKey):(F=n.getFirstKey)===null||F===void 0?void 0:F.call(n);Z==null&&l&&(Z=(N=n.getFirstKey)===null||N===void 0?void 0:N.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowUp":if(n.getKeyAbove){var z,G,le;let Z=e.focusedKey!=null?(z=n.getKeyAbove)===null||z===void 0?void 0:z.call(n,e.focusedKey):(G=n.getLastKey)===null||G===void 0?void 0:G.call(n);Z==null&&l&&(Z=(le=n.getLastKey)===null||le===void 0?void 0:le.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowLeft":if(n.getKeyLeftOf){var ie,me,ve;let Z=e.focusedKey!=null?(ie=n.getKeyLeftOf)===null||ie===void 0?void 0:ie.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(me=n.getFirstKey)===null||me===void 0?void 0:me.call(n,e.focusedKey):(ve=n.getLastKey)===null||ve===void 0?void 0:ve.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var ce,K,W;let Z=e.focusedKey!=null?(ce=n.getKeyRightOf)===null||ce===void 0?void 0:ce.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(K=n.getLastKey)===null||K===void 0?void 0:K.call(n,e.focusedKey):(W=n.getFirstKey)===null||W===void 0?void 0:W.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getFirstKey(e.focusedKey,ca(P));e.setFocusedKey(Z),Z!=null&&(ca(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getLastKey(e.focusedKey,ca(P));e.setFocusedKey(Z),Z!=null&&(ca(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let Z=n.getKeyPageBelow(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let Z=n.getKeyPageAbove(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"a":ca(P)&&e.selectionMode==="multiple"&&o!==!0&&(P.preventDefault(),e.selectAll());break;case"Escape":s==="clearSelection"&&!a&&e.selectedKeys.size!==0&&(P.stopPropagation(),P.preventDefault(),e.clearSelection());break;case"Tab":if(!h){if(P.shiftKey)r.current.focus();else{let Z=ut(r.current,{tabbable:!0}),ee,De;do De=Z.lastChild(),De&&(ee=De);while(De);ee&&!ee.contains(document.activeElement)&&Bt(ee)}break}}},"onKeyDown"),$=(0,wp.element.useRef)({top:0,left:0});un(m,"scroll",p?void 0:()=>{var P,R,L,k;$.current={top:(L=(P=m.current)===null||P===void 0?void 0:P.scrollTop)!==null&&L!==void 0?L:0,left:(k=(R=m.current)===null||R===void 0?void 0:R.scrollLeft)!==null&&k!==void 0?k:0}});let v=u(P=>{if(e.isFocused){P.currentTarget.contains(P.target)||e.setFocused(!1);return}if(P.currentTarget.contains(P.target)){if(e.setFocused(!0),e.focusedKey==null){var R,L;let N=u(G=>{G!=null&&(e.setFocusedKey(G),c&&!e.isSelected(G)&&e.replaceSelection(G))},"navigateToKey"),z=P.relatedTarget;var k,F;z&&P.currentTarget.compareDocumentPosition(z)&Node.DOCUMENT_POSITION_FOLLOWING?N((k=e.lastSelectedKey)!==null&&k!==void 0?k:(R=n.getLastKey)===null||R===void 0?void 0:R.call(n)):N((F=e.firstSelectedKey)!==null&&F!==void 0?F:(L=n.getFirstKey)===null||L===void 0?void 0:L.call(n))}else!p&&m.current&&(m.current.scrollTop=$.current.top,m.current.scrollLeft=$.current.left);if(e.focusedKey!=null&&m.current){let N=Md(r,e.focusedKey);N instanceof HTMLElement&&(!N.contains(document.activeElement)&&!f&&Bt(N),Zo()==="keyboard"&&Kc(N,{containingElement:r.current}))}}},"onFocus"),S=u(P=>{P.currentTarget.contains(P.relatedTarget)||e.setFocused(!1)},"onBlur"),x=(0,wp.element.useRef)(!1);un(r,KB,f?P=>{let{detail:R}=P;P.stopPropagation(),e.setFocused(!0),R?.focusStrategy==="first"&&(x.current=!0)}:void 0);let C=Me(()=>{var P,R;let L=(R=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&R!==void 0?R:null;if(L==null){let k=Ke();Nw(r.current),Eg(k,null),e.collection.size>0&&(x.current=!1)}else e.setFocusedKey(L),x.current=!1});e3(()=>{x.current&&C()},[e.collection,C]);let Q=Me(()=>{e.collection.size>0&&(x.current=!1)});e3(()=>{Q()},[e.focusedKey,Q]),un(r,YB,f?P=>{var R;P.stopPropagation(),e.setFocused(!1),!((R=P.detail)===null||R===void 0)&&R.clearFocusKey&&e.setFocusedKey(null)}:void 0);const T=(0,wp.element.useRef)(i),B=(0,wp.element.useRef)(!1);(0,wp.element.useEffect)(()=>{if(T.current){var P,R;let F=null;var L;i==="first"&&(F=(L=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&L!==void 0?L:null);var k;i==="last"&&(F=(k=(R=n.getLastKey)===null||R===void 0?void 0:R.call(n))!==null&&k!==void 0?k:null);let N=e.selectedKeys;if(N.size){for(let z of N)if(e.canSelectItem(z)){F=z;break}}e.setFocused(!0),e.setFocusedKey(F),F==null&&!f&&r.current&&Ki(r.current),e.collection.size>0&&(T.current=!1,B.current=!0)}});let w=(0,wp.element.useRef)(e.focusedKey),M=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==w.current||B.current)&&m.current&&r.current){let P=Zo(),R=Md(r,e.focusedKey);if(!(R instanceof HTMLElement))return;(P==="keyboard"||B.current)&&(M.current&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame(()=>{m.current&&(r3(m.current,R),P!=="virtual"&&Kc(R,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&w.current!=null&&r.current&&Ki(r.current),w.current=e.focusedKey,B.current=!1}),(0,wp.element.useEffect)(()=>()=>{M.current&&cancelAnimationFrame(M.current)},[]),un(r,"react-aria-focus-scope-restore",P=>{P.preventDefault(),e.setFocused(!0)});let A={onKeyDown:y,onFocus:v,onBlur:S,onMouseDown(P){m.current===P.target&&P.preventDefault()}},{typeSelectProps:E}=eD({keyboardDelegate:n,selectionManager:e});d||(A=ne(E,A));let I;f||(I=e.focusedKey==null?0:-1);let D=_N(e.collection);return{collectionProps:ne(A,{tabIndex:I,"data-collection":D})}}u(tD,"$ae20dd8cbca75726$export$d6daf82dcd84e87c");function tF(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:l,shouldUseVirtualFocus:a,focus:o,isDisabled:s,onAction:c,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,h=Wc();e=Ie(e);let p=u(k=>{if(k.pointerType==="keyboard"&&Hg(k))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&i.current){let F=n.getItemProps(r);h.open(i.current,k,F.href,F.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):k&&k.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||k&&(ca(k)||k.pointerType==="touch"||k.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}},"onSelect");(0,wp.element.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(a?Nw(i.current):o?o():document.activeElement!==i.current&&i.current&&Ki(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,a]),s=s||n.isDisabled(r);let m={};!a&&!s?m={tabIndex:r===n.focusedKey?0:-1,onFocus(k){k.target===i.current&&n.setFocusedKey(r)}}:s&&(m.onMouseDown=k=>{k.preventDefault()});let g=n.isLink(r)&&f==="override",O=c&&t.UNSTABLE_itemBehavior==="action",b=n.isLink(r)&&f!=="selection"&&f!=="none",y=!s&&n.canSelectItem(r)&&!g&&!O,$=(c||b)&&!s,v=$&&(n.selectionBehavior==="replace"?!y:!y||n.isEmpty),S=$&&y&&n.selectionBehavior==="replace",x=v||S,C=(0,wp.element.useRef)(null),Q=x&&y,T=(0,wp.element.useRef)(!1),B=(0,wp.element.useRef)(!1),w=n.getItemProps(r),M=u(k=>{if(c){var F;c(),(F=i.current)===null||F===void 0||F.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}b&&i.current&&h.open(i.current,k,w.href,w.routerOptions)},"performAction"),A={ref:i};if(l?(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,k.pointerType==="keyboard"&&(!x||rD())&&p(k)},d?(A.onPressUp=v?void 0:k=>{k.pointerType==="mouse"&&y&&p(k)},A.onPress=v?M:k=>{k.pointerType!=="keyboard"&&k.pointerType!=="mouse"&&y&&p(k)}):A.onPress=k=>{if(v||S&&k.pointerType!=="mouse"){if(k.pointerType==="keyboard"&&!nD())return;M(k)}else k.pointerType!=="keyboard"&&y&&p(k)}):(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,B.current=v,y&&(k.pointerType==="mouse"&&!v||k.pointerType==="keyboard"&&(!$||rD()))&&p(k)},A.onPress=k=>{(k.pointerType==="touch"||k.pointerType==="pen"||k.pointerType==="virtual"||k.pointerType==="keyboard"&&x&&nD()||k.pointerType==="mouse"&&B.current)&&(x?M(k):y&&p(k))}),m["data-collection"]=HN(n.collection),m["data-key"]=r,A.preventFocusOnPress=a,a&&(A=ne(A,{onPressStart(k){k.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(k){k.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),w)for(let k of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])w[k]&&(A[k]=vr(A[k],w[k]));let{pressProps:E,isPressed:I}=Zn(A),D=S?k=>{C.current==="mouse"&&(k.stopPropagation(),k.preventDefault(),M(k))}:void 0,{longPressProps:P}=D3({isDisabled:!Q,onLongPress(k){k.pointerType==="touch"&&(p(k),n.setSelectionBehavior("toggle"))}}),R=u(k=>{C.current==="touch"&&T.current&&k.preventDefault()},"onDragStartCapture"),L=f!=="none"&&n.isLink(r)?k=>{ji.isOpening||k.preventDefault()}:void 0;return{itemProps:ne(m,y||v||a&&!s?E:{},Q?P:{},{onDoubleClick:D,onDragStartCapture:R,onClick:L,id:e},a?{onMouseDown:k=>k.preventDefault()}:void 0),isPressed:I,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:s,allowsSelection:y,hasAction:x}}u(tF,"$880e95eb8b93ba9a$export$ecf600387e221c37");function nD(){let t=window.event;return t?.key==="Enter"}u(nD,"$880e95eb8b93ba9a$var$isActionKey");function rD(){let t=window.event;return t?.key===" "||t?.code==="Space"}u(rD,"$880e95eb8b93ba9a$var$isSelectionKey");const bv=class bv{getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?Md(this.ref,e):null;if(!r)return null;let i=n.getBoundingClientRect(),l=r.getBoundingClientRect();return{x:l.left-i.left-n.clientLeft+n.scrollLeft,y:l.top-i.top-n.clientTop+n.scrollTop,width:l.width,height:l.height}}getContentSize(){let e=this.ref.current;var n,r;return{width:(n=e?.scrollWidth)!==null&&n!==void 0?n:0,height:(r=e?.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let e=this.ref.current;var n,r,i,l;return{x:(n=e?.scrollLeft)!==null&&n!==void 0?n:0,y:(r=e?.scrollTop)!==null&&r!==void 0?r:0,width:(i=e?.clientWidth)!==null&&i!==void 0?i:0,height:(l=e?.clientHeight)!==null&&l!==void 0?l:0}}constructor(e){this.ref=e}};u(bv,"$657e4dc4a6e88df0$export$8f5ed9ff9f511381");let Bd=bv;const yv=class yv{isDisabled(e){var n;return this.disabledBehavior==="all"&&(((n=e.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,n){let r=e;for(;r!=null;){let i=this.collection.getItem(r);if(i?.type==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(e){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(e){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(e,n,r){let i=e,l=this.layoutDelegate.getItemRect(i);if(!l||i==null)return null;let a=l;do{if(i=n(i),i==null)break;l=this.layoutDelegate.getItemRect(i)}while(l&&r(a,l)&&i!=null);return i}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,n){return n?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!ua(n))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let l=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let l=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!ua(n))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let l=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xl||new ps({collection:n,disabledKeys:r,disabledBehavior:s,ref:i,collator:o,layoutDelegate:a}),[l,a,n,r,i,o,s]),{collectionProps:d}=tD({...t,ref:i,selectionManager:e,keyboardDelegate:c});return{listProps:d}}u(nF,"$982254629710d113$export$b95089534ab7c1fd");function iD(t,e,n){let r=yt(t,{labelable:!0}),i=t.selectionBehavior||"toggle",l=t.linkBehavior||(i==="replace"?"action":"override");i==="toggle"&&l==="action"&&(l="override");let{listProps:a}=nF({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:l}),{focusWithinProps:o}=Wt({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),s=Ie(t.id);Qd.set(e,{id:s,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:l,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:c,fieldProps:d}=kd({...t,id:s,labelElementType:"span"});return{labelProps:c,listBoxProps:ne(r,o,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...ne(d,a)})}}u(iD,"$c132121280ec012d$export$50eacbbf140a3141");function lD(t){return null}u(lD,"$c1d7fb2ec91bae71$var$Item"),lD.getCollectionNode=u(function*(e,n){let{childItems:r,title:i,children:l}=e,a=e.title||e.children,o=e.textValue||(typeof a=="string"?a:"")||e["aria-label"]||"";!o&&!n?.suppressTextValueWarning&&process.env.NODE_ENV!=="production"&&console.warn(" with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:e,rendered:a,textValue:o,"aria-label":e["aria-label"],hasChildNodes:rF(e),*childNodes(){if(r)for(let s of r)yield{type:"item",value:s};else if(i){let s=[];wp.element.Children.forEach(l,c=>{s.push({type:"item",element:c})}),yield*s}}}},"getCollectionNode");function rF(t){return t.hasChildItems!=null?t.hasChildItems:!!(t.childItems||t.title&&wp.element.Children.count(t.children)>0)}u(rF,"$c1d7fb2ec91bae71$var$hasChildItems");let Qr=lD;function aD(t){return null}u(aD,"$9fc4852771d079eb$var$Section"),aD.getCollectionNode=u(function*(e){let{children:n,title:r,items:i}=e;yield{type:"section",props:e,hasChildNodes:!0,rendered:r,"aria-label":e["aria-label"],*childNodes(){if(typeof n=="function"){if(!i)throw new Error("props.children was a function but props.items is missing");for(let l of i)yield{type:"item",value:l,renderer:n}}else{let l=[];wp.element.Children.forEach(n,a=>{l.push({type:"item",element:a})}),yield*l}}}},"getCollectionNode");let iF=aD;const vv=class vv{build(e,n){return this.context=n,oD(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(wp.element.isValidElement(n)&&n.type===wp.element.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let l of r)yield*this.getFullNode({value:l,index:i},{renderer:n}),i++}else{let i=[];wp.element.Children.forEach(n,a=>{a&&i.push(a)});let l=0;for(let a of i){let o=this.getFullNode({element:a,index:l},{});for(let s of o)l++,yield s}}}getKey(e,n,r,i){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let l=n.value;if(l!=null){var a;let o=(a=l.key)!==null&&a!==void 0?a:l.id;if(o==null)throw new Error("No key found for item");return o}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,i){if(wp.element.isValidElement(e.element)&&e.element.type===wp.element.Fragment){let O=[];wp.element.Children.forEach(e.element.props.children,y=>{O.push(y)});var l;let b=(l=e.index)!==null&&l!==void 0?l:0;for(const y of O)yield*this.getFullNode({element:y,index:b++},n,r,i);return}let a=e.element;if(!a&&e.value&&n&&n.renderer){let O=this.cache.get(e.value);if(O&&(!O.shouldInvalidate||!O.shouldInvalidate(this.context))){O.index=e.index,O.parentKey=i?i.key:null,yield O;return}a=n.renderer(e.value)}if(wp.element.isValidElement(a)){let O=a.type;if(typeof O!="function"&&typeof O.getCollectionNode!="function"){let v=a.type;throw new Error(`Unknown element <${v}> in collection.`)}let b=O.getCollectionNode(a.props,this.context);var o;let y=(o=e.index)!==null&&o!==void 0?o:0,$=b.next();for(;!$.done&&$.value;){let v=$.value;e.index=y;var s;let S=(s=v.key)!==null&&s!==void 0?s:null;S==null&&(S=v.element?null:this.getKey(a,e,n,r));let C=[...this.getFullNode({...v,key:S,index:y,wrapper:lF(e.wrapper,v.wrapper)},this.getChildState(n,v),r?`${r}${a.key}`:a.key,i)];for(let Q of C){var c,d;Q.value=(d=(c=v.value)!==null&&c!==void 0?c:e.value)!==null&&d!==void 0?d:null,Q.value&&this.cache.set(Q.value,Q);var f;if(e.type&&Q.type!==e.type)throw new Error(`Unsupported type <${e0(Q.type)}> in <${e0((f=i?.type)!==null&&f!==void 0?f:"unknown parent type")}>. Only <${e0(e.type)}> is supported.`);y++,yield Q}$=b.next(C)}return}if(e.key==null||e.type==null)return;let h=this;var p,m;let g={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:(p=e.value)!==null&&p!==void 0?p:null,level:i?i.level+1:0,index:e.index,rendered:e.rendered,textValue:(m=e.textValue)!==null&&m!==void 0?m:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:oD(function*(){if(!e.hasChildNodes||!e.childNodes)return;let O=0;for(let b of e.childNodes()){b.key!=null&&(b.key=`${g.key}${b.key}`);let y=h.getFullNode({...b,index:O},h.getChildState(n,b),g.key,g);for(let $ of y)O++,yield $}})};yield g}constructor(){this.cache=new WeakMap}};u(vv,"$eb2240fc39a57fa5$export$bf788dd355e3a401");let Jg=vv;function oD(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}u(oD,"$eb2240fc39a57fa5$var$iterable");function lF(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}u(lF,"$eb2240fc39a57fa5$var$compose");function e0(t){return t[0].toUpperCase()+t.slice(1)}u(e0,"$eb2240fc39a57fa5$var$capitalize");function aF(t,e,n){let r=(0,wp.element.useMemo)(()=>new Jg,[]),{children:i,items:l,collection:a}=t;return(0,wp.element.useMemo)(()=>{if(a)return a;let s=r.build({children:i,items:l},n);return e(s)},[r,i,l,a,n,e])}u(aF,"$7613b1592d41b092$export$6cd28814d92fa9c9");function Rd(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}u(Rd,"$c5a24bc478652b5f$export$1005530eda016c13");function oF(t){return sF(t,0)}u(oF,"$c5a24bc478652b5f$export$fbdeaa6a76694f71");function sF(t,e){if(e<0)return;let n=0;for(let r of t){if(n===e)return r;n++}}u(sF,"$c5a24bc478652b5f$export$5f3398f8733f90e2");function t0(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...sD(t,e),e],i=[...sD(t,n),n],l=r.slice(0,i.length).findIndex((a,o)=>a!==i[o]);return l!==-1?(e=r[l],n=i[l],e.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===e)>=0,-1)}u(t0,"$c5a24bc478652b5f$export$8c434b3a7a4dad6");function sD(t,e){let n=[],r=e;for(;r?.parentKey!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}u(sD,"$c5a24bc478652b5f$var$getAncestors");const uD=new WeakMap;function cD(t){let e=uD.get(t);if(e!=null)return e;let n=0,r=u(i=>{for(let l of i)l.type==="section"?r(Rd(l,t)):l.type==="item"&&n++},"countItems");return r(t),uD.set(t,n),n}u(cD,"$453cc9f0df89c0a5$export$77d5aafae4e095b2");function uF(t,e,n){var r,i;let{key:l}=t,a=Qd.get(e);var o;let s=(o=t.isDisabled)!==null&&o!==void 0?o:e.selectionManager.isDisabled(l);var c;let d=(c=t.isSelected)!==null&&c!==void 0?c:e.selectionManager.isSelected(l);var f;let h=(f=t.shouldSelectOnPressUp)!==null&&f!==void 0?f:a?.shouldSelectOnPressUp;var p;let m=(p=t.shouldFocusOnHover)!==null&&p!==void 0?p:a?.shouldFocusOnHover;var g;let O=(g=t.shouldUseVirtualFocus)!==null&&g!==void 0?g:a?.shouldUseVirtualFocus;var b;let y=(b=t.isVirtualized)!==null&&b!==void 0?b:a?.isVirtualized,$=sa(),v=sa(),S={role:"option","aria-disabled":s||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?d:void 0};wr()&&mm()||(S["aria-label"]=t["aria-label"],S["aria-labelledby"]=$,S["aria-describedby"]=v);let x=e.collection.getItem(l);if(y){let P=Number(x?.index);S["aria-posinset"]=Number.isNaN(P)?void 0:P+1,S["aria-setsize"]=cD(e.collection)}let C=a?.onAction?()=>{var P;return a==null||(P=a.onAction)===null||P===void 0?void 0:P.call(a,l)}:void 0,Q=Hk(e,l),{itemProps:T,isPressed:B,isFocused:w,hasAction:M,allowsSelection:A}=tF({selectionManager:e.selectionManager,key:l,ref:n,shouldSelectOnPressUp:h,allowsDifferentPressOrigin:h&&m,isVirtualized:y,shouldUseVirtualFocus:O,isDisabled:s,onAction:C||!(x==null||(r=x.props)===null||r===void 0)&&r.onAction?vr(x==null||(i=x.props)===null||i===void 0?void 0:i.onAction,C):void 0,linkBehavior:a?.linkBehavior,UNSTABLE_itemBehavior:a?.UNSTABLE_itemBehavior,id:Q}),{hoverProps:E}=$R({isDisabled:s||!m,onHoverStart(){nd()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l))}}),I=yt(x?.props);delete I.id;let D=LB(x?.props);return{optionProps:{...S,...ne(I,T,E,D),id:Q},labelProps:{id:$},descriptionProps:{id:v},isFocused:w,isFocusVisible:w&&e.selectionManager.isFocused&&nd(),isSelected:d,isDisabled:s,isPressed:B,allowsSelection:A,hasAction:M}}u(uF,"$293f70390ea03370$export$497855f14858aa34");function cF(t){let{heading:e,"aria-label":n}=t,r=Ie();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}u(cF,"$af383d3bef1cfdc9$export$c3f9f39876e4bc7");var dD={};dD={longPressMessage:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u0627\u064B \u0623\u0648 \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 Alt + \u0627\u0644\u0633\u0647\u0645 \u0644\u0623\u0633\u0641\u0644 \u0644\u0641\u062A\u062D \u0627\u0644\u0642\u0627\u0626\u0645\u0629"};var fD={};fD={longPressMessage:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E \u0438\u043B\u0438 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Alt+ \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u0434\u043E\u043B\u0443, \u0437\u0430 \u0434\u0430 \u043E\u0442\u0432\u043E\u0440\u0438\u0442\u0435 \u043C\u0435\u043D\u044E\u0442\u043E"};var hD={};hD={longPressMessage:"Dlouh\xFDm stiskem nebo stisknut\xEDm kl\xE1ves Alt + \u0161ipka dol\u016F otev\u0159ete nab\xEDdku"};var pD={};pD={longPressMessage:"Langt tryk eller tryk p\xE5 Alt + pil ned for at \xE5bne menuen"};var mD={};mD={longPressMessage:"Dr\xFCcken Sie lange oder dr\xFCcken Sie Alt + Nach-unten, um das Men\xFC zu \xF6ffnen"};var gD={};gD={longPressMessage:"\u03A0\u03B9\u03AD\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03AE \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 Alt + \u03BA\u03AC\u03C4\u03C9 \u03B2\u03AD\u03BB\u03BF\u03C2 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B1\u03BD\u03BF\u03AF\u03BE\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BC\u03B5\u03BD\u03BF\u03CD"};var OD={};OD={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var bD={};bD={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xFA"};var yD={};yD={longPressMessage:"Men\xFC\xFC avamiseks vajutage pikalt v\xF5i vajutage klahve Alt + allanool"};var vD={};vD={longPressMessage:"Avaa valikko painamalla pohjassa tai n\xE4pp\xE4inyhdistelm\xE4ll\xE4 Alt + Alanuoli"};var $D={};$D={longPressMessage:"Appuyez de mani\xE8re prolong\xE9e ou appuyez sur Alt\xA0+\xA0Fl\xE8che vers le bas pour ouvrir le menu."};var wD={};wD={longPressMessage:"\u05DC\u05D7\u05E5 \u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05D0\u05D5 \u05D4\u05E7\u05E9 Alt + ArrowDown \u05DB\u05D3\u05D9 \u05DC\u05E4\u05EA\u05D5\u05D7 \u05D0\u05EA \u05D4\u05EA\u05E4\u05E8\u05D9\u05D8"};var xD={};xD={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var SD={};SD={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele ny\xEDl gombot a men\xFC megnyit\xE1s\xE1hoz"};var CD={};CD={longPressMessage:"Premere a lungo o premere Alt + Freccia gi\xF9 per aprire il menu"};var kD={};kD={longPressMessage:"\u9577\u62BC\u3057\u307E\u305F\u306F Alt+\u4E0B\u77E2\u5370\u30AD\u30FC\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u958B\u304F"};var DD={};DD={longPressMessage:"\uAE38\uAC8C \uB204\uB974\uAC70\uB098 Alt + \uC544\uB798\uCABD \uD654\uC0B4\uD45C\uB97C \uB20C\uB7EC \uBA54\uB274 \uC5F4\uAE30"};var PD={};PD={longPressMessage:"Nor\u0117dami atidaryti meniu, nuspaud\u0119 palaikykite arba paspauskite \u201EAlt + ArrowDown\u201C."};var ED={};ED={longPressMessage:"Lai atv\u0113rtu izv\u0113lni, turiet nospiestu vai nospiediet tausti\u0146u kombin\u0101ciju Alt + lejupv\u0113rst\u0101 bulti\u0146a"};var TD={};TD={longPressMessage:"Langt trykk eller trykk Alt + PilNed for \xE5 \xE5pne menyen"};var AD={};AD={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var QD={};QD={longPressMessage:"Naci\u015Bnij i przytrzymaj lub naci\u015Bnij klawisze Alt + Strza\u0142ka w d\xF3\u0142, aby otworzy\u0107 menu"};var MD={};MD={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var BD={};BD={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var RD={};RD={longPressMessage:"Ap\u0103sa\u021Bi lung sau ap\u0103sa\u021Bi pe Alt + s\u0103geat\u0103 \xEEn jos pentru a deschide meniul"};var VD={};VD={longPressMessage:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0438\u043B\u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 Alt + \u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E"};var ND={};ND={longPressMessage:"Ponuku otvor\xEDte dlh\xFDm stla\u010Den\xEDm alebo stla\u010Den\xEDm kl\xE1vesu Alt + kl\xE1vesu so \u0161\xEDpkou nadol"};var FD={};FD={longPressMessage:"Za odprtje menija pritisnite in dr\u017Eite gumb ali pritisnite Alt+pu\u0161\u010Dica navzdol"};var ID={};ID={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var LD={};LD={longPressMessage:"H\xE5ll nedtryckt eller tryck p\xE5 Alt + pil ned\xE5t f\xF6r att \xF6ppna menyn"};var zD={};zD={longPressMessage:"Men\xFCy\xFC a\xE7mak i\xE7in uzun bas\u0131n veya Alt + A\u015Fa\u011F\u0131 Ok tu\u015Funa bas\u0131n"};var ZD={};ZD={longPressMessage:"\u0414\u043E\u0432\u0433\u043E \u0430\u0431\u043E \u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E \u043D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u043A\u043E\u043C\u0431\u0456\u043D\u0430\u0446\u0456\u044E \u043A\u043B\u0430\u0432\u0456\u0448 Alt \u0456 \u0441\u0442\u0440\u0456\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0449\u043E\u0431 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u043C\u0435\u043D\u044E"};var XD={};XD={longPressMessage:"\u957F\u6309\u6216\u6309 Alt + \u5411\u4E0B\u65B9\u5411\u952E\u4EE5\u6253\u5F00\u83DC\u5355"};var jD={};jD={longPressMessage:"\u9577\u6309\u6216\u6309 Alt+\u5411\u4E0B\u9375\u4EE5\u958B\u555F\u529F\u80FD\u8868"};var qD={};qD={"ar-AE":dD,"bg-BG":fD,"cs-CZ":hD,"da-DK":pD,"de-DE":mD,"el-GR":gD,"en-US":OD,"es-ES":bD,"et-EE":yD,"fi-FI":vD,"fr-FR":$D,"he-IL":wD,"hr-HR":xD,"hu-HU":SD,"it-IT":CD,"ja-JP":kD,"ko-KR":DD,"lt-LT":PD,"lv-LV":ED,"nb-NO":TD,"nl-NL":AD,"pl-PL":QD,"pt-BR":MD,"pt-PT":BD,"ro-RO":RD,"ru-RU":VD,"sk-SK":ND,"sl-SI":FD,"sr-SP":ID,"sv-SE":LD,"tr-TR":zD,"uk-UA":ZD,"zh-CN":XD,"zh-TW":jD};function dF(t){return t&&t.__esModule?t.default:t}u(dF,"$parcel$interopDefault$6");function WD(t,e,n){let{type:r="menu",isDisabled:i,trigger:l="press"}=t,a=Ie(),{triggerProps:o,overlayProps:s}=cs({type:r},e,n),c=u(p=>{if(!i&&!(l==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(l==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},"onKeyDown"),d=Yt(dF(qD),"@react-aria/menu"),{longPressProps:f}=D3({isDisabled:i||l!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),h={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!i&&(Bt(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!i&&(Bt(p.target),e.toggle())}};return delete o.onPress,{menuTriggerProps:{...o,...l==="press"?h:f,id:a,onKeyDown:c},menuProps:{...s,"aria-labelledby":a,autoFocus:e.focusStrategy||!0,onClose:e.close}}}u(WD,"$168583247155ddda$export$dc9c12ed27dd1b49");function fF(t){return t&&t.__esModule?t.default:t}u(fF,"$parcel$interopDefault$5");function YD(t,e){let{buttonRef:n,popoverRef:r,inputRef:i,listBoxRef:l,keyboardDelegate:a,layoutDelegate:o,shouldFocusWrap:s,isReadOnly:c,isDisabled:d}=t,f=(0,wp.element.useRef)(null);n=n??f;let h=Yt(fF(ek),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:m}=WD({type:"listbox",isDisabled:d||c},e,n);Qd.set(e,{id:m.id});let{collection:g}=e,{disabledKeys:O}=e.selectionManager,b=(0,wp.element.useMemo)(()=>a||new ps({collection:g,disabledKeys:O,ref:l,layoutDelegate:o}),[a,o,g,O,l]),{collectionProps:y}=tD({selectionManager:e.selectionManager,keyboardDelegate:b,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:s,ref:i,isVirtualized:!0}),$=Wc(),v=u(W=>{if(!W.nativeEvent.isComposing)switch(W.key){case"Enter":case"Tab":if(e.isOpen&&W.key==="Enter"&&W.preventDefault(),e.isOpen&&l.current&&e.selectionManager.focusedKey!=null){let Z=e.collection.getItem(e.selectionManager.focusedKey);if(Z?.props.href){let ee=l.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);W.key==="Enter"&&ee instanceof HTMLAnchorElement&&$.open(ee,W,Z.props.href,Z.props.routerOptions),e.close();break}else if(Z?.props.onAction){Z.props.onAction(),e.close();break}}e.commit();break;case"Escape":(e.selectedKey!==null||e.inputValue===""||t.allowsCustomValue)&&W.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},"onKeyDown"),S=u(W=>{var Z;let ee=n?.current&&n.current===W.relatedTarget,De=(Z=r.current)===null||Z===void 0?void 0:Z.contains(W.relatedTarget);ee||De||(t.onBlur&&t.onBlur(W),e.setFocused(!1))},"onBlur"),x=u(W=>{e.isFocused||(t.onFocus&&t.onFocus(W),e.setFocused(!0))},"onFocus"),{isInvalid:C,validationErrors:Q,validationDetails:T}=e.displayValidation,{labelProps:B,inputProps:w,descriptionProps:M,errorMessageProps:A}=si({...t,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:vr(e.isOpen&&y.onKeyDown,v,t.onKeyDown),onBlur:S,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:x,autoComplete:"off",validate:void 0,[Ar]:e},i),E=u(W=>{if(W.pointerType==="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(null,"manual")}},"onPress"),I=u(W=>{if(W.pointerType!=="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(W.pointerType==="keyboard"||W.pointerType==="virtual"?"first":null,"manual")}},"onPressStart"),D=zn({id:p.id,"aria-label":h.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),P=zn({id:m.id,"aria-label":h.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),R=(0,wp.element.useRef)(0),L=u(W=>{if(d||c)return;if(W.timeStamp-R.current<500){var Z;W.preventDefault(),(Z=i.current)===null||Z===void 0||Z.focus();return}let ee=W.target.getBoundingClientRect(),De=W.changedTouches[0],qt=Math.ceil(ee.left+.5*ee.width),ni=Math.ceil(ee.top+.5*ee.height);if(De.clientX===qt&&De.clientY===ni){var br;W.preventDefault(),(br=i.current)===null||br===void 0||br.focus(),e.toggle(null,"manual"),R.current=W.timeStamp}},"onTouchEnd"),k=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0;var F;let N=(F=k?.parentKey)!==null&&F!==void 0?F:null;var z;let G=(z=e.selectionManager.focusedKey)!==null&&z!==void 0?z:null,le=(0,wp.element.useRef)(N),ie=(0,wp.element.useRef)(G);(0,wp.element.useEffect)(()=>{if(qc()&&k!=null&&G!=null&&G!==ie.current){let Z=e.selectionManager.isSelected(G),ee=N!=null?e.collection.getItem(N):null,De=ee?.["aria-label"]||(typeof ee?.rendered=="string"?ee.rendered:"")||"";var W;let qt=h.format("focusAnnouncement",{isGroupChange:(W=ee&&N!==le.current)!==null&&W!==void 0?W:!1,groupTitle:De,groupCount:ee?[...Rd(ee,e.collection)].length:0,optionText:k["aria-label"]||k.textValue||"",isSelected:Z});$a(qt)}le.current=N,ie.current=G});let me=cD(e.collection),ve=(0,wp.element.useRef)(me),ce=(0,wp.element.useRef)(e.isOpen);(0,wp.element.useEffect)(()=>{let W=e.isOpen!==ce.current&&(e.selectionManager.focusedKey==null||qc());if(e.isOpen&&(W||me!==ve.current)){let Z=h.format("countAnnouncement",{optionCount:me});$a(Z)}ve.current=me,ce.current=e.isOpen});let K=(0,wp.element.useRef)(e.selectedKey);return(0,wp.element.useEffect)(()=>{if(qc()&&e.isFocused&&e.selectedItem&&e.selectedKey!==K.current){let W=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",Z=h.format("selectedAnnouncement",{optionText:W});$a(Z)}K.current=e.selectedKey}),(0,wp.element.useEffect)(()=>{if(e.isOpen)return _g([i.current,r.current].filter(W=>W!=null))},[e.isOpen,i,r]),bm(()=>{!k&&i.current&&Ke(he(i.current))===i.current&&Eg(i.current,null)},[k]),un(l,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:B,buttonProps:{...p,...D,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:E,onPressStart:I,isDisabled:d||c},inputProps:ne(w,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?m.id:void 0,"aria-autocomplete":"list","aria-activedescendant":k?Hk(e,k.key):void 0,onTouchEnd:L,autoCorrect:"off",spellCheck:"false"}),listBoxProps:ne(m,P,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),descriptionProps:M,errorMessageProps:A,isInvalid:C,validationErrors:Q,validationDetails:T}}u(YD,"$c350ade66beef0af$export$8c18d1b4f7232bbf");var KD={};KD={calendar:"\u0627\u0644\u062A\u0642\u0648\u064A\u0645",day:"\u064A\u0648\u0645",dayPeriod:"\u0635/\u0645",endDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621",era:"\u0627\u0644\u0639\u0635\u0631",hour:"\u0627\u0644\u0633\u0627\u0639\u0627\u062A",minute:"\u0627\u0644\u062F\u0642\u0627\u0626\u0642",month:"\u0627\u0644\u0634\u0647\u0631",second:"\u0627\u0644\u062B\u0648\u0627\u0646\u064A",selectedDateDescription:t=>`\u062A\u0627\u0631\u064A\u062E \u0645\u062D\u062F\u062F: ${t.date}`,selectedRangeDescription:t=>`\u0627\u0644\u0645\u062F\u0649 \u0627\u0644\u0632\u0645\u0646\u064A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.startDate} \u0625\u0644\u0649 ${t.endDate}`,selectedTimeDescription:t=>`\u0627\u0644\u0648\u0642\u062A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.time}`,startDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621",timeZoneName:"\u0627\u0644\u062A\u0648\u0642\u064A\u062A",weekday:"\u0627\u0644\u064A\u0648\u0645",year:"\u0627\u0644\u0633\u0646\u0629"};var UD={};UD={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D",dayPeriod:"\u043F\u0440.\u043E\u0431./\u0441\u043B.\u043E\u0431.",endDate:"\u041A\u0440\u0430\u0439\u043D\u0430 \u0434\u0430\u0442\u0430",era:"\u0435\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u0434\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u043E \u0432\u0440\u0435\u043C\u0435: ${t.time}`,startDate:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430 \u0434\u0430\u0442\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0435\u043D \u043E\u0442 \u0441\u0435\u0434\u043C\u0438\u0446\u0430\u0442\u0430",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var GD={};GD={calendar:"Kalend\xE1\u0159",day:"den",dayPeriod:"\u010D\xE1st dne",endDate:"Kone\u010Dn\xE9 datum",era:"letopo\u010Det",hour:"hodina",minute:"minuta",month:"m\u011Bs\xEDc",second:"sekunda",selectedDateDescription:t=>`Vybran\xE9 datum: ${t.date}`,selectedRangeDescription:t=>`Vybran\xE9 obdob\xED: ${t.startDate} a\u017E ${t.endDate}`,selectedTimeDescription:t=>`Vybran\xFD \u010Das: ${t.time}`,startDate:"Po\u010D\xE1te\u010Dn\xED datum",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"den v t\xFDdnu",year:"rok"};var _D={};_D={calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xE6ra",hour:"time",minute:"minut",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt interval: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tidspunkt: ${t.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xE5r"};var HD={};HD={calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xE4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:t=>`Ausgew\xE4hltes Datum: ${t.date}`,selectedRangeDescription:t=>`Ausgew\xE4hlter Bereich: ${t.startDate} bis ${t.endDate}`,selectedTimeDescription:t=>`Ausgew\xE4hlte Zeit: ${t.time}`,startDate:"Startdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"};var JD={};JD={calendar:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BB\u03CC\u03B3\u03B9\u03BF",day:"\u03B7\u03BC\u03AD\u03C1\u03B1",dayPeriod:"\u03C0.\u03BC./\u03BC.\u03BC.",endDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2",era:"\u03C0\u03B5\u03C1\u03AF\u03BF\u03B4\u03BF\u03C2",hour:"\u03CE\u03C1\u03B1",minute:"\u03BB\u03B5\u03C0\u03C4\u03CC",month:"\u03BC\u03AE\u03BD\u03B1\u03C2",second:"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03BF",selectedDateDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1: ${t.date}`,selectedRangeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03BF \u03B5\u03CD\u03C1\u03BF\u03C2: ${t.startDate} \u03AD\u03C9\u03C2 ${t.endDate}`,selectedTimeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03CE\u03C1\u03B1: ${t.time}`,startDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2",timeZoneName:"\u03B6\u03CE\u03BD\u03B7 \u03CE\u03C1\u03B1\u03C2",weekday:"\u03BA\u03B1\u03B8\u03B7\u03BC\u03B5\u03C1\u03B9\u03BD\u03AE",year:"\u03AD\u03C4\u03BF\u03C2"};var e2={};e2={era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:t=>`Selected Date: ${t.date}`,selectedRangeDescription:t=>`Selected Range: ${t.startDate} to ${t.endDate}`,selectedTimeDescription:t=>`Selected Time: ${t.time}`};var t2={};t2={calendar:"Calendario",day:"d\xEDa",dayPeriod:"a.\xA0m./p.\xA0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:t=>`Fecha seleccionada: ${t.date}`,selectedRangeDescription:t=>`Rango seleccionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora seleccionada: ${t.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xEDa de la semana",year:"a\xF1o"};var n2={};n2={calendar:"Kalender",day:"p\xE4ev",dayPeriod:"enne/p\xE4rast l\xF5unat",endDate:"L\xF5ppkuup\xE4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:t=>`Valitud kuup\xE4ev: ${t.date}`,selectedRangeDescription:t=>`Valitud vahemik: ${t.startDate} kuni ${t.endDate}`,selectedTimeDescription:t=>`Valitud aeg: ${t.time}`,startDate:"Alguskuup\xE4ev",timeZoneName:"ajav\xF6\xF6nd",weekday:"n\xE4dalap\xE4ev",year:"aasta"};var r2={};r2={calendar:"Kalenteri",day:"p\xE4iv\xE4",dayPeriod:"vuorokaudenaika",endDate:"P\xE4\xE4ttymisp\xE4iv\xE4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:t=>`Valittu p\xE4iv\xE4m\xE4\xE4r\xE4: ${t.date}`,selectedRangeDescription:t=>`Valittu aikav\xE4li: ${t.startDate} \u2013 ${t.endDate}`,selectedTimeDescription:t=>`Valittu aika: ${t.time}`,startDate:"Alkamisp\xE4iv\xE4",timeZoneName:"aikavy\xF6hyke",weekday:"viikonp\xE4iv\xE4",year:"vuosi"};var i2={};i2={calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xE8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:t=>`Date s\xE9lectionn\xE9e\xA0: ${t.date}`,selectedRangeDescription:t=>`Plage s\xE9lectionn\xE9e\xA0: ${t.startDate} au ${t.endDate}`,selectedTimeDescription:t=>`Heure choisie\xA0: ${t.time}`,startDate:"Date de d\xE9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xE9e"};var l2={};l2={calendar:"\u05DC\u05D5\u05D7 \u05E9\u05E0\u05D4",day:"\u05D9\u05D5\u05DD",dayPeriod:"\u05DC\u05E4\u05E0\u05D4\u05F4\u05E6/\u05D0\u05D7\u05D4\u05F4\u05E6",endDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05E1\u05D9\u05D5\u05DD",era:"\u05EA\u05E7\u05D5\u05E4\u05D4",hour:"\u05E9\u05E2\u05D4",minute:"\u05D3\u05E7\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",second:"\u05E9\u05E0\u05D9\u05D9\u05D4",selectedDateDescription:t=>`\u05EA\u05D0\u05E8\u05D9\u05DA \u05E0\u05D1\u05D7\u05E8: ${t.date}`,selectedRangeDescription:t=>`\u05D8\u05D5\u05D5\u05D7 \u05E0\u05D1\u05D7\u05E8: ${t.startDate} \u05E2\u05D3 ${t.endDate}`,selectedTimeDescription:t=>`\u05D6\u05DE\u05DF \u05E0\u05D1\u05D7\u05E8: ${t.time}`,startDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05EA\u05D7\u05DC\u05D4",timeZoneName:"\u05D0\u05D6\u05D5\u05E8 \u05D6\u05DE\u05DF",weekday:"\u05D9\u05D5\u05DD \u05D1\u05E9\u05D1\u05D5\u05E2",year:"\u05E9\u05E0\u05D4"};var a2={};a2={calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum zavr\u0161etka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:t=>`Odabrani datum: ${t.date}`,selectedRangeDescription:t=>`Odabrani raspon: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Odabrano vrijeme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"};var o2={};o2={calendar:"Napt\xE1r",day:"nap",dayPeriod:"napszak",endDate:"Befejez\u0151 d\xE1tum",era:"\xE9ra",hour:"\xF3ra",minute:"perc",month:"h\xF3nap",second:"m\xE1sodperc",selectedDateDescription:t=>`Kijel\xF6lt d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Kijel\xF6lt tartom\xE1ny: ${t.startDate}\u2013${t.endDate}`,selectedTimeDescription:t=>`Kijel\xF6lt id\u0151: ${t.time}`,startDate:"Kezd\u0151 d\xE1tum",timeZoneName:"id\u0151z\xF3na",weekday:"h\xE9t napja",year:"\xE9v"};var s2={};s2={calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:t=>`Data selezionata: ${t.date}`,selectedRangeDescription:t=>`Intervallo selezionato: da ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Ora selezionata: ${t.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"};var u2={};u2={calendar:"\u30AB\u30EC\u30F3\u30C0\u30FC",day:"\u65E5",dayPeriod:"\u5348\u524D/\u5348\u5F8C",endDate:"\u7D42\u4E86\u65E5",era:"\u6642\u4EE3",hour:"\u6642",minute:"\u5206",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u629E\u3057\u305F\u65E5\u4ED8 : ${t.date}`,selectedRangeDescription:t=>`\u9078\u629E\u7BC4\u56F2 : ${t.startDate} \u304B\u3089 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u629E\u3057\u305F\u6642\u9593 : ${t.time}`,startDate:"\u958B\u59CB\u65E5",timeZoneName:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3",weekday:"\u66DC\u65E5",year:"\u5E74"};var c2={};c2={calendar:"\uB2EC\uB825",day:"\uC77C",dayPeriod:"\uC624\uC804/\uC624\uD6C4",endDate:"\uC885\uB8CC\uC77C",era:"\uC5F0\uD638",hour:"\uC2DC",minute:"\uBD84",month:"\uC6D4",second:"\uCD08",selectedDateDescription:t=>`\uC120\uD0DD \uC77C\uC790: ${t.date}`,selectedRangeDescription:t=>`\uC120\uD0DD \uBC94\uC704: ${t.startDate} ~ ${t.endDate}`,selectedTimeDescription:t=>`\uC120\uD0DD \uC2DC\uAC04: ${t.time}`,startDate:"\uC2DC\uC791\uC77C",timeZoneName:"\uC2DC\uAC04\uB300",weekday:"\uC694\uC77C",year:"\uB144"};var d2={};d2={calendar:"Kalendorius",day:"diena",dayPeriod:"iki piet\u0173 / po piet\u0173",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minut\u0117",month:"m\u0117nuo",second:"sekund\u0117",selectedDateDescription:t=>`Pasirinkta data: ${t.date}`,selectedRangeDescription:t=>`Pasirinktas intervalas: nuo ${t.startDate} iki ${t.endDate}`,selectedTimeDescription:t=>`Pasirinktas laikas: ${t.time}`,startDate:"Prad\u017Eios data",timeZoneName:"laiko juosta",weekday:"savait\u0117s diena",year:"metai"};var f2={};f2={calendar:"Kalend\u0101rs",day:"diena",dayPeriod:"priek\u0161pusdien\u0101/p\u0113cpusdien\u0101",endDate:"Beigu datums",era:"\u0113ra",hour:"stundas",minute:"min\u016Btes",month:"m\u0113nesis",second:"sekundes",selectedDateDescription:t=>`Atlas\u012Btais datums: ${t.date}`,selectedRangeDescription:t=>`Atlas\u012Btais diapazons: no ${t.startDate} l\u012Bdz ${t.endDate}`,selectedTimeDescription:t=>`Atlas\u012Btais laiks: ${t.time}`,startDate:"S\u0101kuma datums",timeZoneName:"laika josla",weekday:"ned\u0113\u013Cas diena",year:"gads"};var h2={};h2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt omr\xE5de: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tid: ${t.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xE5r"};var p2={};p2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:t=>`Geselecteerde datum: ${t.date}`,selectedRangeDescription:t=>`Geselecteerd bereik: ${t.startDate} tot ${t.endDate}`,selectedTimeDescription:t=>`Geselecteerde tijd: ${t.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"};var m2={};m2={calendar:"Kalendarz",day:"dzie\u0144",dayPeriod:"rano / po po\u0142udniu / wieczorem",endDate:"Data ko\u0144cowa",era:"era",hour:"godzina",minute:"minuta",month:"miesi\u0105c",second:"sekunda",selectedDateDescription:t=>`Wybrana data: ${t.date}`,selectedRangeDescription:t=>`Wybrany zakres: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Wybrany czas: ${t.time}`,startDate:"Data pocz\u0105tkowa",timeZoneName:"strefa czasowa",weekday:"dzie\u0144 tygodnia",year:"rok"};var g2={};g2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var O2={};O2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xE9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data de In\xEDcio",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var b2={};b2={calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dat\u0103 final",era:"er\u0103",hour:"or\u0103",minute:"minut",month:"lun\u0103",second:"secund\u0103",selectedDateDescription:t=>`Dat\u0103 selectat\u0103: ${t.date}`,selectedRangeDescription:t=>`Interval selectat: de la ${t.startDate} p\xE2n\u0103 la ${t.endDate}`,selectedTimeDescription:t=>`Ora selectat\u0103: ${t.time}`,startDate:"Dat\u0103 \xEEnceput",timeZoneName:"fus orar",weekday:"ziua din s\u0103pt\u0103m\xE2n\u0103",year:"an"};var y2={};y2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C",day:"\u0434\u0435\u043D\u044C",dayPeriod:"AM/PM",endDate:"\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",era:"\u044D\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u044F\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: \u0441 ${t.startDate} \u043F\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u043D\u0435\u0434\u0435\u043B\u0438",year:"\u0433\u043E\u0434"};var v2={};v2={calendar:"Kalend\xE1r",day:"de\u0148",dayPeriod:"AM/PM",endDate:"D\xE1tum ukon\u010Denia",era:"letopo\u010Det",hour:"hodina",minute:"min\xFAta",month:"mesiac",second:"sekunda",selectedDateDescription:t=>`Vybrat\xFD d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Vybrat\xFD rozsah: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Vybrat\xFD \u010Das: ${t.time}`,startDate:"D\xE1tum za\u010Datia",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"de\u0148 t\xFD\u017Ed\u0148a",year:"rok"};var $2={};$2={calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:t=>`Izbrani datum: ${t.date}`,selectedRangeDescription:t=>`Izbrano obmo\u010Dje: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izbrani \u010Das: ${t.time}`,startDate:"Datum za\u010Detka",timeZoneName:"\u010Dasovni pas",weekday:"dan v tednu",year:"leto"};var w2={};w2={calendar:"Kalendar",day:"\u0434\u0430\u043D",dayPeriod:"\u043F\u0440\u0435 \u043F\u043E\u0434\u043D\u0435/\u043F\u043E \u043F\u043E\u0434\u043D\u0435",endDate:"Datum zavr\u0161etka",era:"\u0435\u0440\u0430",hour:"\u0441\u0430\u0442",minute:"\u043C\u0438\u043D\u0443\u0442",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434",selectedDateDescription:t=>`Izabrani datum: ${t.date}`,selectedRangeDescription:t=>`Izabrani opseg: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izabrano vreme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"\u0432\u0440\u0435\u043C\u0435\u043D\u0441\u043A\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0430\u043D \u0443 \u043D\u0435\u0434\u0435\u0459\u0438",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var x2={};x2={calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xE5nad",second:"sekund",selectedDateDescription:t=>`Valt datum: ${t.date}`,selectedRangeDescription:t=>`Valt intervall: ${t.startDate} till ${t.endDate}`,selectedTimeDescription:t=>`Vald tid: ${t.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xE5r"};var S2={};S2={calendar:"Takvim",day:"g\xFCn",dayPeriod:"\xD6\xD6/\xD6S",endDate:"Biti\u015F Tarihi",era:"\xE7a\u011F",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:t=>`Se\xE7ilen Tarih: ${t.date}`,selectedRangeDescription:t=>`Se\xE7ilen Aral\u0131k: ${t.startDate} - ${t.endDate}`,selectedTimeDescription:t=>`Se\xE7ilen Zaman: ${t.time}`,startDate:"Ba\u015Flang\u0131\xE7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftan\u0131n g\xFCn\xFC",year:"y\u0131l"};var C2={};C2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D\u044C",dayPeriod:"\u0434\u043F/\u043F\u043F",endDate:"\u0414\u0430\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F",era:"\u0435\u0440\u0430",hour:"\u0433\u043E\u0434\u0438\u043D\u0430",minute:"\u0445\u0432\u0438\u043B\u0438\u043D\u0430",month:"\u043C\u0456\u0441\u044F\u0446\u044C",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u2014 ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0447\u0430\u0441: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0438\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u0442\u0438\u0436\u043D\u044F",year:"\u0440\u0456\u043A"};var k2={};k2={calendar:"\u65E5\u5386",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7ED3\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9009\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9009\u5B9A\u7684\u8303\u56F4\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9009\u5B9A\u7684\u65F6\u95F4\uFF1A${t.time}`,startDate:"\u5F00\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var D2={};D2={calendar:"\u65E5\u66C6",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7D50\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9078\u5B9A\u7684\u7BC4\u570D\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u5B9A\u7684\u6642\u9593\uFF1A${t.time}`,startDate:"\u958B\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var ms={};ms={"ar-AE":KD,"bg-BG":UD,"cs-CZ":GD,"da-DK":_D,"de-DE":HD,"el-GR":JD,"en-US":e2,"es-ES":t2,"et-EE":n2,"fi-FI":r2,"fr-FR":i2,"he-IL":l2,"hr-HR":a2,"hu-HU":o2,"it-IT":s2,"ja-JP":u2,"ko-KR":c2,"lt-LT":d2,"lv-LV":f2,"nb-NO":h2,"nl-NL":p2,"pl-PL":m2,"pt-BR":g2,"pt-PT":O2,"ro-RO":b2,"ru-RU":y2,"sk-SK":v2,"sl-SI":$2,"sr-SP":w2,"sv-SE":x2,"tr-TR":S2,"uk-UA":C2,"zh-CN":k2,"zh-TW":D2};function n0(t,e,n){let{direction:r}=Re(),i=(0,wp.element.useMemo)(()=>xd(e),[e]),l=u(s=>{if(s.currentTarget.contains(s.target)&&(s.altKey&&(s.key==="ArrowDown"||s.key==="ArrowUp")&&"setOpen"in t&&(s.preventDefault(),s.stopPropagation(),t.setOpen(!0)),!n))switch(s.key){case"ArrowLeft":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=P2(e.current,c.getBoundingClientRect().left,-1);d&&d.focus()}}else i.focusPrevious();break;case"ArrowRight":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=P2(e.current,c.getBoundingClientRect().left,1);d&&d.focus()}}else i.focusNext();break}},"onKeyDown"),a=u(()=>{var s;if(!e.current)return;let c=(s=window.event)===null||s===void 0?void 0:s.target,d=ut(e.current,{tabbable:!0});if(c&&(d.currentNode=c,c=d.previousNode()),!c){let f;do f=d.lastChild(),f&&(c=f);while(f)}for(;c?.hasAttribute("data-placeholder");){let f=d.previousNode();if(f&&f.hasAttribute("data-placeholder"))c=f;else break}c&&c.focus()},"focusLast"),{pressProps:o}=Zn({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(s){s.pointerType==="mouse"&&a()},onPress(s){(s.pointerType==="touch"||s.pointerType==="pen")&&a()}});return ne(o,{onKeyDown:l})}u(n0,"$3dfb0f96be0d6a08$export$4a931266a3838b86");function P2(t,e,n){let r=ut(t,{tabbable:!0}),i=r.nextNode(),l=null,a=1/0;for(;i;){let s=i.getBoundingClientRect().left-e,c=Math.abs(s);Math.sign(s)===n&&c{var w;e.confirmPlaceholder(),e.value!==f.current&&e.commitValidation(),(w=t.onBlur)===null||w===void 0||w.call(t,B)},onFocusWithinChange:t.onFocusChange}),p=Yt(hF(ms),"@react-aria/datepicker"),m=e.maxGranularity==="hour"?"selectedTimeDescription":"selectedDateDescription",g=e.maxGranularity==="hour"?"time":"date",O=e.value?p.format(m,{[g]:e.formatValue({month:"long"})}):"",b=Io(O),y=t[gs]==="presentation"?s["aria-describedby"]:[b["aria-describedby"],s["aria-describedby"]].filter(Boolean).join(" ")||void 0,$=t[T2],v=(0,wp.element.useMemo)(()=>$||xd(n),[$,n]),S=n0(e,n,t[gs]==="presentation");E2.set(e,{ariaLabel:t["aria-label"],ariaLabelledBy:[o.id,t["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:y,focusManager:v});let x=(0,wp.element.useRef)(t.autoFocus),C;t[gs]==="presentation"?C={role:"presentation"}:C=ne(s,{role:"group","aria-disabled":t.isDisabled||void 0,"aria-describedby":y}),(0,wp.element.useEffect)(()=>{x.current&&v.focusFirst(),x.current=!1},[v]),Sr(t.inputRef,e.defaultValue,e.setValue),ss({...t,focus(){v.focusFirst()}},e,t.inputRef);let Q={type:"hidden",name:t.name,form:t.form,value:((r=e.value)===null||r===void 0?void 0:r.toString())||"",disabled:t.isDisabled};t.validationBehavior==="native"&&(Q.type="text",Q.hidden=!0,Q.required=t.isRequired,Q.onChange=()=>{});let T=yt(t);return{labelProps:{...o,onClick:()=>{v.focusFirst()}},fieldProps:ne(T,C,S,h,{onKeyDown(B){t.onKeyDown&&t.onKeyDown(B)},onKeyUp(B){t.onKeyUp&&t.onKeyUp(B)},style:{unicodeBidi:"isolate"}}),inputProps:Q,descriptionProps:c,errorMessageProps:d,isInvalid:i,validationErrors:l,validationDetails:a}}u(A2,"$16f0b7bb276bc17e$export$5591b0b878c1a989");function pF(t,e,n){var r;let i=A2(t,e,n);return i.inputProps.value=((r=e.timeValue)===null||r===void 0?void 0:r.toString())||"",i}u(pF,"$16f0b7bb276bc17e$export$4c842f6a241dc825");function mF(t){return t&&t.__esModule?t.default:t}u(mF,"$parcel$interopDefault$3");function gF(t,e,n){let r=Ie(),i=Ie(),l=Ie(),a=Yt(mF(ms),"@react-aria/datepicker"),{isInvalid:o,validationErrors:s,validationDetails:c}=e.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:h,errorMessageProps:p}=$t({...t,labelElementType:"span",isInvalid:o,errorMessage:t.errorMessage||s}),m=n0(e,n),g=f["aria-labelledby"]||f.id,{locale:O}=Re(),b=e.formatValue(O,{month:"long"}),y=b?a.format("selectedDateDescription",{date:b}):"",$=Io(y),v=[$["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,S=yt(t),x=(0,wp.element.useMemo)(()=>xd(n),[n]),C=(0,wp.element.useRef)(!1),{focusWithinProps:Q}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:T=>{let B=document.getElementById(i);if(!B?.contains(T.relatedTarget)){var w,M;C.current=!1,(w=t.onBlur)===null||w===void 0||w.call(t,T),(M=t.onFocusChange)===null||M===void 0||M.call(t,!1)}},onFocusWithin:T=>{if(!C.current){var B,w;C.current=!0,(B=t.onFocus)===null||B===void 0||B.call(t,T),(w=t.onFocusChange)===null||w===void 0||w.call(t,!0)}}});return{groupProps:ne(S,m,f,$,Q,{role:"group","aria-disabled":t.isDisabled||null,"aria-labelledby":g,"aria-describedby":v,onKeyDown(T){e.isOpen||t.onKeyDown&&t.onKeyDown(T)},onKeyUp(T){e.isOpen||t.onKeyUp&&t.onKeyUp(T)}}),labelProps:{...d,onClick:()=>{x.focusFirst()}},fieldProps:{...f,id:l,[gs]:"presentation","aria-describedby":v,value:e.value,defaultValue:e.defaultValue,onChange:e.setValue,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,granularity:t.granularity,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior,[Ar]:e,autoFocus:t.autoFocus,name:t.name,form:t.form},descriptionProps:h,errorMessageProps:p,buttonProps:{...$,id:r,"aria-haspopup":"dialog","aria-label":a.format("calendar"),"aria-labelledby":`${r} ${g}`,"aria-describedby":v,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:i,"aria-labelledby":`${r} ${g}`},calendarProps:{autoFocus:!0,value:e.dateValue,onChange:e.setDateValue,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,defaultFocusedValue:e.dateValue?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:o,validationErrors:s,validationDetails:c}}u(gF,"$6057a3d2a53a12fd$export$42df105a73306d51");function OF(t){return t&&t.__esModule?t.default:t}u(OF,"$parcel$interopDefault$2");function bF(){let{locale:t}=Re(),e=M3(OF(ms),"@react-aria/datepicker");return(0,wp.element.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new r0(t,e)}},[t,e])}u(bF,"$3aeceb3a64eb8358$export$d42c60378c8168f8");const $v=class $v{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,n){this.locale=e,this.dictionary=n}};u($v,"$3aeceb3a64eb8358$var$DisplayNamesPolyfill");let r0=$v;function yF(t,e,n){let r=(0,wp.element.useRef)(""),{locale:i,direction:l}=Re(),a=bF(),{ariaLabel:o,ariaLabelledBy:s,ariaDescribedBy:c,focusManager:d}=E2.get(e),f=t.isPlaceholder?"":t.text,h=(0,wp.element.useMemo)(()=>e.dateFormatter.resolvedOptions(),[e.dateFormatter]),p=Xn({month:"long",timeZone:h.timeZone}),m=Xn({hour:"numeric",hour12:h.hour12,timeZone:h.timeZone});if(t.type==="month"&&!t.isPlaceholder){let k=p.format(e.dateValue);f=k!==f?`${f} \u2013 ${k}`:k}else t.type==="hour"&&!t.isPlaceholder&&(f=m.format(e.dateValue));let{spinButtonProps:g}=Xg({value:t.value,textValue:f,minValue:t.minValue,maxValue:t.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly||!t.isEditable,isRequired:e.isRequired,onIncrement:()=>{r.current="",e.increment(t.type)},onDecrement:()=>{r.current="",e.decrement(t.type)},onIncrementPage:()=>{r.current="",e.incrementPage(t.type)},onDecrementPage:()=>{r.current="",e.decrementPage(t.type)},onIncrementToMax:()=>{r.current="",t.maxValue!==void 0&&e.setSegment(t.type,t.maxValue)},onDecrementToMin:()=>{r.current="",t.minValue!==void 0&&e.setSegment(t.type,t.minValue)}}),O=(0,wp.element.useMemo)(()=>new ts(i,{maximumFractionDigits:0}),[i]),b=u(()=>{if(t.text===t.placeholder&&d.focusPrevious(),O.isValidPartialNumber(t.text)&&!e.isReadOnly&&!t.isPlaceholder){let k=t.text.slice(0,-1),F=O.parse(k);k=F===0?"":k,k.length===0||F===0?e.clearSegment(t.type):e.setSegment(t.type,F),r.current=k}else t.type==="dayPeriod"&&e.clearSegment(t.type)},"backspace"),y=u(k=>{if(k.key==="a"&&(wr()?k.metaKey:k.ctrlKey)&&k.preventDefault(),!(k.ctrlKey||k.metaKey||k.shiftKey||k.altKey))switch(k.key){case"Backspace":case"Delete":k.preventDefault(),k.stopPropagation(),b();break}},"onKeyDown"),{startsWith:$}=Sg({sensitivity:"base"}),v=Xn({hour:"numeric",hour12:!0}),S=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(0),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),x=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(12),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),C=Xn({year:"numeric",era:"narrow",timeZone:"UTC"}),Q=(0,wp.element.useMemo)(()=>{if(t.type!=="era")return[];let k=Ne(new Fe(1,1,1),e.calendar),F=e.calendar.getEras().map(z=>{let G=k.set({year:1,month:1,day:1,era:z}).toDate("UTC"),ie=C.formatToParts(G).find(me=>me.type==="era").value;return{era:z,formatted:ie}}),N=vF(F.map(z=>z.formatted));if(N)for(let z of F)z.formatted=z.formatted.slice(N);return F},[C,e.calendar,t.type]),T=u(k=>{if(e.isDisabled||e.isReadOnly)return;let F=r.current+k;switch(t.type){case"dayPeriod":if($(S,k))e.setSegment("dayPeriod",0);else if($(x,k))e.setSegment("dayPeriod",12);else break;d.focusNext();break;case"era":{let N=Q.find(z=>$(z.formatted,k));N&&(e.setSegment("era",N.era),d.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!O.isValidPartialNumber(F))return;let N=O.parse(F),z=N,G=t.minValue===0;if(t.type==="hour"&&e.dateFormatter.resolvedOptions().hour12){switch(e.dateFormatter.resolvedOptions().hourCycle){case"h11":N>11&&(z=O.parse(k));break;case"h12":G=!1,N>12&&(z=O.parse(k));break}t.value!==void 0&&t.value>=12&&N>1&&(N+=12)}else t.maxValue!==void 0&&N>t.maxValue&&(z=O.parse(k));if(isNaN(N))return;let le=z!==0||G;le&&e.setSegment(t.type,z),t.maxValue!==void 0&&(+(N+"0")>t.maxValue||F.length>=String(t.maxValue).length)?(r.current="",le&&d.focusNext()):r.current=F;break}}},"onInput"),B=u(()=>{r.current="",n.current&&Kc(n.current,{containingElement:Yc(n.current)});let k=window.getSelection();k?.collapse(n.current)},"onFocus"),w=(0,wp.element.useRef)(typeof document<"u"?document:null);un(w,"selectionchange",()=>{var k;let F=window.getSelection();F?.anchorNode&&(!((k=n.current)===null||k===void 0)&&k.contains(F?.anchorNode))&&F.collapse(n.current)});let M=(0,wp.element.useRef)("");un(n,"beforeinput",k=>{if(n.current)switch(k.preventDefault(),k.inputType){case"deleteContentBackward":case"deleteContentForward":O.isValidPartialNumber(t.text)&&!e.isReadOnly&&b();break;case"insertCompositionText":M.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:k.data!=null&&T(k.data);break}}),un(n,"input",k=>{let{inputType:F,data:N}=k;switch(F){case"insertCompositionText":n.current&&(n.current.textContent=M.current),N!=null&&($(S,N)||$(x,N))&&T(N);break}}),Pe(()=>{let k=n.current;return()=>{document.activeElement===k&&(d.focusPrevious()||d.focusNext())}},[n,d]);let A=Xi()||t.type==="timeZoneName"?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{},E=(0,wp.element.useMemo)(()=>e.segments.find(k=>k.isEditable),[e.segments]);t!==E&&!e.isInvalid&&(c=void 0);let I=Ie(),D=!e.isDisabled&&!e.isReadOnly&&t.isEditable,P=t.type==="literal"?"":a.of(t.type),R=zn({"aria-label":`${P}${o?`, ${o}`:""}${s?", ":""}`,"aria-labelledby":s});if(t.type==="literal")return{segmentProps:{"aria-hidden":!0}};let L={caretColor:"transparent"};if(l==="rtl"){L.unicodeBidi="embed";let k=h[t.type];(k==="numeric"||k==="2-digit")&&(L.direction="ltr")}return{segmentProps:ne(g,R,{id:I,...A,"aria-invalid":e.isInvalid?"true":void 0,"aria-describedby":c,"aria-readonly":e.isReadOnly||!t.isEditable?"true":void 0,"data-placeholder":t.isPlaceholder||void 0,contentEditable:D,suppressContentEditableWarning:D,spellCheck:D?"false":void 0,autoCorrect:D?"off":void 0,[parseInt(wp.element.version,10)>=17?"enterKeyHint":"enterkeyhint"]:D?"next":void 0,inputMode:e.isDisabled||t.type==="dayPeriod"||t.type==="era"||!D?void 0:"numeric",tabIndex:e.isDisabled?void 0:0,onKeyDown:y,onFocus:B,style:L,onPointerDown(k){k.stopPropagation()},onMouseDown(k){k.stopPropagation()}})}}u(yF,"$32489daedd52963e$export$1315d136e6f7581");function vF(t){t.sort();let e=t[0],n=t[t.length-1];for(let r=0;rxd(n,{accept:k=>k.id!==C}),[n,C]),M={[T2]:w,[gs]:"presentation","aria-describedby":B,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,granularity:t.granularity,shouldForceLeadingZeros:t.shouldForceLeadingZeros,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior},A=yt(t),E=(0,wp.element.useRef)(!1),{focusWithinProps:I}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:k=>{let F=document.getElementById(Q);if(!F?.contains(k.relatedTarget)){var N,z;E.current=!1,(N=t.onBlur)===null||N===void 0||N.call(t,k),(z=t.onFocusChange)===null||z===void 0||z.call(t,!1)}},onFocusWithin:k=>{if(!E.current){var F,N;E.current=!0,(F=t.onFocus)===null||F===void 0||F.call(t,k),(N=t.onFocusChange)===null||N===void 0||N.call(t,!0)}}}),D=(0,wp.element.useRef)(el),P=(0,wp.element.useRef)(el);var R,L;return{groupProps:ne(A,T,p,v,I,{role:"group","aria-disabled":t.isDisabled||null,"aria-describedby":B,onKeyDown(k){e.isOpen||t.onKeyDown&&t.onKeyDown(k)},onKeyUp(k){e.isOpen||t.onKeyUp&&t.onKeyUp(k)}}),labelProps:{...h,onClick:()=>{w.focusFirst()}},buttonProps:{...v,id:C,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${C} ${O}`,"aria-describedby":B,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:Q,"aria-labelledby":`${C} ${O}`},startFieldProps:{...S,...M,value:(R=(r=e.value)===null||r===void 0?void 0:r.start)!==null&&R!==void 0?R:null,defaultValue:(i=e.defaultValue)===null||i===void 0?void 0:i.start,onChange:k=>e.setDateTime("start",k),autoFocus:t.autoFocus,name:t.startName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){D.current=k,e.updateValidation(Cd(k,P.current))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},endFieldProps:{...x,...M,value:(L=(l=e.value)===null||l===void 0?void 0:l.end)!==null&&L!==void 0?L:null,defaultValue:(a=e.defaultValue)===null||a===void 0?void 0:a.end,onChange:k=>e.setDateTime("end",k),name:t.endName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){P.current=k,e.updateValidation(Cd(D.current,k))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},descriptionProps:m,errorMessageProps:g,calendarProps:{autoFocus:!0,value:!((o=e.dateRange)===null||o===void 0)&&o.start&&e.dateRange.end?e.dateRange:null,onChange:e.setDateRange,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,allowsNonContiguousRanges:t.allowsNonContiguousRanges,defaultFocusedValue:e.dateRange?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:c,validationErrors:d,validationDetails:f}}u(Q2,"$887cac91b7cc8801$export$12fd5f0e9f4bb192");function wF(t,e){let{role:n="dialog"}=t,r=sa();r=t["aria-label"]?void 0:r;let i=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{if(e.current&&!e.current.contains(document.activeElement)){Ki(e.current);let l=setTimeout(()=>{(document.activeElement===e.current||document.activeElement===document.body)&&(i.current=!0,e.current&&(e.current.blur(),Ki(e.current)),i.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),_k(),{dialogProps:{...yt(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{i.current&&l.stopPropagation()}},titleProps:{id:r}}}u(wF,"$40df3f8667284809$export$d55e7ee900f34e93");var i0=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};function M2(){throw new Error("setTimeout has not been defined")}u(M2,"defaultSetTimout");function B2(){throw new Error("clearTimeout has not been defined")}u(B2,"defaultClearTimeout");var ui=M2,ci=B2;typeof i0.setTimeout=="function"&&(ui=setTimeout),typeof i0.clearTimeout=="function"&&(ci=clearTimeout);function R2(t){if(ui===setTimeout)return setTimeout(t,0);if((ui===M2||!ui)&&setTimeout)return ui=setTimeout,setTimeout(t,0);try{return ui(t,0)}catch{try{return ui.call(null,t,0)}catch{return ui.call(this,t,0)}}}u(R2,"runTimeout");function xF(t){if(ci===clearTimeout)return clearTimeout(t);if((ci===B2||!ci)&&clearTimeout)return ci=clearTimeout,clearTimeout(t);try{return ci(t)}catch{try{return ci.call(null,t)}catch{return ci.call(this,t)}}}u(xF,"runClearTimeout");var Mr=[],Da=!1,tl,Vd=-1;function SF(){!Da||!tl||(Da=!1,tl.length?Mr=tl.concat(Mr):Vd=-1,Mr.length&&V2())}u(SF,"cleanUpNextTick");function V2(){if(!Da){var t=R2(SF);Da=!0;for(var e=Mr.length;e;){for(tl=Mr,Mr=[];++Vd1)for(var n=1;n{I.stopPropagation(),e.setSelectedValue(r)},"onChange"),{pressProps:y,isPressed:$}=Zn({onPressStart:o,onPressEnd:s,onPressChange:c,onPress:d,onPressUp:f,onClick:h,isDisabled:p}),{pressProps:v,isPressed:S}=Zn({onPressStart:o,onPressEnd:s,onPressChange:c,onPressUp:f,onClick:h,isDisabled:p,onPress(I){var D;d?.(I),e.setSelectedValue(r),(D=n.current)===null||D===void 0||D.focus()}}),{focusableProps:x}=jo(ne(t,{onFocus:()=>e.setLastFocusedValue(r)}),n),C=ne(y,x),Q=yt(t,{labelable:!0}),T=-1;e.selectedValue!=null?e.selectedValue===r&&(T=0):(e.lastFocusedValue===r||e.lastFocusedValue==null)&&(T=0),p&&(T=void 0);let{name:B,form:w,descriptionId:M,errorMessageId:A,validationBehavior:E}=F2.get(e);return Sr(n,e.defaultSelectedValue,e.setSelectedValue),ss({validationBehavior:E},e,n),{labelProps:ne(v,(0,wp.element.useMemo)(()=>({onClick:I=>I.preventDefault(),onMouseDown:I=>I.preventDefault()}),[])),inputProps:ne(Q,{...C,type:"radio",name:B,form:w,tabIndex:T,disabled:p,required:e.isRequired&&E==="native",checked:O,value:r,onChange:b,"aria-describedby":[t["aria-describedby"],e.isInvalid?A:null,M].filter(Boolean).join(" ")||void 0}),isDisabled:p,isSelected:O,isPressed:$||S}}u(I2,"$0d5c49892c1215da$export$37b0961d2f4751e2");function L2(t,e){let{name:n,form:r,isReadOnly:i,isRequired:l,isDisabled:a,orientation:o="vertical",validationBehavior:s="aria"}=t,{direction:c}=Re(),{isInvalid:d,validationErrors:f,validationDetails:h}=e.displayValidation,{labelProps:p,fieldProps:m,descriptionProps:g,errorMessageProps:O}=$t({...t,labelElementType:"span",isInvalid:e.isInvalid,errorMessage:t.errorMessage||f}),b=yt(t,{labelable:!0}),{focusWithinProps:y}=Wt({onBlurWithin(S){var x;(x=t.onBlur)===null||x===void 0||x.call(t,S),e.selectedValue||e.setLastFocusedValue(null)},onFocusWithin:t.onFocus,onFocusWithinChange:t.onFocusChange}),$=u(S=>{let x;switch(S.key){case"ArrowRight":c==="rtl"&&o!=="vertical"?x="prev":x="next";break;case"ArrowLeft":c==="rtl"&&o!=="vertical"?x="next":x="prev";break;case"ArrowDown":x="next";break;case"ArrowUp":x="prev";break;default:return}S.preventDefault();let C=ut(S.currentTarget,{from:S.target,accept:T=>T instanceof bt(T).HTMLInputElement&&T.type==="radio"}),Q;x==="next"?(Q=C.nextNode(),Q||(C.currentNode=S.currentTarget,Q=C.firstChild())):(Q=C.previousNode(),Q||(C.currentNode=S.currentTarget,Q=C.lastChild())),Q&&(Q.focus(),e.setSelectedValue(Q.value))},"onKeyDown"),v=Ie(n);return F2.set(e,{name:v,form:r,descriptionId:g.id,errorMessageId:O.id,validationBehavior:s}),{radioGroupProps:ne(b,{role:"radiogroup",onKeyDown:$,"aria-invalid":e.isInvalid||void 0,"aria-errormessage":t["aria-errormessage"],"aria-readonly":i||void 0,"aria-required":l||void 0,"aria-disabled":a||void 0,"aria-orientation":o,...m,...y}),labelProps:p,descriptionProps:g,errorMessageProps:O,isInvalid:d,validationErrors:f,validationDetails:h}}u(L2,"$430f30ed08ec25fa$export$62b9571f283ff5c2");const a0=new WeakMap;function GF(t,e,n){let{keyboardDelegate:r,isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s="aria"}=t,c=xg({usage:"search",sensitivity:"base"}),d=(0,wp.element.useMemo)(()=>r||new ps(e.collection,e.disabledKeys,n,c),[r,e.collection,e.disabledKeys,c,n]),{menuTriggerProps:f,menuProps:h}=WD({isDisabled:i,type:"listbox"},e,n),p=u(T=>{if(e.selectionManager.selectionMode!=="multiple")switch(T.key){case"ArrowLeft":{var B,w;T.preventDefault();let E=e.selectedKey!=null?(B=d.getKeyAbove)===null||B===void 0?void 0:B.call(d,e.selectedKey):(w=d.getFirstKey)===null||w===void 0?void 0:w.call(d);E&&e.setSelectedKey(E);break}case"ArrowRight":{var M,A;T.preventDefault();let E=e.selectedKey!=null?(M=d.getKeyBelow)===null||M===void 0?void 0:M.call(d,e.selectedKey):(A=d.getFirstKey)===null||A===void 0?void 0:A.call(d);E&&e.setSelectedKey(E);break}}},"onKeyDown"),{typeSelectProps:m}=eD({keyboardDelegate:d,selectionManager:e.selectionManager,onTypeSelect(T){e.setSelectedKey(T)}}),{isInvalid:g,validationErrors:O,validationDetails:b}=e.displayValidation,{labelProps:y,fieldProps:$,descriptionProps:v,errorMessageProps:S}=$t({...t,labelElementType:"span",isInvalid:g,errorMessage:t.errorMessage||O});m.onKeyDown=m.onKeyDownCapture,delete m.onKeyDownCapture,e.selectionManager.selectionMode==="multiple"&&(m={});let x=yt(t,{labelable:!0}),C=ne(m,f,$),Q=Ie();return a0.set(e,{isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s}),{labelProps:{...y,onClick:()=>{if(!t.isDisabled){var T;(T=n.current)===null||T===void 0||T.focus(),Mm("keyboard")}}},triggerProps:ne(x,{...C,isDisabled:i,onKeyDown:vr(C.onKeyDown,p,t.onKeyDown),onKeyUp:t.onKeyUp,"aria-labelledby":[Q,C["aria-labelledby"],C["aria-label"]&&!C["aria-labelledby"]?C.id:null].filter(Boolean).join(" "),onFocus(T){e.isFocused||(t.onFocus&&t.onFocus(T),t.onFocusChange&&t.onFocusChange(!0),e.setFocused(!0))},onBlur(T){e.isOpen||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:Q},menuProps:{...h,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[$["aria-labelledby"],C["aria-label"]&&!$["aria-labelledby"]?C.id:null].filter(Boolean).join(" ")},descriptionProps:v,errorMessageProps:S,isInvalid:g,validationErrors:O,validationDetails:b,hiddenSelectProps:{isDisabled:i,name:a,label:t.label,state:e,triggerRef:n,form:o}}}u(GF,"$58aed456727eb0f3$export$e64b2f635402ca43");function _F(t,e,n){let r=a0.get(e)||{},{autoComplete:i,name:l=r.name,form:a=r.form,isDisabled:o=r.isDisabled}=t,{validationBehavior:s,isRequired:c}=r,{visuallyHiddenProps:d}=Pd({style:{position:"fixed",top:0,left:0}});Sr(t.selectRef,e.defaultValue,e.setValue),ss({validationBehavior:s,focus:()=>{var m;return(m=n.current)===null||m===void 0?void 0:m.focus()}},e,t.selectRef);let f=e.setValue,h=(0,wp.element.useCallback)(m=>{m.target.multiple?f(Array.from(m.target.selectedOptions,g=>g.value)):f(m.currentTarget.value)},[f]);var p;return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:i,disabled:o,multiple:e.selectionManager.selectionMode==="multiple",required:s==="native"&&c,name:l,form:a,value:(p=e.value)!==null&&p!==void 0?p:"",onChange:h,onInput:h}}}u(_F,"$bdd25dc72710631f$export$f809e80f58e251d1");function HF(t){let{state:e,triggerRef:n,label:r,name:i,form:l,isDisabled:a}=t,o=(0,wp.element.useRef)(null),s=(0,wp.element.useRef)(null),{containerProps:c,selectProps:d}=_F({...t,selectRef:e.collection.size<=300?o:s},e,n);if(e.collection.size<=300)return wp.element.createElement("div",{...c,"data-testid":"hidden-select-container"},wp.element.createElement("label",null,r,wp.element.createElement("select",{...d,ref:o},wp.element.createElement("option",null),[...e.collection.getKeys()].map(f=>{let h=e.collection.getItem(f);if(h&&h.type==="item")return wp.element.createElement("option",{key:h.key,value:h.key},h.textValue)}))));if(i){let f=a0.get(e)||{},{validationBehavior:h}=f,p=Array.isArray(e.value)?e.value:[e.value];p.length===0&&(p=[null]);let m=p.map((g,O)=>{let b={type:"hidden",autoComplete:d.autoComplete,name:i,form:l,disabled:a,value:g??""};return h==="native"?wp.element.createElement("input",{key:O,...b,ref:O===0?s:null,style:{display:"none"},type:"text",required:O===0?d.required:!1,onChange:()=>{}}):wp.element.createElement("input",{key:O,...b,ref:O===0?s:null})});return wp.element.createElement(wp.element.Fragment,null,m)}return null}u(HF,"$bdd25dc72710631f$export$cbd84cdb2e668835");function JF(t){let e=yt(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}u(JF,"$f4b273590fab9f93$export$52210f68a14655d0");function eI(t,e,n){let{labelProps:r,inputProps:i,isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}=Sx(t,e,n);return{labelProps:r,inputProps:{...i,role:"switch",checked:l},isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}}u(eI,"$b418ec0c85c52f27$export$d853f7095ae95f88");var tI=Object.defineProperty,z2=u((t,e)=>tI(t,"name",{value:e,configurable:!0}),"l$l");const nI=z2((t,e=!1)=>{if(e===!1)return`[[${t}]]`;let n="";for(const r in e){const i=e[r];n+=`::${r}=${typeof i=="object"?JSON.stringify(i):i}`}return`[[${t}${n}]]`},"dynamicValueToString"),Z2=z2(t=>{if(typeof t!="string")return!1;const e=t.replace("[[","").replace("]]","").split("::");return e.length===0?!1:e.reduce((n,r,i)=>{if(i===0)return n;const l=r.split("=");return{...n,fields:{...n.fields,[l[0]]:l[1]}}},{type:e[0],settings:{}})},"stringToDynamicValue");var rI=Object.defineProperty,o0=u((t,e)=>rI(t,"name",{value:e,configurable:!0}),"r$e");const iI=["color-picker","conditional-panel","date-picker","number","text"],X2=/\[\[((?:(?!\]\]).)+\]?)\]\]/g,j2=o0(t=>typeof t=="string"?Array.from(t.matchAll(X2),e=>e[1]):[],"getDynamicStrings"),s0={"color-picker":{mode:{default:"replace",supported:["replace"]},types:["color"]},"conditional-panel":{mode:{default:"replace",supported:["replace","insert"],types:["text","date","color","number"]},types:["color"]},"date-picker":{mode:{default:"replace",supported:["replace"]},types:["date"]},number:{mode:{default:"replace",supported:["replace"]},types:["number"]},text:{mode:{default:"insert",supported:["insert","replace"]},types:["text","date","color","number"]}},lI=o0((t,e)=>s0[t].mode.supported.includes(e)?e:s0[t].mode.default,"getMode"),aI=o0((t,e,{dynamic:n,type:r})=>{const i=yr().dynamics;return iI.includes(r)?{getTypes:()=>n.types??s0[r].types,getMode:()=>lI(r,n.mode??!1),getCategories:()=>n.categories??Object.keys(i.categories),getList:()=>i.values,getAll:()=>j2(t).map(Z2),getLabel:l=>i.values[l]?i.values[l].label:l,stringify:nI,parse:Z2,hasValues:()=>j2(t).length!==0,setValue:l=>e(l)}:!1},"dynamicValuesAPI");var oI=Object.defineProperty,di=u((t,e)=>oI(t,"name",{value:e,configurable:!0}),"e$5");const fi=di(()=>(Date.now()*1e3+Math.random()*1e3).toString(16).replace(/\./g,"").padEnd(14,"0"),"uniqid"),On=di((t,e=!1)=>{if(Array.isArray(t)||typeof t=="object")return t;if(t===""&&e)return e;try{return JSON.parse(t)}catch{return{}}},"initJSON"),q2=di(t=>t instanceof Set?t:Array.isArray(t)?new Set(t):t.startsWith("[")&&t.endsWith("]")?On(t,new Set):new Set(t.split(",")),"initSet"),rl=di(t=>Object.keys(t).map(e=>t[e].choices?{...t[e],key:t[e].name,label:t[e].name,choices:Object.keys(t[e].choices).map(n=>({value:n,label:t[e].choices[n]}))}:{value:e,label:t[e]}),"getOptions"),W2=di((t,e)=>e.filter(n=>n.value===t)[0]??!1,"getOption"),sI=di((t,e)=>JSON.stringify(t)===JSON.stringify(e),"areSameObjects"),u0=di(t=>JSON.parse(JSON.stringify(t)),"deepCopy"),uI=di(()=>({dispatcher:Y2,init:K2}),"getRepeaterHelpers");var cI=Object.freeze({__proto__:null,areSameObjects:sI,deepCopy:u0,getOption:W2,getOptions:rl,getRepeaterHelpers:uI,initJSON:On,initSet:q2,uniqid:fi}),dI=Object.defineProperty,c0=u((t,e)=>dI(t,"name",{value:e,configurable:!0}),"a$i");const Y2=c0((t,e,n)=>(r,i)=>{switch(i.callback&&setTimeout(i.callback),i.type){case"add":return r.length>=e?r:[...r,{key:fi(),...i.data??t}];case"insert":return r.length>=e?r:[...r.slice(0,i.position),{key:fi(),...i.data??t},...r.slice(i.position)];case"remove":return[...r.slice(0,i.item),...r.slice(i.item+1)];case"update":return r[i.item][i.control]=i.value,[...r];case"clone":return r.length>=e?r:[...r,{...d0(i.item,n),key:fi()}];case"clear":return[];case"bulkCheck":return r.map(l=>({...l,_bulkCheckbox:!0}));case"bulkUncheck":return r.map(l=>({...l,_bulkCheckbox:!1}));case"bulkUpdate":return r.map(l=>l._bulkCheckbox===!0?{...l,[i.control]:i.value}:l);case"bulkRemove":return r.filter(l=>l._bulkCheckbox!==!0);default:return r}},"repeaterDispatcher"),d0=c0((t,e)=>{if(typeof e?.clone?.exclude!="object")return t;const n={...t};return Object.keys(e.clone.exclude).map(r=>{const i=e.clone.exclude[r];i===!0&&delete n[r],typeof i=="object"&&(n[r]=Array.isArray(n[r])?n[r].map(l=>d0(l,{clone:{exclude:i}})):d0(n[r],{clone:{exclude:i}}))}),n},"formatClone"),K2=c0((t,e)=>{try{const n=Array.isArray(t)?t:JSON.parse(t);return Array.isArray(n)?n:[e]}catch{return[{key:fi(),...e}]}},"initDispatcher"),se=wp.element.forwardRef(({children:t,...e},n)=>{const r=wp.element.useRef(),i=n??r,l=e.content??t,a=e.buttonType??"button",o=e.layout?e.layout?`tf-button-${e.layout}`:"":e.type?`tf-button-${e.type}`:"",{buttonProps:s}=kV(e,n),c=e.context?`tf-button-is-${e.context}`:"",d=`tf-button ${o} ${c} ${e.className??""}`,f=e.changeTag&&e.changeTag=="span"?"span":"button";return wp.element.createElement(f,{className:d,style:e.style,...s,onClick:h=>{s.onClick(h),aa("buttonPressed",{name:e.name??!1,props:e,event:h})},ref:i,type:a},e.contentVisuallyHidden?wp.element.createElement(gn,null,l):l)});var fI=Object.defineProperty,hI=u((t,e)=>fI(t,"name",{value:e,configurable:!0}),"i$p");const we=hI(({descriptionProps:t,parent:e,children:n,...r})=>{const i=e?.descriptionVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("div",{className:"tf-description",...t},l))},"Description");var pI=Object.defineProperty,mI=u((t,e)=>pI(t,"name",{value:e,configurable:!0}),"t$d");const Os=mI(({title:t,children:e,...n})=>{const r=wp.element.useRef(),{dialogProps:i}=wF(n,r);return wp.element.createElement("div",{className:"tf-dialog",...i,ref:r},t&&wp.element.createElement(Zd,{level:4},t),wp.element.createElement("div",{className:"tf-dialog-content"},e))},"Dialog");var gI=Object.defineProperty,U2=u((t,e)=>gI(t,"name",{value:e,configurable:!0}),"l$j");const G2=U2(t=>{const[e,n]=wp.element.useState(!0);wp.element.useEffect(()=>{t.isOpen!==e&&n(t.isOpen)},[t.isOpen]);const r=U2(()=>{n(!e),t.onChange&&t.onChange(!e)},"toggle");let i="tf-panel";return i+=` tf-panel-${e?"open":"closed"}`,i+=t.className?` ${t.className}`:"",i+=t.class?` ${t.class}`:"",i+=t.footer?"":" tf-panel-no-footer",wp.element.createElement("div",{className:i,"data-status":e?"open":"closed"},wp.element.createElement(se,{className:"tf-panel-header",type:"action",onClick:r},wp.element.createElement("div",{className:"tf-panel-header-left"},t.headerLeft?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerLeft):null,t.title?wp.element.createElement("div",{className:"tf-panel-header-title"},wp.element.isValidElement(t.title)?t.title:wp.element.createElement("strong",null,t.title)):null),wp.element.createElement("div",{className:"tf-panel-header-right"},t.headerRight?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerRight):null,wp.element.createElement("span",{className:"tf-panel-arrow"}))),e||t?.behavior==="hide"?wp.element.createElement("div",{className:"tf-panel-content"},t.children):null,t.footer?wp.element.createElement("div",{className:"tf-panel-footer"},t.footer):null)},"ExpandablePanel");var OI=Object.defineProperty,bI=u((t,e)=>OI(t,"name",{value:e,configurable:!0}),"t$c");const xe=bI(({labelProps:t,parent:e,children:n,...r})=>{const i=e?.labelVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("label",{className:"tf-label",...t,htmlFor:e?.name??""},l))},"Label");var yI=Object.defineProperty,vI=u((t,e)=>yI(t,"name",{value:e,configurable:!0}),"i$o");const f0=vI(({item:t,state:e})=>{const n=wp.element.useRef(),{optionProps:r,isSelected:i,isFocused:l,isDisabled:a}=uF({key:t.key},e,n),{focusProps:o}=is();let s="tf-list-box-option";return i&&(s=s+=" tf-list-box-option-selected"),a&&(s=s+=" tf-list-box-option-disabled"),l&&(s=s+=" tf-list-box-option-focus"),wp.element.createElement("li",{...ne(r,o),ref:n,className:s},t.rendered)},"Option");var $I=Object.defineProperty,wI=u((t,e)=>$I(t,"name",{value:e,configurable:!0}),"a$f");const xI=wI(({section:t,state:e})=>{const{itemProps:n,headingProps:r,groupProps:i}=cF({heading:t.rendered,"aria-label":t["aria-label"]}),{separatorProps:l}=JF({elementType:"li"}),a=t.key===e.collection.getFirstKey();return wp.element.createElement(wp.element.Fragment,null,!a&&wp.element.createElement("li",{className:"tf-list-box-section-separator",...l}),wp.element.createElement("li",{className:"tf-list-box-section",...n},t.rendered&&wp.element.createElement("span",{...r},t.rendered),wp.element.createElement("ul",{...i},[...t.childNodes].map(o=>wp.element.createElement(f0,{key:o.key??o.name,item:o,state:e})))))},"Section");var SI=Object.defineProperty,CI=u((t,e)=>SI(t,"name",{value:e,configurable:!0}),"l$i");const Nd=CI(t=>{const e=wp.element.useRef(),{listBoxRef:n=e,state:r}=t,{listBoxProps:i}=iD(t,r,n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("ul",{...i,ref:n,className:"tf-list-box"},["loading","filtering"].includes(t?.loadingState)?wp.element.createElement(f0,{key:"_loading",state:r,item:{rendered:"Loading...",isDisabled:!0},shouldUseVirtualFocus:!0}):[...r.collection].map(l=>l.type==="section"?wp.element.createElement(xI,{key:l.key??l.level,section:l,state:r,shouldUseVirtualFocus:!0}):wp.element.createElement(f0,{key:l.key??l.name,item:l,state:r,shouldUseVirtualFocus:!0}))),wp.element.createElement(fs,{onDismiss:r.close}))},"ListBox");var kI=Object.defineProperty,DI=u((t,e)=>kI(t,"name",{value:e,configurable:!0}),"a$d");const PI=DI(({state:t,children:e,...n})=>{const r=wp.element.useContext(Oo),i=wp.element.useRef(null),{modalProps:l,underlayProps:a}=UN(n,t,i);return wp.element.createElement(Gk,{portalContainer:r.portalContainer},wp.element.createElement("div",{className:r.wrapper},wp.element.createElement("div",{className:"tf-modal",...a,style:{zIndex:1e6}},wp.element.createElement("div",{className:"tf-modal-container",ref:i,...l},e))))},"Modal");function Ea(t,e,n){return e!=null&&t.compare(e)<0||n!=null&&t.compare(n)>0}u(Ea,"$f62d864046160412$export$eac50920cf2fd59a");function h0(t,e,n,r,i){let l={};for(let o in e)l[o]=Math.floor(e[o]/2),l[o]>0&&e[o]%2===0&&l[o]--;let a=il(t,e,n).subtract(l);return bs(t,a,e,n,r,i)}u(h0,"$f62d864046160412$export$f4a51ff076cc9a09");function il(t,e,n,r,i){let l=t;return e.years?l=IR(t):e.months?l=Gi(t):e.weeks&&(l=Ko(t,n)),bs(t,l,e,n,r,i)}u(il,"$f62d864046160412$export$144a00ba6044eb9");function p0(t,e,n,r,i){let l={...e};l.days?l.days--:l.weeks?l.weeks--:l.months?l.months--:l.years&&l.years--;let a=il(t,e,n).subtract(l);return bs(t,a,e,n,r,i)}u(p0,"$f62d864046160412$export$530edbfc915b2b04");function bs(t,e,n,r,i,l){if(i&&t.compare(i)>=0){let a=Zm(e,il(vt(i),n,r));a&&(e=a)}if(l&&t.compare(l)<=0){let a=zm(e,p0(vt(l),n,r));a&&(e=a)}return e}u(bs,"$f62d864046160412$export$5bb865b12696a77d");function hi(t,e,n){if(e){let r=Zm(t,vt(e));r&&(t=r)}if(n){let r=zm(t,vt(n));r&&(t=r)}return t}u(hi,"$f62d864046160412$export$4f5203c0d889109e");function _2(t,e,n){if(!n)return t;for(;t.compare(e)>=0&&n(t);)t=t.subtract({days:1});return t.compare(e)>=0?t:null}u(_2,"$f62d864046160412$export$a1d3911297b952d7");function H2(t){let e=(0,wp.element.useMemo)(()=>new Rt(t.locale),[t.locale]),n=(0,wp.element.useMemo)(()=>e.resolvedOptions(),[e]),{locale:r,createCalendar:i,visibleDuration:l={months:1},minValue:a,maxValue:o,selectionAlignment:s,isDateUnavailable:c,pageBehavior:d="visible",firstDayOfWeek:f}=t,h=(0,wp.element.useMemo)(()=>i(n.calendar),[i,n.calendar]);var p;let[m,g]=je(t.value,(p=t.defaultValue)!==null&&p!==void 0?p:null,t.onChange),O=(0,wp.element.useMemo)(()=>m?Ne(vt(m),h):null,[m,h]),b=(0,wp.element.useMemo)(()=>m&&"timeZone"in m?m.timeZone:n.timeZone,[m,n.timeZone]),y=(0,wp.element.useMemo)(()=>t.focusedValue?hi(Ne(vt(t.focusedValue),h),a,o):void 0,[t.focusedValue,h,a,o]),$=(0,wp.element.useMemo)(()=>hi(t.defaultFocusedValue?Ne(vt(t.defaultFocusedValue),h):O||Ne(Cr(b),h),a,o),[t.defaultFocusedValue,O,b,h,a,o]),[v,S]=je(y,$,t.onFocusChange),[x,C]=(0,wp.element.useState)(()=>{switch(s){case"start":return il(v,l,r,a,o);case"end":return p0(v,l,r,a,o);case"center":default:return h0(v,l,r,a,o)}}),[Q,T]=(0,wp.element.useState)(t.autoFocus||!1),B=(0,wp.element.useMemo)(()=>{let F={...l};return F.days?F.days--:F.days=-1,x.add(F)},[x,l]),[w,M]=(0,wp.element.useState)(h);if(!sd(h,w)){let F=Ne(v,h);C(h0(F,l,r,a,o)),S(F),M(h)}Ea(v,a,o)?S(hi(v,a,o)):v.compare(x)<0?C(p0(v,l,r,a,o)):v.compare(B)>0&&C(il(v,l,r,a,o));function A(F){F=hi(F,a,o),S(F)}u(A,"focusCell");function E(F){if(!t.isDisabled&&!t.isReadOnly){let N=F;if(N===null){g(null);return}if(N=hi(N,a,o),N=_2(N,x,c),!N)return;N=Ne(N,m?.calendar||new tt),m&&"hour"in m?g(m.set(N)):g(N)}}u(E,"setValue");let I=(0,wp.element.useMemo)(()=>O?c&&c(O)?!0:Ea(O,a,o):!1,[O,c,a,o]),D=t.isInvalid||t.validationState==="invalid"||I,P=D?"invalid":null,R=(0,wp.element.useMemo)(()=>d==="visible"?l:m0(l),[d,l]);var L,k;return{isDisabled:(L=t.isDisabled)!==null&&L!==void 0?L:!1,isReadOnly:(k=t.isReadOnly)!==null&&k!==void 0?k:!1,value:O,setValue:E,visibleRange:{start:x,end:B},minValue:a,maxValue:o,focusedDate:v,timeZone:b,validationState:P,isValueInvalid:D,setFocusedDate(F){A(F),T(!0)},focusNextDay(){A(v.add({days:1}))},focusPreviousDay(){A(v.subtract({days:1}))},focusNextRow(){l.days?this.focusNextPage():(l.weeks||l.months||l.years)&&A(v.add({weeks:1}))},focusPreviousRow(){l.days?this.focusPreviousPage():(l.weeks||l.months||l.years)&&A(v.subtract({weeks:1}))},focusNextPage(){let F=x.add(R);S(hi(v.add(R),a,o)),C(il(bs(v,F,R,r,a,o),R,r))},focusPreviousPage(){let F=x.subtract(R);S(hi(v.subtract(R),a,o)),C(il(bs(v,F,R,r,a,o),R,r))},focusSectionStart(){l.days?A(x):l.weeks?A(Ko(v,r)):(l.months||l.years)&&A(Gi(v))},focusSectionEnd(){l.days?A(B):l.weeks?A(ZR(v,r)):(l.months||l.years)&&A(ma(v))},focusNextSection(F){if(!F&&!l.days){A(v.add(m0(l)));return}l.days?this.focusNextPage():l.weeks?A(v.add({months:1})):(l.months||l.years)&&A(v.add({years:1}))},focusPreviousSection(F){if(!F&&!l.days){A(v.subtract(m0(l)));return}l.days?this.focusPreviousPage():l.weeks?A(v.subtract({months:1})):(l.months||l.years)&&A(v.subtract({years:1}))},selectFocusedDate(){c&&c(v)||E(v)},selectDate(F){E(F)},isFocused:Q,setFocused:T,isInvalid(F){return Ea(F,a,o)},isSelected(F){return O!=null&&Ue(F,O)&&!this.isCellDisabled(F)&&!this.isCellUnavailable(F)},isCellFocused(F){return Q&&v&&Ue(F,v)},isCellDisabled(F){return t.isDisabled||F.compare(x)<0||F.compare(B)>0||this.isInvalid(F)},isCellUnavailable(F){return t.isDateUnavailable?t.isDateUnavailable(F):!1},isPreviousVisibleRangeInvalid(){let F=x.subtract({days:1});return Ue(F,x)||this.isInvalid(F)},isNextVisibleRangeInvalid(){let F=B.add({days:1});return Ue(F,B)||this.isInvalid(F)},getDatesInWeek(F,N=x){let z=N.add({weeks:F}),G=[];z=Ko(z,r,f);let le=Fm(z,r,f);for(let ie=0;ie0&&(m="start")}let g=(0,wp.element.useRef)(null),[O,b]=(0,wp.element.useState)(null),y=(0,wp.element.useMemo)(()=>Zm(o,O?.start),[o,O]),$=(0,wp.element.useMemo)(()=>zm(s,O?.end),[s,O]),v=H2({...c,value:d&&d.start,createCalendar:i,locale:l,visibleDuration:a,minValue:y,maxValue:$,selectionAlignment:t.selectionAlignment||m}),S=u(P=>{if(P&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const R=eP(P,v,-1),L=eP(P,v,1);g.current={start:R,end:L},b(g.current)}else g.current=null,b(null)},"updateAvailableRange"),[x,C]=(0,wp.element.useState)(v.visibleRange);(!Nm(v.visibleRange.start,x.start)||!Nm(v.visibleRange.end,x.end))&&(S(h),C(v.visibleRange));let Q=u(P=>{P?(p(P),S(P)):(p(null),S(null))},"setAnchorDate"),T=h?g0(h,v.focusedDate):d&&g0(d.start,d.end),B=u(P=>{if(t.isReadOnly)return;const R=hi(P,y,$),L=_2(R,v.visibleRange.start,t.isDateUnavailable);if(L)if(!h)Q(L);else{let k=g0(h,L);k&&f({start:J2(k.start,d?.start),end:J2(k.end,d?.end)}),Q(null)}},"selectDate"),[w,M]=(0,wp.element.useState)(!1),{isDateUnavailable:A}=t,E=(0,wp.element.useMemo)(()=>!d||h?!1:A&&(A(d.start)||A(d.end))?!0:Ea(d.start,o,s)||Ea(d.end,o,s),[A,d,h,o,s]),I=t.isInvalid||t.validationState==="invalid"||E;return{...v,value:d,setValue:f,anchorDate:h,setAnchorDate:Q,highlightedRange:T,validationState:I?"invalid":null,isValueInvalid:I,selectFocusedDate(){B(v.focusedDate)},selectDate:B,highlightDate(P){h&&v.setFocusedDate(P)},isSelected(P){return!!(T&&P.compare(T.start)>=0&&P.compare(T.end)<=0&&!v.isCellDisabled(P)&&!v.isCellUnavailable(P))},isInvalid(P){var R,L;return v.isInvalid(P)||Ea(P,(R=g.current)===null||R===void 0?void 0:R.start,(L=g.current)===null||L===void 0?void 0:L.end)},isDragging:w,setDragging:M}}u(EI,"$9a36b6ba2fb1a7c5$export$9a987164d97ecc90");function g0(t,e){return!t||!e?null:(e.compare(t)<0&&([t,e]=[e,t]),{start:vt(t),end:vt(e)})}u(g0,"$9a36b6ba2fb1a7c5$var$makeRange");function J2(t,e){return t=Ne(t,e?.calendar||new tt),e&&"hour"in e?e.set(t):t}u(J2,"$9a36b6ba2fb1a7c5$var$convertValue");function eP(t,e,n){let r=t.add({days:n});for(;(n<0?r.compare(e.visibleRange.start)>=0:r.compare(e.visibleRange.end)<=0)&&!e.isCellUnavailable(r);)r=r.add({days:n});if(e.isCellUnavailable(r))return r.add({days:-n})}u(eP,"$9a36b6ba2fb1a7c5$var$nextUnavailableDate");const wv=class wv{*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(e){let n=this.keyMap.get(e);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return n?.childNodes||[]}constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=u(o=>{if(this.keyMap.set(o.key,o),o.childNodes&&o.type==="section")for(let s of o.childNodes)n(s)},"visit");for(let o of e)n(o);let r=null,i=0,l=0;for(let[o,s]of this.keyMap)r?(r.nextKey=o,s.prevKey=r.key):(this.firstKey=o,s.prevKey=void 0),s.type==="item"&&(s.index=i++),(s.type==="section"||s.type==="item")&&l++,r=s,r.nextKey=void 0;this._size=l;var a;this.lastKey=(a=r?.key)!==null&&a!==void 0?a:null}};u(wv,"$a02d57049d202695$export$d085fb9e920b5ca7");let ys=wv;const bp=class bp extends Set{constructor(e,n,r){super(e),e instanceof bp?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};u(bp,"$e40ea825a81a3709$export$52baac22726c72bf");let En=bp;function TI(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}u(TI,"$7af3f5b51489e0b5$var$equalSets");function AI(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:l="all"}=t,a=(0,wp.element.useRef)(!1),[,o]=(0,wp.element.useState)(!1),s=(0,wp.element.useRef)(null),c=(0,wp.element.useRef)(null),[,d]=(0,wp.element.useState)(null),f=(0,wp.element.useMemo)(()=>tP(t.selectedKeys),[t.selectedKeys]),h=(0,wp.element.useMemo)(()=>tP(t.defaultSelectedKeys,new En),[t.defaultSelectedKeys]),[p,m]=je(f,h,t.onSelectionChange),g=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[O,b]=(0,wp.element.useState)(i);i==="replace"&&O==="toggle"&&typeof p=="object"&&p.size===0&&b("replace");let y=(0,wp.element.useRef)(i);return(0,wp.element.useEffect)(()=>{i!==y.current&&(b(i),y.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:O,setSelectionBehavior:b,get isFocused(){return a.current},setFocused($){a.current=$,o($)},get focusedKey(){return s.current},get childFocusStrategy(){return c.current},setFocusedKey($,v="first"){s.current=$,c.current=v,d($)},selectedKeys:p,setSelectedKeys($){(r||!TI($,p))&&m($)},disabledKeys:g,disabledBehavior:l}}u(AI,"$7af3f5b51489e0b5$export$253fe78d46329472");function tP(t,e){return t?t==="all"?"all":new En(t):e}u(tP,"$7af3f5b51489e0b5$var$convertSelection");const yp=class yp{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&t0(this.collection,i,e)<0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&t0(this.collection,i,e)>0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new En([n],n,n);else{let a=this.state.selectedKeys;var i;let o=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new En(a,o,n);var l;for(let s of this.getKeyRange(o,(l=a.currentKey)!==null&&l!==void 0?l:n))r.delete(s);for(let s of this.getKeyRange(n,o))this.canSelectItem(s)&&r.add(s)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),i=this.collection.getItem(n);return r&&i?t0(this.collection,r,i)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let i=[],l=e;for(;l!=null;){let a=this.collection.getItem(l);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(l),l===n)return i;l=this.collection.getKeyAfter(l)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new En(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new En([n],n,n):new En;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new En;for(let r of e){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=[],n=u(r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);a?.type==="item"&&e.push(r);var l;a?.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((l=(i=oF(Rd(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&l!==void 0?l:null)}r=this.collection.getKeyAfter(r)}},"addKeys");return n(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new En)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=this.collection.getItem(e);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(e){var n,r;return!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))===null||n===void 0?void 0:n.props}withCollection(e){return new yp(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,n,r){this.collection=e,this.state=n;var i;this.allowsCellSelection=(i=r?.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null}};u(yp,"$d496c0a20b6e58ec$export$6c8a5aaad13c9852");let O0=yp;function b0(t){let{filter:e,layoutDelegate:n}=t,r=AI(t),i=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=(0,wp.element.useCallback)(c=>e?new ys(e(c)):new ys(c),[e]),a=(0,wp.element.useMemo)(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),o=aF(t,l,a),s=(0,wp.element.useMemo)(()=>new O0(o,r,{layoutDelegate:n}),[o,r,n]);return QI(o,s),{collection:o,disabledKeys:i,selectionManager:s}}u(b0,"$e72dd72e1c76a225$export$2f645645f7bca764");function QI(t,e){const n=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){const d=n.current.getItem(e.focusedKey),f=[...n.current.getKeys()].map(b=>{const y=n.current.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null),h=[...t.getKeys()].map(b=>{const y=t.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null);var r,i;const p=((r=f?.length)!==null&&r!==void 0?r:0)-((i=h?.length)!==null&&i!==void 0?i:0);var l,a,o;let m=Math.min(p>1?Math.max(((l=d?.index)!==null&&l!==void 0?l:0)-p+1,0):(a=d?.index)!==null&&a!==void 0?a:0,((o=h?.length)!==null&&o!==void 0?o:0)-1),g=null,O=!1;for(;m>=0;){if(!e.isDisabled(h[m].key)){g=h[m];break}if(m((s=d?.index)!==null&&s!==void 0?s:0)&&(m=(c=d?.index)!==null&&c!==void 0?c:0),m--}}e.setFocusedKey(g?g.key:null)}n.current=t},[t,e])}u(QI,"$e72dd72e1c76a225$var$useFocusedKeyReset");function MI(t){var e;let[n,r]=je(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),i=(0,wp.element.useMemo)(()=>n!=null?[n]:[],[n]),{collection:l,disabledKeys:a,selectionManager:o}=b0({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:c=>{if(c==="all")return;var d;let f=(d=c.values().next().value)!==null&&d!==void 0?d:null;f===n&&t.onSelectionChange&&t.onSelectionChange(f),r(f)}}),s=n!=null?l.getItem(n):null;return{collection:l,disabledKeys:a,selectionManager:o,selectedKey:n,setSelectedKey:r,selectedItem:s}}u(MI,"$a0d645289fe9b86b$export$e7f05e985daf4b5f");function pi(t){let[e,n]=je(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=(0,wp.element.useCallback)(()=>{n(!0)},[n]),i=(0,wp.element.useCallback)(()=>{n(!1)},[n]),l=(0,wp.element.useCallback)(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:i,toggle:l}}u(pi,"$fc909762b330b746$export$61c6a8c84e605fb6");function nP(t){var e;let{defaultFilter:n,menuTrigger:r="input",allowsEmptyCollection:i=!1,allowsCustomValue:l,shouldCloseOnBlur:a=!0}=t,[o,s]=(0,wp.element.useState)(!1),[c,d]=(0,wp.element.useState)(!1),[f,h]=(0,wp.element.useState)(null),p=u(oe=>{t.onSelectionChange&&t.onSelectionChange(oe),oe===b&&(z(),k())},"onSelectionChange");var m;let{collection:g,selectionManager:O,selectedKey:b,setSelectedKey:y,selectedItem:$,disabledKeys:v}=MI({...t,onSelectionChange:p,items:(m=t.items)!==null&&m!==void 0?m:t.defaultItems}),[S,x]=je(t.inputValue,iP(t.defaultInputValue,b,g)||"",t.onInputChange),[C]=(0,wp.element.useState)(b),[Q]=(0,wp.element.useState)(S),T=g,B=(0,wp.element.useMemo)(()=>t.items!=null||!n?g:BI(g,S,n),[g,S,n,t.items]),[w,M]=(0,wp.element.useState)(B),A=(0,wp.element.useRef)("focus"),I=pi({...t,onOpenChange:u(oe=>{t.onOpenChange&&t.onOpenChange(oe,oe?A.current:void 0),O.setFocused(oe),oe||O.setFocusedKey(null)},"onOpenChange"),isOpen:void 0,defaultOpen:void 0}),D=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";(i||B.size>0||$e&&T.size>0||t.items)&&($e&&!I.isOpen&&t.items===void 0&&s(!0),A.current=ge,h(oe),I.open())},"open"),P=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";!(i||B.size>0||$e&&T.size>0||t.items)&&!I.isOpen||($e&&!I.isOpen&&t.items===void 0&&s(!0),I.isOpen||(A.current=ge),L(oe))},"toggle"),R=(0,wp.element.useCallback)(()=>{M(o?T:B)},[o,T,B]),L=(0,wp.element.useCallback)((oe=null)=>{I.isOpen&&R(),h(oe),I.toggle()},[I,R]),k=(0,wp.element.useCallback)(()=>{I.isOpen&&(R(),I.close())},[I,R]),[F,N]=(0,wp.element.useState)(S),z=u(()=>{var oe,ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";N($e),x($e)},"resetInputValue");var G,le;let ie=(0,wp.element.useRef)((le=(G=t.selectedKey)!==null&&G!==void 0?G:t.defaultSelectedKey)!==null&&le!==void 0?le:null);var me;let ve=(0,wp.element.useRef)(b!=null&&(me=(e=g.getItem(b))===null||e===void 0?void 0:e.textValue)!==null&&me!==void 0?me:"");(0,wp.element.useEffect)(()=>{var oe;c&&(B.size>0||i)&&!I.isOpen&&S!==F&&r!=="manual"&&D(null,"input"),!o&&!i&&I.isOpen&&B.size===0&&k(),b!=null&&b!==ie.current&&k(),S!==F&&(O.setFocusedKey(null),s(!1),S===""&&(t.inputValue===void 0||t.selectedKey===void 0)&&y(null)),b!==ie.current&&(t.inputValue===void 0||t.selectedKey===void 0)?z():F!==S&&N(S);var ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";!c&&b!=null&&t.inputValue===void 0&&b===ie.current&&ve.current!==$e&&(N($e),x($e)),ie.current=b,ve.current=$e});let ce=qn({...t,value:(0,wp.element.useMemo)(()=>({inputValue:S,selectedKey:b}),[S,b])}),K=u(()=>{l&&b==null?W():Z()},"revert"),W=u(()=>{ie.current=null,y(null),k()},"commitCustomValue"),Z=u(()=>{if(t.selectedKey!==void 0&&t.inputValue!==void 0){var oe,ge;(oe=t.onSelectionChange)===null||oe===void 0||oe.call(t,b);var $e;let Zi=b!=null&&($e=(ge=g.getItem(b))===null||ge===void 0?void 0:ge.textValue)!==null&&$e!==void 0?$e:"";N(Zi),k()}else z(),k()},"commitSelection");const ee=u(()=>{if(l){var oe,ge;const $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";S===$e?Z():W()}else Z()},"commitValue");let De=u(()=>{I.isOpen&&O.focusedKey!=null?b===O.focusedKey?Z():y(O.focusedKey):ee()},"commit"),qt=(0,wp.element.useRef)(S),ni=u(oe=>{oe?(qt.current=S,r==="focus"&&!t.isReadOnly&&D(null,"focus")):(a&&ee(),S!==qt.current&&ce.commitValidation()),d(oe)},"setFocused"),br=(0,wp.element.useMemo)(()=>I.isOpen?o?T:B:w,[I.isOpen,T,B,o,w]);var la;let q=(la=t.defaultSelectedKey)!==null&&la!==void 0?la:C;var fe;return{...ce,...I,focusStrategy:f,toggle:P,open:D,close:ee,selectionManager:O,selectedKey:b,defaultSelectedKey:q,setSelectedKey:y,disabledKeys:v,isFocused:c,setFocused:ni,selectedItem:$,collection:br,inputValue:S,defaultInputValue:(fe=iP(t.defaultInputValue,q,g))!==null&&fe!==void 0?fe:Q,setInputValue:x,commit:De,revert:K}}u(nP,"$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e");function BI(t,e,n){return new ys(rP(t,t,e,n))}u(BI,"$a9e7382a7d111cb5$var$filterCollection");function rP(t,e,n,r){let i=[];for(let l of e)if(l.type==="section"&&l.hasChildNodes){let a=rP(t,Rd(l,t),n,r);[...a].some(o=>o.type==="item")&&i.push({...l,childNodes:a})}else l.type==="item"&&r(l.textValue,n)?i.push({...l}):l.type!=="item"&&i.push({...l});return i}u(rP,"$a9e7382a7d111cb5$var$filterNodes");function iP(t,e,n){if(t==null){var r,i;if(e!=null)return(i=(r=n.getItem(e))===null||r===void 0?void 0:r.textValue)!==null&&i!==void 0?i:""}return t}u(iP,"$a9e7382a7d111cb5$var$getDefaultInputValue");var lP={};lP={rangeOverflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.maxValue} \u0623\u0648 \u0642\u0628\u0644 \u0630\u0644\u0643.`,rangeReversed:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621 \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0642\u0628\u0644 \u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621.",rangeUnderflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.minValue} \u0623\u0648 \u0628\u0639\u062F \u0630\u0644\u0643.`,unavailableDate:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0645\u062D\u062F\u062F\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629."};var aP={};aP={rangeOverflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.maxValue} \u0438\u043B\u0438 \u043F\u043E-\u0440\u0430\u043D\u043D\u0430.`,rangeReversed:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 \u043F\u0440\u0435\u0434\u0438 \u043A\u0440\u0430\u0439\u043D\u0430\u0442\u0430.",rangeUnderflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.minValue} \u0438\u043B\u0438 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.`,unavailableDate:"\u0418\u0437\u0431\u0440\u0430\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435 \u0435 \u043D\u0430\u043B\u0438\u0447\u043D\u0430."};var oP={};oP={rangeOverflow:t=>`Hodnota mus\xED b\xFDt ${t.maxValue} nebo d\u0159\xEDv\u011Bj\u0161\xED.`,rangeReversed:"Datum zah\xE1jen\xED mus\xED p\u0159edch\xE1zet datu ukon\u010Den\xED.",rangeUnderflow:t=>`Hodnota mus\xED b\xFDt ${t.minValue} nebo pozd\u011Bj\u0161\xED.`,unavailableDate:"Vybran\xE9 datum nen\xED k dispozici."};var sP={};sP={rangeOverflow:t=>`V\xE6rdien skal v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xE6re f\xF8r slutdatoen.",rangeUnderflow:t=>`V\xE6rdien skal v\xE6re ${t.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xE6ngelig."};var uP={};uP={rangeOverflow:t=>`Der Wert muss ${t.maxValue} oder fr\xFCher sein.`,rangeReversed:"Das Startdatum muss vor dem Enddatum liegen.",rangeUnderflow:t=>`Der Wert muss ${t.minValue} oder sp\xE4ter sein.`,unavailableDate:"Das ausgew\xE4hlte Datum ist nicht verf\xFCgbar."};var cP={};cP={rangeOverflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.maxValue} \u03AE \u03C0\u03B1\u03BB\u03B1\u03B9\u03CC\u03C4\u03B5\u03C1\u03B7.`,rangeReversed:"\u0397 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2 \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2.",rangeUnderflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.minValue} \u03AE \u03BC\u03B5\u03C4\u03B1\u03B3\u03B5\u03BD\u03AD\u03C3\u03C4\u03B5\u03C1\u03B7.`,unavailableDate:"\u0397 \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03B7."};var dP={};dP={rangeUnderflow:t=>`Value must be ${t.minValue} or later.`,rangeOverflow:t=>`Value must be ${t.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."};var fP={};fP={rangeOverflow:t=>`El valor debe ser ${t.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xF3n.",rangeUnderflow:t=>`El valor debe ser ${t.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."};var hP={};hP={rangeOverflow:t=>`V\xE4\xE4rtus peab olema ${t.maxValue} v\xF5i varasem.`,rangeReversed:"Alguskuup\xE4ev peab olema enne l\xF5ppkuup\xE4eva.",rangeUnderflow:t=>`V\xE4\xE4rtus peab olema ${t.minValue} v\xF5i hilisem.`,unavailableDate:"Valitud kuup\xE4ev pole saadaval."};var pP={};pP={rangeOverflow:t=>`Arvon on oltava ${t.maxValue} tai sit\xE4 aikaisempi.`,rangeReversed:"Aloitusp\xE4iv\xE4n on oltava ennen lopetusp\xE4iv\xE4\xE4.",rangeUnderflow:t=>`Arvon on oltava ${t.minValue} tai sit\xE4 my\xF6h\xE4isempi.`,unavailableDate:"Valittu p\xE4iv\xE4m\xE4\xE4r\xE4 ei ole k\xE4ytett\xE4viss\xE4."};var mP={};mP={rangeOverflow:t=>`La valeur doit \xEAtre ${t.maxValue} ou ant\xE9rieure.`,rangeReversed:"La date de d\xE9but doit \xEAtre ant\xE9rieure \xE0 la date de fin.",rangeUnderflow:t=>`La valeur doit \xEAtre ${t.minValue} ou ult\xE9rieure.`,unavailableDate:"La date s\xE9lectionn\xE9e n\u2019est pas disponible."};var gP={};gP={rangeOverflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.maxValue} \u05D0\u05D5 \u05DE\u05D5\u05E7\u05D3\u05DD \u05D9\u05D5\u05EA\u05E8.`,rangeReversed:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05D4\u05EA\u05D7\u05DC\u05D4 \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05E0\u05D9 \u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E1\u05D9\u05D5\u05DD.",rangeUnderflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.minValue} \u05D0\u05D5 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.`,unavailableDate:"\u05D4\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E0\u05D1\u05D7\u05E8 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF."};var OP={};OP={rangeOverflow:t=>`Vrijednost mora biti ${t.maxValue} ili ranije.`,rangeReversed:"Datum po\u010Detka mora biti prije datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrijednost mora biti ${t.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."};var bP={};bP={rangeOverflow:t=>`Az \xE9rt\xE9knek ${t.maxValue} vagy kor\xE1bbinak kell lennie.`,rangeReversed:"A kezd\u0151 d\xE1tumnak a befejez\u0151 d\xE1tumn\xE1l kor\xE1bbinak kell lennie.",rangeUnderflow:t=>`Az \xE9rt\xE9knek ${t.minValue} vagy k\xE9s\u0151bbinek kell lennie.`,unavailableDate:"A kiv\xE1lasztott d\xE1tum nem \xE9rhet\u0151 el."};var yP={};yP={rangeOverflow:t=>`Il valore deve essere ${t.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:t=>`Il valore deve essere ${t.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."};var vP={};vP={rangeOverflow:t=>`\u5024\u306F ${t.maxValue} \u4EE5\u4E0B\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u306F\u7D42\u4E86\u65E5\u3088\u308A\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",rangeUnderflow:t=>`\u5024\u306F ${t.minValue} \u4EE5\u4E0A\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,unavailableDate:"\u9078\u629E\u3057\u305F\u65E5\u4ED8\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002"};var $P={};$P={rangeOverflow:t=>`\uAC12\uC740 ${t.maxValue} \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,rangeReversed:"\uC2DC\uC791\uC77C\uC740 \uC885\uB8CC\uC77C \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.",rangeUnderflow:t=>`\uAC12\uC740 ${t.minValue} \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,unavailableDate:"\uC120\uD0DD\uD55C \uB0A0\uC9DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."};var wP={};wP={rangeOverflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.maxValue} arba ankstesn\u0117.`,rangeReversed:"Prad\u017Eios data turi b\u016Bti ankstesn\u0117 nei pabaigos data.",rangeUnderflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.minValue} arba naujesn\u0117.`,unavailableDate:"Pasirinkta data nepasiekiama."};var xP={};xP={rangeOverflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.maxValue} vai agr\u0101kai.`,rangeReversed:"S\u0101kuma datumam ir j\u0101b\u016Bt pirms beigu datuma.",rangeUnderflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.minValue} vai v\u0113l\u0101kai.`,unavailableDate:"Atlas\u012Btais datums nav pieejams."};var SP={};SP={rangeOverflow:t=>`Verdien m\xE5 v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xE5 v\xE6re f\xF8r sluttdatoen.",rangeUnderflow:t=>`Verdien m\xE5 v\xE6re ${t.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."};var CP={};CP={rangeOverflow:t=>`Waarde moet ${t.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:t=>`Waarde moet ${t.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."};var kP={};kP={rangeOverflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.maxValue} lub wcze\u015Bniejsz\u0105.`,rangeReversed:"Data rozpocz\u0119cia musi by\u0107 wcze\u015Bniejsza ni\u017C data zako\u0144czenia.",rangeUnderflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.minValue} lub p\xF3\u017Aniejsz\u0105.`,unavailableDate:"Wybrana data jest niedost\u0119pna."};var DP={};DP={rangeOverflow:t=>`O valor deve ser ${t.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xE0 data final.",rangeUnderflow:t=>`O valor deve ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var PP={};PP={rangeOverflow:t=>`O valor tem de ser ${t.maxValue} ou anterior.`,rangeReversed:"A data de in\xEDcio deve ser anterior \xE0 data de fim.",rangeUnderflow:t=>`O valor tem de ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var EP={};EP={rangeOverflow:t=>`Valoarea trebuie s\u0103 fie ${t.maxValue} sau anterioar\u0103.`,rangeReversed:"Data de \xEEnceput trebuie s\u0103 fie anterioar\u0103 datei de sf\xE2r\u0219it.",rangeUnderflow:t=>`Valoarea trebuie s\u0103 fie ${t.minValue} sau ulterioar\u0103.`,unavailableDate:"Data selectat\u0103 nu este disponibil\u0103."};var TP={};TP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043F\u043E\u0437\u0436\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0434\u0430\u0442\u0435 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u0440\u0430\u043D\u044C\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var AP={};AP={rangeOverflow:t=>`Hodnota mus\xED by\u0165 ${t.maxValue} alebo skor\u0161ia.`,rangeReversed:"D\xE1tum za\u010Diatku mus\xED by\u0165 skor\u0161\xED ako d\xE1tum konca.",rangeUnderflow:t=>`Hodnota mus\xED by\u0165 ${t.minValue} alebo neskor\u0161ia.`,unavailableDate:"Vybrat\xFD d\xE1tum je nedostupn\xFD."};var QP={};QP={rangeOverflow:t=>`Vrednost mora biti ${t.maxValue} ali starej\u0161a.`,rangeReversed:"Za\u010Detni datum mora biti pred kon\u010Dnim datumom.",rangeUnderflow:t=>`Vrednost mora biti ${t.minValue} ali novej\u0161a.`,unavailableDate:"Izbrani datum ni na voljo."};var MP={};MP={rangeOverflow:t=>`Vrednost mora da bude ${t.maxValue} ili starija.`,rangeReversed:"Datum po\u010Detka mora biti pre datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrednost mora da bude ${t.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."};var BP={};BP={rangeOverflow:t=>`V\xE4rdet m\xE5ste vara ${t.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xE5ste vara f\xF6re slutdatumet.",rangeUnderflow:t=>`V\xE4rdet m\xE5ste vara ${t.minValue} eller senare.`,unavailableDate:"Det valda datumet \xE4r inte tillg\xE4ngligt."};var RP={};RP={rangeOverflow:t=>`De\u011Fer, ${t.maxValue} veya \xF6ncesi olmal\u0131d\u0131r.`,rangeReversed:"Ba\u015Flang\u0131\xE7 tarihi biti\u015F tarihinden \xF6nce olmal\u0131d\u0131r.",rangeUnderflow:t=>`De\u011Fer, ${t.minValue} veya sonras\u0131 olmal\u0131d\u0131r.`,unavailableDate:"Se\xE7ilen tarih kullan\u0131lam\u0131yor."};var VP={};VP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u043F\u0456\u0437\u043D\u0456\u0448\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443 \u043C\u0430\u0454 \u043F\u0435\u0440\u0435\u0434\u0443\u0432\u0430\u0442\u0438 \u0434\u0430\u0442\u0456 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u0440\u0430\u043D\u0456\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var NP={};NP={rangeOverflow:t=>`\u503C\u5FC5\u987B\u662F ${t.maxValue} \u6216\u66F4\u65E9\u65E5\u671F\u3002`,rangeReversed:"\u5F00\u59CB\u65E5\u671F\u5FC5\u987B\u65E9\u4E8E\u7ED3\u675F\u65E5\u671F\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u987B\u662F ${t.minValue} \u6216\u66F4\u665A\u65E5\u671F\u3002`,unavailableDate:"\u6240\u9009\u65E5\u671F\u4E0D\u53EF\u7528\u3002"};var FP={};FP={rangeOverflow:t=>`\u503C\u5FC5\u9808\u662F ${t.maxValue} \u6216\u66F4\u65E9\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u671F\u5FC5\u9808\u5728\u7D50\u675F\u65E5\u671F\u4E4B\u524D\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u9808\u662F ${t.minValue} \u6216\u66F4\u665A\u3002`,unavailableDate:"\u6240\u9078\u65E5\u671F\u7121\u6CD5\u4F7F\u7528\u3002"};var IP={};IP={"ar-AE":lP,"bg-BG":aP,"cs-CZ":oP,"da-DK":sP,"de-DE":uP,"el-GR":cP,"en-US":dP,"es-ES":fP,"et-EE":hP,"fi-FI":pP,"fr-FR":mP,"he-IL":gP,"hr-HR":OP,"hu-HU":bP,"it-IT":yP,"ja-JP":vP,"ko-KR":$P,"lt-LT":wP,"lv-LV":xP,"nb-NO":SP,"nl-NL":CP,"pl-PL":kP,"pt-BR":DP,"pt-PT":PP,"ro-RO":EP,"ru-RU":TP,"sk-SK":AP,"sl-SI":QP,"sr-SP":MP,"sv-SE":BP,"tr-TR":RP,"uk-UA":VP,"zh-CN":NP,"zh-TW":FP};function RI(t){return t&&t.__esModule?t.default:t}u(RI,"$parcel$interopDefault");const LP=new dn(RI(IP));function zP(){let t=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return t}u(zP,"$35a22f14a1f04b11$var$getLocale");function Fd(t,e,n,r,i){let l=t!=null&&n!=null&&t.compare(n)>0,a=t!=null&&e!=null&&t.compare(e)<0,o=t!=null&&r?.(t)||!1,s=l||a||o,c=[];if(s){let d=zP(),f=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||LP,h=new Wo(d,f),p=new Rt(d,Br({},i)),m=p.resolvedOptions().timeZone;a&&e!=null&&c.push(h.format("rangeUnderflow",{minValue:p.format(e.toDate(m))})),l&&n!=null&&c.push(h.format("rangeOverflow",{maxValue:p.format(n.toDate(m))})),o&&c.push(h.format("unavailableDate"))}return{isInvalid:s,validationErrors:c,validationDetails:{badInput:o,customError:!1,patternMismatch:!1,rangeOverflow:l,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!s}}}u(Fd,"$35a22f14a1f04b11$export$f18627323ab57ac0");function VI(t,e,n,r,i){var l;let a=Fd((l=t?.start)!==null&&l!==void 0?l:null,e,n,r,i);var o;let s=Fd((o=t?.end)!==null&&o!==void 0?o:null,e,n,r,i),c=Cd(a,s);if(t?.end!=null&&t.start!=null&&t.end.compare(t.start)<0){let d=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||LP;c=Cd(c,{isInvalid:!0,validationErrors:[d.getStringForLocale("rangeReversed",zP())],validationDetails:{...Sd,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return c}u(VI,"$35a22f14a1f04b11$export$80ff8fc0ae339c13");const NI={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},FI={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function Br(t,e){t={...e.shouldForceLeadingZeros?FI:NI,...t};let r=e.granularity||"minute",i=Object.keys(t);var l;let a=i.indexOf((l=e.maxGranularity)!==null&&l!==void 0?l:"year");a<0&&(a=0);let o=i.indexOf(r);if(o<0&&(o=2),a>o)throw new Error("maxGranularity must be greater than granularity");let s=i.slice(a,o+1).reduce((d,f)=>(d[f]=t[f],d),{});return e.hourCycle!=null&&(s.hour12=e.hourCycle===12),s.timeZone=e.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&e.timeZone&&!e.hideTimeZone&&(s.timeZoneName="short"),e.showEra&&a===0&&(s.era="short"),s}u(Br,"$35a22f14a1f04b11$export$7e319ea407e63bc0");function Ta(t){return t&&"hour"in t?t:new Tr}u(Ta,"$35a22f14a1f04b11$export$c5221a78ef73c5e9");function ZP(t,e){if(t===null)return null;if(t)return Ne(t,e)}u(ZP,"$35a22f14a1f04b11$export$61a490a80c552550");function vs(t,e,n,r){if(t)return ZP(t,n);let i=Ne(R3(r??kr()).set({hour:0,minute:0,second:0,millisecond:0}),n);return e==="year"||e==="month"||e==="day"?vt(i):r?i:Pn(i)}u(vs,"$35a22f14a1f04b11$export$66aa2b09de4b1ea5");function y0(t,e){let n=t&&"timeZone"in t?t.timeZone:void 0,r=t&&"minute"in t?"minute":"day";if(t&&e&&!(e in t))throw new Error("Invalid granularity "+e+" for value "+t.toString());let[i,l]=(0,wp.element.useState)([r,n]);t&&(i[0]!==r||i[1]!==n)&&l([r,n]),e||(e=t?r:i[0]);let a=t?n:i[1];return[e,a]}u(y0,"$35a22f14a1f04b11$export$2440da353cedad43");function II(t){let e=pi(t),[n,r]=je(t.value,t.defaultValue||null,t.onChange),[i]=(0,wp.element.useState)(n),l=n||t.placeholderValue||null,[a,o]=y0(l,t.granularity),s=n!=null?n.toDate(o??"UTC"):null,c=a==="hour"||a==="minute"||a==="second";var d;let f=(d=t.shouldCloseOnSelect)!==null&&d!==void 0?d:!0,[h,p]=(0,wp.element.useState)(null),[m,g]=(0,wp.element.useState)(null);if(n&&(h=n,"hour"in n&&(m=n)),l&&!(a in l))throw new Error("Invalid granularity "+a+" for value "+l.toString());let O=n?.calendar.identifier==="gregory"&&n.era==="BC",b=(0,wp.element.useMemo)(()=>({granularity:a,timeZone:o,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:O}),[a,t.hourCycle,t.shouldForceLeadingZeros,o,t.hideTimeZone,O]),{minValue:y,maxValue:$,isDateUnavailable:v}=t,S=(0,wp.element.useMemo)(()=>Fd(n,y,$,v,b),[n,y,$,v,b]),x=qn({...t,value:n,builtinValidation:S}),C=x.displayValidation.isInvalid,Q=t.validationState||(C?"invalid":null),T=u((A,E)=>{r("timeZone"in E?E.set(vt(A)):Pn(A,E)),p(null),g(null),x.commitValidation()},"commitValue"),B=u(A=>{let E=typeof f=="function"?f():f;c?m||E?T(A,m||Ta(t.defaultValue||t.placeholderValue)):p(A):(r(A),x.commitValidation()),E&&e.setOpen(!1)},"selectDate"),w=u(A=>{h&&A?T(h,A):g(A)},"selectTime");var M;return{...x,value:n,defaultValue:(M=t.defaultValue)!==null&&M!==void 0?M:i,setValue:r,dateValue:h,timeValue:m,setDateValue:B,setTimeValue:w,granularity:a,hasTime:c,...e,setOpen(A){!A&&!n&&h&&c&&T(h,m||Ta(t.defaultValue||t.placeholderValue)),e.setOpen(A)},validationState:Q,isInvalid:C,formatValue(A,E){if(!s)return"";let I=Br(E,b);return new Rt(A,I).format(s)},getDateFormatter(A,E){let I={...b,...E},D=Br({},I);return new Rt(A,D)}}}u(II,"$ab5bf3f618090389$export$87194bb378cc3ac2");const LI=new dn({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"\u12D3\u12D3\u12D3\u12D3",month:"\u121A\u121C",day:"\u1240\u1240"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"\u0633\u0646\u0629",month:"\u0634\u0647\u0631",day:"\u064A\u0648\u0645"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bg:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bn:{year:"yyyy",month:"\u09AE\u09BF\u09AE\u09BF",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"\u0633\u0627\u06B5",month:"\u0645\u0627\u0646\u06AF",day:"\u0695\u06C6\u0698"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"\u017A\u017A"},el:{year:"\u03B5\u03B5\u03B5\u03B5",month:"\u03BC\u03BC",day:"\u03B7\u03B7"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"\u0633\u0627\u0644",month:"\u0645\u0627\u0647",day:"\u0631\u0648\u0632"},ff:{year:"hhhh",month:"ll",day:"\xF1\xF1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"\u05E9\u05E0\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",day:"\u05D9\u05D5\u05DD"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xE9\xE9\xE9\xE9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"\u5E74",month:"\u6708",day:"\u65E5"},ka:{year:"\u10EC\u10EC\u10EC\u10EC",month:"\u10D7\u10D7",day:"\u10E0\u10E0"},kk:{year:"\u0436\u0436\u0436\u0436",month:"\u0430\u0430",day:"\u043A\u043A"},kn:{year:"\u0CB5\u0CB5\u0CB5\u0CB5",month:"\u0CAE\u0CBF\u0CAE\u0CC0",day:"\u0CA6\u0CBF\u0CA6\u0CBF"},ko:{year:"\uC5F0\uB3C4",month:"\uC6D4",day:"\uC77C"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"\u0E9B\u0E9B\u0E9B\u0E9B",month:"\u0E94\u0E94",day:"\u0EA7\u0EA7"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"\u0D35\u0D7C\u0D37\u0D02",month:"\u0D2E\u0D3E\u0D38\u0D02",day:"\u0D24\u0D40\u0D2F\u0D24\u0D3F"},ms:{year:"tttt",month:"mm",day:"hh"},nb:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},no:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sv:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"\u0441\u0441\u0441\u0441",month:"\u043C\u043C",day:"\u0440\u0440"},th:{year:"\u0E1B\u0E1B\u0E1B\u0E1B",month:"\u0E14\u0E14",day:"\u0E27\u0E27"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"\u0440\u0440\u0440\u0440",month:"\u043C\u043C",day:"\u0434\u0434"},"zh-CN":{year:"\u5E74",month:"\u6708",day:"\u65E5"},"zh-TW":{year:"\u5E74",month:"\u6708",day:"\u65E5"}},"en");function zI(t,e,n){return t==="era"||t==="dayPeriod"?e:t==="year"||t==="month"||t==="day"?LI.getStringForLocale(t,n):"\u2013\u2013"}u(zI,"$3e3ed55ab2966714$export$d3f5c5e0a5023fa0");const Id={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},XP={year:5,month:2,day:7,hour:2,minute:15,second:15},jP={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function qP(t){let{locale:e,createCalendar:n,hideTimeZone:r,isDisabled:i=!1,isReadOnly:l=!1,isRequired:a=!1,minValue:o,maxValue:s,isDateUnavailable:c}=t,d=t.value||t.defaultValue||t.placeholderValue||null,[f,h]=y0(d,t.granularity),p=h||"UTC";if(d&&!(f in d))throw new Error("Invalid granularity "+f+" for value "+d.toString());let m=(0,wp.element.useMemo)(()=>new Rt(e),[e]),g=(0,wp.element.useMemo)(()=>n(m.resolvedOptions().calendar),[n,m]);var O;let[b,y]=je(t.value,(O=t.defaultValue)!==null&&O!==void 0?O:null,t.onChange),[$]=(0,wp.element.useState)(b),v=(0,wp.element.useMemo)(()=>{var K;return(K=ZP(b,g))!==null&&K!==void 0?K:null},[b,g]),[S,x]=(0,wp.element.useState)(()=>vs(t.placeholderValue,f,g,h)),C=v||S,Q=g.identifier==="gregory"&&C.era==="BC",T=(0,wp.element.useMemo)(()=>{var K;return{granularity:f,maxGranularity:(K=t.maxGranularity)!==null&&K!==void 0?K:"year",timeZone:h,hideTimeZone:r,hourCycle:t.hourCycle,showEra:Q,shouldForceLeadingZeros:t.shouldForceLeadingZeros}},[t.maxGranularity,f,t.hourCycle,t.shouldForceLeadingZeros,h,r,Q]),B=(0,wp.element.useMemo)(()=>Br({},T),[T]),w=(0,wp.element.useMemo)(()=>new Rt(e,B),[e,B]),M=(0,wp.element.useMemo)(()=>w.resolvedOptions(),[w]),A=(0,wp.element.useMemo)(()=>w.formatToParts(new Date).filter(K=>Id[K.type]).reduce((K,W)=>(K[jP[W.type]||W.type]=!0,K),{}),[w]),[E,I]=(0,wp.element.useState)(()=>t.value||t.defaultValue?{...A}:{}),D=(0,wp.element.useRef)(null),P=(0,wp.element.useRef)(g);(0,wp.element.useEffect)(()=>{sd(g,P.current)||(P.current=g,x(K=>Object.keys(E).length>0?Ne(K,g):vs(t.placeholderValue,f,g,h)))},[g,f,E,h,t.placeholderValue]),b&&Object.keys(E).length=Object.keys(A).length?v:S,L=u(K=>{if(t.isDisabled||t.isReadOnly)return;let W=Object.keys(E),Z=Object.keys(A);K==null?(y(null),x(vs(t.placeholderValue,f,g,h)),I({})):W.length===0&&D.current==null||W.length>=Z.length||W.length===Z.length-1&&A.dayPeriod&&!E.dayPeriod&&D.current!=="dayPeriod"?(W.length===0&&(E={...A},I(E)),K=Ne(K,d?.calendar||new tt),y(K)):x(K),D.current=null},"setValue"),k=(0,wp.element.useMemo)(()=>R.toDate(p),[R,p]),F=(0,wp.element.useMemo)(()=>ZI(k,E,w,M,R,g,e,f),[k,E,w,M,R,g,e,f]);A.era&&E.year&&!E.era?(E.era=!0,I({...E})):!A.era&&E.era&&(delete E.era,I({...E}));let N=u(K=>{E[K]=!0,K==="year"&&A.era&&(E.era=!0),I({...E})},"markValid"),z=u((K,W)=>{if(E[K])L(XI(R,K,W,M));else{N(K);let Z=Object.keys(E),ee=Object.keys(A);(Z.length>=ee.length||Z.length===ee.length-1&&A.dayPeriod&&!E.dayPeriod)&&L(R)}},"adjustSegment"),G=(0,wp.element.useMemo)(()=>Fd(b,o,s,c,T),[b,o,s,c,T]),le=qn({...t,value:b,builtinValidation:G}),ie=le.displayValidation.isInvalid,me=t.validationState||(ie?"invalid":null);var ve,ce;return{...le,value:v,defaultValue:(ve=t.defaultValue)!==null&&ve!==void 0?ve:$,dateValue:k,calendar:g,setValue:L,segments:F,dateFormatter:w,validationState:me,isInvalid:ie,granularity:f,maxGranularity:(ce=t.maxGranularity)!==null&&ce!==void 0?ce:"year",isDisabled:i,isReadOnly:l,isRequired:a,increment(K){z(K,1)},decrement(K){z(K,-1)},incrementPage(K){z(K,XP[K]||1)},decrementPage(K){z(K,-(XP[K]||1))},setSegment(K,W){N(K),L(jI(R,K,W,M))},confirmPlaceholder(){if(t.isDisabled||t.isReadOnly)return;let K=Object.keys(E),W=Object.keys(A);K.length===W.length-1&&A.dayPeriod&&!E.dayPeriod&&(E={...A},I(E),L(R.copy()))},clearSegment(K){delete E[K],D.current=K,I({...E});let W=vs(t.placeholderValue,f,g,h),Z=R;if(K==="dayPeriod"&&"hour"in R&&"hour"in W){let ee=R.hour>=12,De=W.hour>=12;ee&&!De?Z=R.set({hour:R.hour-12}):!ee&&De&&(Z=R.set({hour:R.hour+12}))}else K==="hour"&&"hour"in R&&R.hour>=12&&E.dayPeriod?Z=R.set({hour:W.hour+12}):K in R&&(Z=R.set({[K]:W[K]}));y(null),L(Z)},formatValue(K){if(!v)return"";let W=Br(K,T);return new Rt(e,W).format(k)},getDateFormatter(K,W){let Z={...T,...W},ee=Br({},Z);return new Rt(K,ee)}}}u(qP,"$3c0fc76039f1c516$export$60e84778edff6d26");function ZI(t,e,n,r,i,l,a,o){let s=["hour","minute","second"],c=n.formatToParts(t),d=[];for(let f of c){let h=jP[f.type]||f.type,p=Id[h];h==="era"&&l.getEras().length===1&&(p=!1);let m=Id[h]&&!e[h],g=Id[h]?zI(h,f.value,a):null,O={type:h,text:m?g:f.value,...Ld(i,h,r),isPlaceholder:m,placeholder:g,isEditable:p};h==="hour"?(d.push({type:"literal",text:"\u2066",...Ld(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(O),h===o&&d.push({type:"literal",text:"\u2069",...Ld(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(h)&&h===o?(d.push(O),d.push({type:"literal",text:"\u2069",...Ld(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(O)}return d}u(ZI,"$3c0fc76039f1c516$var$processSegments");function Ld(t,e,n){switch(e){case"era":{let r=t.calendar.getEras();return{value:r.indexOf(t.era),minValue:0,maxValue:r.length-1}}case"year":return{value:t.year,minValue:1,maxValue:t.calendar.getYearsInEra(t)};case"month":return{value:t.month,minValue:LR(t),maxValue:t.calendar.getMonthsInYear(t)};case"day":return{value:t.day,minValue:zR(t),maxValue:t.calendar.getDaysInMonth(t)}}if("hour"in t)switch(e){case"dayPeriod":return{value:t.hour>=12?12:0,minValue:0,maxValue:12};case"hour":if(n.hour12){let r=t.hour>=12;return{value:t.hour,minValue:r?12:0,maxValue:r?23:11}}return{value:t.hour,minValue:0,maxValue:23};case"minute":return{value:t.minute,minValue:0,maxValue:59};case"second":return{value:t.second,minValue:0,maxValue:59}}return{}}u(Ld,"$3c0fc76039f1c516$var$getSegmentLimits");function XI(t,e,n,r){switch(e){case"era":case"year":case"month":case"day":return t.cycle(e,n,{round:e==="year"})}if("hour"in t)switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return t.set({hour:l?i-12:i+12})}case"hour":case"minute":case"second":return t.cycle(e,n,{round:e!=="hour",hourCycle:r.hour12?12:24})}throw new Error("Unknown segment: "+e)}u(XI,"$3c0fc76039f1c516$var$addSegment");function jI(t,e,n,r){switch(e){case"day":case"month":case"year":case"era":return t.set({[e]:n})}if("hour"in t&&typeof n=="number")switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return n>=12===l?t:t.set({hour:l?i-12:i+12})}case"hour":if(r.hour12){let l=t.hour>=12;!l&&n===12&&(n=0),l&&n<12&&(n+=12)}case"minute":case"second":return t.set({[e]:n})}throw new Error("Unknown segment: "+e)}u(jI,"$3c0fc76039f1c516$var$setSegment");function qI(t){var e,n;let r=pi(t),[i,l]=je(t.value,t.defaultValue||null,t.onChange),[a]=(0,wp.element.useState)(i),[o,s]=(0,wp.element.useState)(()=>i||{start:null,end:null});i==null&&o.start&&o.end&&(o={start:null,end:null},s(o));let c=i||o,d=u(R=>{c=R||{start:null,end:null},s(c),ll(c)?l(c):l(null)},"setValue"),f=c?.start||c?.end||t.placeholderValue||null,[h,p]=y0(f,t.granularity),m=h==="hour"||h==="minute"||h==="second";var g;let O=(g=t.shouldCloseOnSelect)!==null&&g!==void 0?g:!0,[b,y]=(0,wp.element.useState)(null),[$,v]=(0,wp.element.useState)(null);c&&ll(c)&&(b=c,"hour"in c.start&&($=c));let S=u((R,L)=>{d({start:"timeZone"in L.start?L.start.set(vt(R.start)):Pn(R.start,L.start),end:"timeZone"in L.end?L.end.set(vt(R.end)):Pn(R.end,L.end)}),y(null),v(null),E.commitValidation()},"commitValue"),x=u(R=>{let L=typeof O=="function"?O():O;m?ll(R)&&(L||$?.start&&$?.end)?S(R,{start:$?.start||Ta(t.placeholderValue),end:$?.end||Ta(t.placeholderValue)}):y(R):ll(R)?(d(R),E.commitValidation()):y(R),L&&r.setOpen(!1)},"setDateRange"),C=u(R=>{ll(b)&&ll(R)?S(b,R):v(R)},"setTimeRange"),Q=(c==null||(e=c.start)===null||e===void 0?void 0:e.calendar.identifier)==="gregory"&&c.start.era==="BC"||(c==null||(n=c.end)===null||n===void 0?void 0:n.calendar.identifier)==="gregory"&&c.end.era==="BC",T=(0,wp.element.useMemo)(()=>({granularity:h,timeZone:p,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:Q}),[h,t.hourCycle,t.shouldForceLeadingZeros,p,t.hideTimeZone,Q]),{minValue:B,maxValue:w,isDateUnavailable:M}=t,A=(0,wp.element.useMemo)(()=>VI(c,B,w,M,T),[c,B,w,M,T]),E=qn({...t,value:i,name:(0,wp.element.useMemo)(()=>[t.startName,t.endName].filter(R=>R!=null),[t.startName,t.endName]),builtinValidation:A}),I=E.displayValidation.isInvalid,D=t.validationState||(I?"invalid":null);var P;return{...E,value:c,defaultValue:(P=t.defaultValue)!==null&&P!==void 0?P:a,setValue:d,dateRange:b,timeRange:$,granularity:h,hasTime:m,setDate(R,L){var k,F;x(R==="start"?{start:L,end:(k=b?.end)!==null&&k!==void 0?k:null}:{start:(F=b?.start)!==null&&F!==void 0?F:null,end:L})},setTime(R,L){var k,F;C(R==="start"?{start:L,end:(k=$?.end)!==null&&k!==void 0?k:null}:{start:(F=$?.start)!==null&&F!==void 0?F:null,end:L})},setDateTime(R,L){var k,F;d(R==="start"?{start:L,end:(k=c?.end)!==null&&k!==void 0?k:null}:{start:(F=c?.start)!==null&&F!==void 0?F:null,end:L})},setDateRange:x,setTimeRange:C,...r,setOpen(R){!R&&!(c?.start&&c?.end)&&ll(b)&&m&&S(b,{start:$?.start||Ta(t.placeholderValue),end:$?.end||Ta(t.placeholderValue)}),r.setOpen(R)},validationState:D,isInvalid:I,formatValue(R,L){if(!c||!c.start||!c.end)return null;let k="timeZone"in c.start?c.start.timeZone:void 0,F=t.granularity||(c.start&&"minute"in c.start?"minute":"day"),N="timeZone"in c.end?c.end.timeZone:void 0,z=t.granularity||(c.end&&"minute"in c.end?"minute":"day"),G=Br(L,{granularity:F,timeZone:k,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,showEra:c.start.calendar.identifier==="gregory"&&c.start.era==="BC"||c.end.calendar.identifier==="gregory"&&c.end.era==="BC"}),le=c.start.toDate(k||"UTC"),ie=c.end.toDate(N||"UTC"),me=new Rt(R,G),ve;if(k===N&&F===z&&c.start.compare(c.end)!==0){try{let ce=me.formatRangeToParts(le,ie),K=-1;for(let ee=0;eeK&&(Z+=ce[ee].value);return{start:W,end:Z}}catch{}ve=me}else{let ce=Br(L,{granularity:z,timeZone:N,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle});ve=new Rt(R,ce)}return{start:me.format(le),end:ve.format(ie)}},getDateFormatter(R,L){let k={...T,...L},F=Br({},k);return new Rt(R,F)}}}u(qI,"$93c38a5e28be6249$export$e50a61c1de9f574");function ll(t){return t?.start!=null&&t.end!=null}u(ll,"$93c38a5e28be6249$var$isCompleteRange");function WI(t){let{placeholderValue:e=new Tr,minValue:n,maxValue:r,defaultValue:i,granularity:l,validate:a}=t,[o,s]=je(t.value,i??null,t.onChange),c=o||e,d=c&&"day"in c?c:void 0,f=i&&"timeZone"in i?i.timeZone:void 0,h=(0,wp.element.useMemo)(()=>{let v=c&&"timeZone"in c?c.timeZone:void 0;return(v||f)&&e?Y3(Aa(e),v||f):Aa(e)},[e,c,f]),p=(0,wp.element.useMemo)(()=>Aa(n,d),[n,d]),m=(0,wp.element.useMemo)(()=>Aa(r,d),[r,d]),g=(0,wp.element.useMemo)(()=>o&&"day"in o?W3(o):o,[o]),O=(0,wp.element.useMemo)(()=>o==null?null:Aa(o),[o]),b=(0,wp.element.useMemo)(()=>i==null?null:Aa(i),[i]);return{...qP({...t,value:O,defaultValue:b,minValue:p,maxValue:m,onChange:u(v=>{s(d||f?v:v&&W3(v))},"onChange"),granularity:l||"minute",maxGranularity:"hour",placeholderValue:h??void 0,createCalendar:()=>new tt,validate:(0,wp.element.useCallback)(()=>a?.(o),[a,o])}),timeValue:g}}u(WI,"$eff5d8ee529ac4bb$export$fd53cef0cc796101");function Aa(t,e=Cr(kr())){return t?"day"in t?t:Pn(e,t):null}u(Aa,"$eff5d8ee529ac4bb$var$convertValue");function YI(t,e){let{cursor:n,getKey:r}=t;return{setSelectedKeys(i){e(l=>({...l,selectedKeys:i}))},addKeysToSelection(i){e(l=>l.selectedKeys==="all"?l:i==="all"?{...l,selectedKeys:"all"}:{...l,selectedKeys:new Set([...l.selectedKeys,...i])})},removeKeysFromSelection(i){e(l=>{if(i==="all")return{...l,selectedKeys:new Set};let a=l.selectedKeys==="all"?new Set(l.items.map(r)):new Set(l.selectedKeys);for(let o of i)a.delete(o);return{...l,selectedKeys:a}})},setFilterText(i){e(l=>({...l,filterText:i}))},insert(i,...l){e(a=>$s(a,i,...l))},insertBefore(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return $s(a,o,...l)})},insertAfter(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return $s(a,o+1,...l)})},prepend(...i){e(l=>$s(l,0,...i))},append(...i){e(l=>$s(l,l.items.length,...i))},remove(...i){e(l=>{let a=new Set(i),o=l.items.filter(c=>!a.has(r(c))),s="all";if(l.selectedKeys!=="all"){s=new Set(l.selectedKeys);for(let c of i)s.delete(c)}return n==null&&o.length===0&&(s=new Set),{...l,items:o,selectedKeys:s}})},removeSelectedItems(){e(i=>{if(i.selectedKeys==="all")return{...i,items:[],selectedKeys:new Set};let l=i.selectedKeys,a=i.items.filter(o=>!l.has(r(o)));return{...i,items:a,selectedKeys:new Set}})},move(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let s=a.items.slice(),[c]=s.splice(o,1);return s.splice(l,0,c),{...a,items:s}})},moveBefore(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return WP(a,c,o)})},moveAfter(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return WP(a,c,o+1)})},update(i,l){e(a=>{let o=a.items.findIndex(s=>r(s)===i);return o===-1?a:{...a,items:[...a.items.slice(0,o),l,...a.items.slice(o+1)]}})}}}u(YI,"$0d86e9c8f07f9a7b$export$79c0c687a5963b0a");function $s(t,e,...n){return{...t,items:[...t.items.slice(0,e),...n,...t.items.slice(e)]}}u($s,"$0d86e9c8f07f9a7b$var$insert");function WP(t,e,n){n-=e.filter(l=>l({from:l,to:n++}));for(let l=0;la&&r[o].from--}for(let l=0;ll;o--){let s=r[o];s.fromf.id||f.key,"getKey"),initialFilterText:a=""}=t;let[o,s]=(0,wp.element.useReducer)(KI,{state:"idle",error:void 0,items:[],selectedKeys:r==="all"?"all":new Set(r),sortDescriptor:i,filterText:a});const c=u(async(f,h)=>{let p=new AbortController;try{s({...f,abortController:p});var m;let b=(m=f.filterText)!==null&&m!==void 0?m:o.filterText;var g;let y=await h({items:o.items.slice(),selectedKeys:o.selectedKeys,sortDescriptor:(g=f.sortDescriptor)!==null&&g!==void 0?g:o.sortDescriptor,signal:p.signal,cursor:f.type==="loadingMore"?o.cursor:void 0,filterText:b,loadingState:o.state});var O;let $=(O=y.filterText)!==null&&O!==void 0?O:b;s({type:"success",...y,abortController:p}),$&&$!==b&&!p.signal.aborted&&c({type:"filtering",filterText:$},e)}catch(b){s({type:"error",error:b,abortController:p})}},"dispatchFetch");let d=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{d.current||(c({type:"loading"},e),d.current=!0)},[]),{items:o.items,selectedKeys:o.selectedKeys,sortDescriptor:o.sortDescriptor,isLoading:o.state==="loading"||o.state==="loadingMore"||o.state==="sorting"||o.state==="filtering",loadingState:o.state,error:o.error,filterText:o.filterText,getItem(f){return o.items.find(h=>l(h)===f)},reload(){c({type:"loading"},e)},loadMore(){o.state==="loading"||o.state==="loadingMore"||o.state==="filtering"||o.cursor==null||c({type:"loadingMore"},e)},sort(f){c({type:"sorting",sortDescriptor:f},n||e)},...YI({...t,getKey:l,cursor:o.cursor},f=>{s({type:"update",updater:f})}),setFilterText(f){c({type:"filtering",filterText:f},e)}}}u(UI,"$f86e6c1ec7da6ebb$export$bc3384a35de93d66");let GI=Math.round(Math.random()*1e10),_I=0;function YP(t){let e=(0,wp.element.useMemo)(()=>t.name||`radio-group-${GI}-${++_I}`,[t.name]);var n;let[r,i]=je(t.value,(n=t.defaultValue)!==null&&n!==void 0?n:null,t.onChange),[l]=(0,wp.element.useState)(r),[a,o]=(0,wp.element.useState)(null),s=qn({...t,value:r}),c=u(h=>{!t.isReadOnly&&!t.isDisabled&&(i(h),s.commitValidation())},"setSelectedValue"),d=s.displayValidation.isInvalid;var f;return{...s,name:e,selectedValue:r,defaultSelectedValue:t.value!==void 0?l:(f=t.defaultValue)!==null&&f!==void 0?f:null,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:t.isDisabled||!1,isReadOnly:t.isReadOnly||!1,isRequired:t.isRequired||!1,validationState:t.validationState||(d?"invalid":null),isInvalid:d}}u(YP,"$a54cdc5c1942b639$export$bca9d026f8e704eb");function HI(t){let{selectionMode:e="single"}=t,n=pi(t),[r,i]=(0,wp.element.useState)(null),l=(0,wp.element.useMemo)(()=>{var v;return t.defaultValue!==void 0?t.defaultValue:e==="single"?(v=t.defaultSelectedKey)!==null&&v!==void 0?v:null:[]},[t.defaultValue,t.defaultSelectedKey,e]),a=(0,wp.element.useMemo)(()=>t.value!==void 0?t.value:e==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,e]),[o,s]=je(a,l,t.onChange),c=e==="single"&&Array.isArray(o)?o[0]:o,d=u(v=>{if(e==="single"){var S,x;let C=Array.isArray(v)?(x=v[0])!==null&&x!==void 0?x:null:v;s(C),C!==c&&((S=t.onSelectionChange)===null||S===void 0||S.call(t,C))}else{let C=[];Array.isArray(v)?C=v:v!=null&&(C=[v]),s(C)}},"setValue"),f=b0({...t,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:(0,wp.element.useMemo)(()=>JI(c),[c]),onSelectionChange:v=>{if(v!=="all"){if(e==="single"){var S;let x=(S=v.values().next().value)!==null&&S!==void 0?S:null;d(x),n.close()}else d([...v]);m.commitValidation()}}}),h=f.selectionManager.firstSelectedKey,p=(0,wp.element.useMemo)(()=>[...f.selectionManager.selectedKeys].map(v=>f.collection.getItem(v)).filter(v=>v!=null),[f.selectionManager.selectedKeys,f.collection]),m=qn({...t,value:Array.isArray(c)&&c.length===0?null:c}),[g,O]=(0,wp.element.useState)(!1),[b]=(0,wp.element.useState)(c);var y,$;return{...m,...f,...n,value:c,defaultValue:l??b,setValue:d,selectedKey:h,setSelectedKey:d,selectedItem:(y=p[0])!==null&&y!==void 0?y:null,selectedItems:p,defaultSelectedKey:($=t.defaultSelectedKey)!==null&&$!==void 0?$:t.selectionMode==="single"?b:null,focusStrategy:r,open(v=null){f.collection.size!==0&&(i(v),n.open())},toggle(v=null){f.collection.size!==0&&(i(v),n.toggle())},isFocused:g,setFocused:O}}u(HI,"$2bc3a590c5373a4e$export$5159ec8b34d4ec12");function JI(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}u(JI,"$2bc3a590c5373a4e$var$convertValue");var eL=Object.defineProperty,tL=u((t,e)=>eL(t,"name",{value:e,configurable:!0}),"n$p");const ws=tL(t=>{const e=t.content??t.children,n=pi(t),{triggerProps:r,overlayProps:i}=cs({type:"dialog"},n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(se,{...r,type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},t.label??"Open modal"),n.isOpen&&wp.element.createElement(PI,{className:"tf-modal",state:n},wp.element.createElement(Os,{title:t.title,...i},e,wp.element.createElement("div",{className:"tf-modal-actions"},wp.element.createElement(se,{type:"danger",onPress:()=>{n.close(),t.onValidate&&t.onValidate()}},t.confirmText??t.label),wp.element.createElement(se,{type:"action",onPress:()=>{n.close(),t.onCancel&&t.onCancel()}},t.cancelText??"Cancel")))))},"ModalTrigger");var nL=Object.defineProperty,rL=u((t,e)=>nL(t,"name",{value:e,configurable:!0}),"s$j");function KP({message:t,type:e,onDismiss:n}){return wp.element.createElement("div",{className:`tf-notice ${e} tf-is-dismissible`},wp.element.createElement("p",null,t),wp.element.createElement("button",{type:"button",className:"tf-notice-dismiss",onClick:n}))}u(KP,"n$o"),rL(KP,"Notice");var iL=Object.defineProperty,lL=u((t,e)=>iL(t,"name",{value:e,configurable:!0}),"i$n");function Rr({children:t,state:e,style:n,className:r="",...i}){const l=wp.element.useRef(null),{popoverProps:a,underlayProps:o}=KN({...i,popoverRef:l},e),s=wp.element.useContext(Oo);return wp.element.createElement(Gk,{portalContainer:s.portalContainer},wp.element.createElement("div",{className:s.wrapper},!i.isNonModal&&wp.element.createElement("div",{...o,className:"tf-underlay"}),wp.element.createElement("div",{...a,ref:l,style:{...a.style,...n,zIndex:1e6,boxSizing:"border-box"},className:`tf-popover ${r}`},t,wp.element.createElement(fs,{onDismiss:e.close}))))}u(Rr,"y$6"),lL(Rr,"Popover");var aL=Object.defineProperty,oL=u((t,e)=>aL(t,"name",{value:e,configurable:!0}),"o$h");const zd=oL(t=>t.choices?wp.element.createElement(iF,{key:t.key??t.name,title:t.label??"",items:t.choices??[]},e=>wp.element.createElement(Qr,{key:e.value??""},e.label??"")):wp.element.createElement(Qr,{key:t.value??""},t.label??""),"RenderChoices");var sL=Object.defineProperty,mi=u((t,e)=>sL(t,"name",{value:e,configurable:!0}),"e$4");const uL=mi(t=>wp.element.createElement("div",{className:"tf-tab-container "+(t.className??"")},t.children),"Container"),cL=mi(t=>wp.element.createElement("div",{className:"tf-tab-header"},wp.element.createElement("div",{className:"tf-tab-items "+(t.className??"")},t.children),t.actions&&wp.element.createElement("div",{className:"tf-tab-actions "+(t.actionsClassName??"")},t.actions)),"Header"),dL=mi(t=>wp.element.createElement("div",{className:"tf-tab-item "+(t.className??""),"data-open":t.isOpen??!1},wp.element.createElement(se,{type:"text-action",onPress:t.onPress},t.children)),"Title"),fL=mi(t=>{const[e,n]=wp.element.useState(t.isActive??!1);if(wp.element.useEffect(()=>{t.isActive!==e&&n(t.isActive)},[t.isActive]),!!e)return wp.element.createElement("div",{className:"tf-tab-content "+(t.className??"")},t.children)},"Content"),hL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row "+(t.className??"")},t.children),"Row"),pL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title tf-tab-row-title-section "+(t.className??"")},t.children),"RowTitle"),mL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title "+(t.className??"")},wp.element.createElement("span",{className:"tf-label"},t.children)),"RowLabel"),gL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-field "+(t.className??"")},t.children),"RowField");var UP=Object.freeze({__proto__:null,Container:uL,Content:fL,Header:cL,Row:hL,RowField:gL,RowLabel:mL,RowTitle:pL,Title:dL}),OL=Object.defineProperty,bL=u((t,e)=>OL(t,"name",{value:e,configurable:!0}),"l$h");const Zd=bL(t=>{const e=`h${t.level??"3"}`,n=t.content??t.children;return wp.element.createElement("div",{className:"tf-title"},wp.element.createElement(e,{className:t.className},n))},"Title");var yL=Object.defineProperty,vL=u((t,e)=>yL(t,"name",{value:e,configurable:!0}),"n$l");const $L=vL(t=>{const e=t.content??t.children,n=t.placement??"top",r=t.theme&&t.theme==="dark"?"dark":"light";return wp.element.createElement("div",{className:`tf-tooltip tf-tooltip-${n}`},wp.element.createElement("div",{className:`tf-tooltip-content tf-tooltip-content-${n} ${r}`},e))},"Tooltip");var wL=Object.defineProperty,GP=u((t,e)=>wL(t,"name",{value:e,configurable:!0}),"n$k");const xL=GP(t=>{const e=t.layout??"button",n=t.label??"Open tooltip",r=t.children??!1;return wp.element.createElement("div",{className:"tf-tooltip-trigger"},wp.element.createElement("div",{className:"tf-tooltip-trigger-content"},r||GP(()=>e==="button"?wp.element.createElement(se,{type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},n):wp.element.createElement("span",null,n),"renderContent")(),wp.element.createElement($L,{...t})))},"TooltipTrigger");var SL=Object.defineProperty,CL=u((t,e)=>SL(t,"name",{value:e,configurable:!0}),"t$b");const kL=CL(({content:t,children:e})=>wp.element.createElement(wp.element.Fragment,null,t??e),"Wrapper");var DL=Object.defineProperty,al=u((t,e)=>DL(t,"name",{value:e,configurable:!0}),"o$e");const _P=al(t=>{const e={},n=["sectionTitle"],r=t.dependent?.callback??!1,i=t.dependent?.callbackData??!1;for(const l in t){if(n.includes(l))continue;const a=t[l];if(a&&typeof a=="object"&&!Array.isArray(a)){const o=_P(a);if(Object.keys(o).length===0)continue;for(const s in o)e[s]||(e[s]={}),e[s][l]={__isWrapped:!0,...o[s]}}if(typeof a=="string")for(const o of JP(a)){const s=EL(o,r,i);s&&(e[s.name]||(e[s.name]={}),e[s.name][l]=s.config)}}return e},"getDependentFields"),PL=al((t=!0)=>t?/(\{\{.+?}\})/g:/\{\{(.+?)}\}/g,"dependentAttributeRegex"),HP=al(t=>JP(t).length>0,"isDependentString"),JP=al((t,e=!0)=>typeof t=="string"?Array.from(t.matchAll(PL(e)),n=>n[1]):[],"getDependentStrings"),EL=al((t,e,n)=>{if(!HP(t))return!1;const r=t.slice(2,t.length-2).trim();if(!r.includes("."))return{name:r,config:{__returnedType:"full",__callback:e,__callbackData:n}};const[i,l]=r.split(".");return{name:i,config:{__returnedType:"partial",__returnedAttribute:l,__callback:e,__callbackData:n}}},"getDependentValue"),eE=al((t,e,n,r,i)=>{const l=e.__returnedType==="partial"?n()?.[e.__returnedAttribute]:n();let a=e.__callback??!1;typeof a=="string"&&(a=J9.dependent.__callbacks[a]??!1);const o=a?a({attribute:t,value:l,...e.__callbackData??{}}):l;return typeof o=="string"&&typeof i=="string"?i.replace(e.__returnedType==="partial"?`{{${r}.${e.__returnedAttribute}}}`:`{{${r}}}`,o):o},"getFieldValue"),TL=al((t,e,n)=>{if(e===!1)return{...t};const r={...t};for(const i in e){const l=e[i];for(const a in l){const o=l[a];if(o.__isWrapped){for(const s in o){if(s==="__isWrapped")continue;const c=eE(s,o[s],()=>n(i),i,r[a][s]);r[a]={...r[a],[s]:c}}continue}r[a]=eE(a,o,()=>n(i),i,r[a])}}return r},"mergeDependentProps");var AL=Object.defineProperty,tE=u((t,e)=>AL(t,"name",{value:e,configurable:!0}),"o$d");const nE=tE(({itemProps:t,refresh:e,data:n,children:r})=>{const i=Object.assign({},t);delete i.value,delete i.onChange,delete i.class,delete i.wrapper;const l=wp.element.useMemo(()=>t.dependent?Object.assign({},_P(t)):!1,[]),a=tE(c=>{!t.dependent||!l||Object.keys(l).includes(c)&&e()},"maybeUpdateProps"),o=wp.element.useCallback(c=>{c.props?.itemType!=="subfield"&&a(c.name)},[]);wp.element.useEffect(()=>{const c=Vo("valueChange",o);return()=>um("valueChange",c)},[o]),wp.element.useEffect(()=>{n.watcher&&n.watcher(c=>{a(c)})},[o]);const s=wp.element.useMemo(()=>TL(i,l,n.getValue),[]);return r(s)},"DependendWrapper");var QL=Object.defineProperty,ML=u((t,e)=>QL(t,"name",{value:e,configurable:!0}),"u$d");const rE=ML(t=>{const e=[];if(t.length===0)return!0;for(const n in t){const r=t[n];if(["_and","_or"].includes(n)){const i=r.map(rE);if(i.length===0){e.push(!1);continue}switch(n){case"_or":e.push(i.filter(Boolean).length>0);break;case"_and":e.push(i.length===i.filter(Boolean).length);break}continue}Object.entries(r).forEach(([i,l])=>{switch(i){case"_eq":e.push(n==l);break;case"_neq":e.push(n!=l);break;case"_lt":e.push(nl);break;case"_lte":e.push(n<=l);break;case"_gte":e.push(n>=l);break;case"_in":e.push(l.includes(n));break;case"_nin":e.push(!l.includes(n));break;case"_contains":e.push(n.includes(l));break;case"_ncontains":e.push(!n.includes(l));break;case"_re":e.push(new RegExp(l).test(n));break;default:e.push(!1)}})}return e.length>0&&e.length===e.filter(Boolean).length},"evaluateCondition");var BL=Object.defineProperty,Xd=u((t,e)=>BL(t,"name",{value:e,configurable:!0}),"i$l");const RL=Xd((t,e)=>(t=typeof t=="object"?iE(t,e):{},rE(t)),"evaluateFieldVisibility"),iE=Xd((t,e)=>{const n={};for(const r in t){if(["_and","_or"].includes(r)){n[r]=t[r].map(l=>iE(l,e));continue}const i=r.includes(".")?VL(r,e):e(r);n[i]=t[r]}return n},"replaceFieldValue"),VL=Xd((t,e)=>{const[n,r]=t.split(".");let i=e(n);if(typeof i=="string")try{i=JSON.parse(i)}catch{return""}return i[r]??""},"getPartialValue"),lE=Xd(t=>{const e=[];for(const n in t){if(["_and","_or"].includes(n)){for(const r in t[n])e.push(lE(t[n][r]));continue}e.push(n)}return e.flat().map(n=>n.split(".")[0])},"getTriggerFields");var NL=Object.defineProperty,aE=u((t,e)=>NL(t,"name",{value:e,configurable:!0}),"o$c");const oE=aE(({visibility:t,data:e,...n})=>{const[r,i]=wp.element.useState(!1),l=aE(()=>{if(!t.condition){i(!0);return}const o=e.getValue??control.getValue,s=RL(t.condition,o);i(t.action!=="hide"?s:!s)},"evaluateVisibility");wp.element.useEffect(()=>{l(),!(!t.condition||!a)&&(Vo("valueChange",o=>{o.props?.itemType!=="subfield"&&a.includes(o.name)&&setTimeout(l)}),e.watcher&&e.watcher(o=>{a.includes(o)&&l()}),Vo("evaluateVisibility",()=>l()))},[]);const a=wp.element.useMemo(()=>t.condition?lE(t.condition):!1,[]);return r?n.children:wp.element.createElement(wp.element.Fragment,null)},"VisibilityWrapper");var FL=Object.defineProperty,jd=u((t,e)=>FL(t,"name",{value:e,configurable:!0}),"r$b");const sE=jd(({children:t,itemType:e,setValue:n=!1,name:r})=>{const[i,l]=wp.element.useState(0),a=jd(()=>l(i+1),"refreshRender"),o=jd(c=>{!r||r!==c.name||(a(),n&&n(c.value))},"fieldValueChanged"),s=jd(c=>{c===r&&a()},"maybeRerender");return wp.element.useEffect(()=>{if(e!=="field")return;const c=Vo("_refreshFieldValue",o),d=Vo("_fieldRerender",s);return()=>{um("_refreshFieldValue",c),um("_fieldRerender",d)}},[i]),wp.element.createElement(wp.element.Fragment,{key:i},t(a))},"RenderWrapper");var IL=Object.defineProperty,LL=u((t,e)=>IL(t,"name",{value:e,configurable:!0}),"i$k");const v0=LL(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Oo),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class,wp.element.useEffect(()=>{n&&n()},[]);const a=Hr.get(r.type??!1,"element");return a?wp.element.createElement(hk,{...l},wp.element.createElement(oE,{visibility:t,data:e},wp.element.createElement(sE,{itemType:r.itemType??"field",name:r.name??!1},o=>wp.element.createElement(nE,{refresh:o,data:e,itemProps:r},s=>wp.element.createElement(a,{...s,data:e}))))):wp.element.createElement(wp.element.Fragment,null)},"Element");var zL=Object.defineProperty,ZL=u((t,e)=>zL(t,"name",{value:e,configurable:!0}),"n$j");const XL=ZL(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?v0:pp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...a,...t})},"Item");var uE={common:{add:"Add item",clone:"Clone",delete:"Remove"},layoutOveride:{advanced:{clone:"Duplicate",delete:"Delete"},tab:{add:"+ Add Item"}}},jL=Object.defineProperty,Vr=u((t,e)=>jL(t,"name",{value:e,configurable:!0}),"l$c");const cE=Vr(t=>{const e=t.fields??[],n=t.layout&&Object.keys(Hr._types.repeater).includes(t.layout)?t.layout:"table",r=Hr.get(n,"repeater"),i=t.repeatable??!0,l=t.maxlength??1/0,a=e.map(S=>{const x=Object.assign({},S);return n==="table"?(x.labelVisuallyHidden=!0,x.descriptionVisuallyHidden=!0):n==="tab"&&(x.labelVisuallyHidden=!0),delete x.value,delete x.onChange,x}),o={};e.forEach(S=>{o[S.name]=t.newItem?t.newItem[S.name]??"":""});const[s,c]=wp.element.useReducer(Y2(o,l,t),t.value??"",S=>K2(S,o)),d=Vr(S=>a.map(x=>x.name??!1).includes(S),"hasField"),[f,h]=wp.element.useState([]),p=Vr((S,x)=>{f.forEach(C=>C(S,x))},"triggerRowCallbackEvents"),m=wp.element.useRef();m.current=s;const g=Vr((S,x,C)=>wp.element.createElement(XL,{key:x.key+C,values:x,config:{...S,repeaterRow:C},onChange:Q=>c({type:"update",item:C,control:S.name,value:Q,callback:()=>p(x.key,S.name)}),data:{getValue:Q=>d(Q)?m.current[C][Q]??"":t.data.getValue(Q??""),watcher:Q=>h(T=>[...T,(B,w)=>{B===x.key&&S.name&&Q(w,x.key)}])}}),"renderItem"),O=Vr(()=>s.map(({_bulkCheckbox:S,...x})=>x),"getSavedValue"),b=Vr(S=>({...uE.common,...uE.layoutOveride[n]??{},...t.strings??{}})[S]??S,"string"),y=Vr(()=>i&&wp.element.createElement("div",{className:"tf-repeater-actions"},wp.element.createElement(se,{type:"action",onPress:()=>c({type:"add"}),isDisabled:l<=s.length},b("add")),wp.element.createElement(ws,{title:"Confirmation",label:"Remove all",isDisabled:s.length<=0,onValidate:()=>c({type:"clear"})},"Are you sure you want to clear all item(s)?")),"renderFooterActions"),$=Vr((S,x,C)=>{const Q=typeof t.parts.actions[S]=="string"?Hr.get(t.parts.actions[S],"element"):t.parts.actions[S];return wp.element.createElement(Q,{dispatch:c,item:x,items:s,...C})},"renderCustomComponent"),v=Vr((S,x,C={})=>{if(!i)return wp.element.createElement(wp.element.Fragment,null);if(t?.parts?.actions?.[S])return $(S,x,C);switch(S){case"delete":return wp.element.createElement(ws,{label:b("delete"),title:"Confirmation",onValidate:()=>c({type:"remove",item:x}),buttonProps:{type:"danger"},...C},"Are you sure you want to remove item ",x+1,"?");case"clone":return wp.element.createElement(se,{type:"action",isDisabled:l<=s.length,onPress:()=>c({type:"clone",item:s[x]}),...C},b("clone"))}},"renderAction");return wp.element.useEffect(()=>t.onChange&&t.onChange(O()),[s]),wp.element.createElement("div",{className:`tf-repeater tf-repeater-${n}`},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(O())}),t.label&&wp.element.createElement(Zd,{level:2,className:"tf-repeater-title"},t.label),wp.element.createElement("div",{className:`tf-repeater-container tf-repeater-${n}-container`},wp.element.createElement(r,{items:s,fields:e,dispatch:c,rowFields:a,headerFields:t.headerFields,renderItem:g,maxLength:i?l:void 0,title:t.sectionTitle??!1,useSwitch:t.useSwitch,useBulk:t.useBulk,afterRow:t.afterRow,beforeRow:t.beforeRow,name:t.name??"",renderFooterActions:y,renderAction:v,parent:t,string:b})))},"Repeater");var qL=Object.defineProperty,dE=u((t,e)=>qL(t,"name",{value:e,configurable:!0}),"o$b");const WL={_eq:"Is",_neq:"Is not",_lt:"Less than",_gt:"Greater than",_lte:"Less than or equal",_gte:"Greater than or equal",_in:"In array",_nin:"Not in array",_contains:"Contains",_ncontains:"Not contain",_re:"Regex"},fE=dE(t=>{const e=t.filter(n=>n.name==="operator")[0]??!1;return!e||typeof e.choices!="object"?"":Object.keys(e.choices)[0]??""},"getInitialOperator"),YL=dE(({dynamic:t,operators:e=void 0,fields:n=void 0})=>n&&n.length>0?n:[{label:"Text",type:"text",name:"left_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0},{label:"Operator",type:"select",name:"operator",choices:e??WL,labelVisuallyHidden:!0},{label:"Text",type:"text",name:"right_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0}],"getFields");var KL=Object.defineProperty,hE=u((t,e)=>KL(t,"name",{value:e,configurable:!0}),"e$2");const UL=hE(t=>wp.element.createElement("div",{className:"tf-conditional-panel-conditions"},wp.element.createElement(cE,{...t,type:"repeater",layout:"bare",afterRow:hE((e,n,r)=>wp.element.createElement("div",{className:"tf-conditional-panel-condition-actions"},wp.element.createElement(se,{type:"action",onPress:()=>r({type:"insert",position:n+1,data:{operator:fE(t.fields)}})},"And"),wp.element.createElement(se,{type:"danger",onPress:()=>r({type:"remove",item:n}),isDisabled:!t.canDelete,contentVisuallyHidden:!0},"Delete condition")),"afterRow"),repeatable:!1})),"ConditionGroup");var GL=Object.defineProperty,xs=u((t,e)=>GL(t,"name",{value:e,configurable:!0}),"i$i");const _L=xs(t=>{const e=wp.element.useMemo(()=>YL(t),[]),n=xs(()=>({key:fi(),data:[{key:fi(),operator:fE(e)}]}),"emptyRow"),r=xs(()=>On(t.value??"",[n()]),"initialValue"),[i,l]=wp.element.useState(r()),[a,o]=wp.element.useState(r());wp.element.useEffect(()=>{t.onChange&&t.onChange(t.useModal?i:a)},[t.useModal?i:a]),wp.element.useEffect(()=>{if(a.length===1)return;const h=a.filter(p=>p.data.length!==0);h.length!==a.length&&o([...h])},[a]);const s=xs(h=>o([...a.slice(0,h),n(),...a.slice(h)]),"insertGroup"),c=xs((h,p)=>{const m=a;m[p].data=h,o([...m])},"updateGroup"),d=t.useModal?ws:wp.element.Fragment,f=t.useModal?{title:"Conditional rules",label:"Open conditional panel",confirmText:"Save",onCancel:()=>{o([...u0(i)])},onValidate:()=>{l([...u0(a)])}}:{};return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(t.useModal?i:a)}),wp.element.createElement("div",{className:"tf-label"},t.label??""),wp.element.createElement(d,{...f},wp.element.createElement("div",{className:"tf-conditional-panel"},wp.element.createElement("div",{className:"tf-conditional-panel-container"},wp.element.createElement("div",{className:"tf-conditional-groups"},a.map((h,p)=>wp.element.createElement("div",{key:h.key,className:"tf-conditional-group"},wp.element.createElement(UL,{canDelete:a.length!==1||h.data.length!==1,value:h.data,onChange:m=>c(m,p),fields:e}),wp.element.createElement("div",{className:"tf-conditional-group-actions"},wp.element.createElement("strong",null,"Or"),wp.element.createElement(se,{type:"primary",onPress:()=>s(p+1)},"Add group")))))))))},"ConditionalPanel");var HL=Object.defineProperty,pE=u((t,e)=>HL(t,"name",{value:e,configurable:!0}),"t$a");const JL=pE(t=>{const[e,n]=wp.element.useState(On(t.value));wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=pE(l=>{n({...e,enabled:l===!0||l==="on"?"on":"off"})},"isEnabled"),i=t.useSwitch?wp.element.createElement("div",{onClick:l=>l.stopPropagation()},wp.element.createElement(Y1,{value:e.enabled??"off",onChange:r,label:"Toggle accordion",labelVisuallyHidden:!0})):null;return wp.element.createElement("div",{className:"tf-accordion"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(e)}),wp.element.createElement(G2,{title:t.title??!1,headerLeft:i,behavior:"hide"},wp.element.createElement(W1,{...t,name:null,fields:t.fields,value:e,onChange:n})))},"Accordion");var ez=Object.defineProperty,tz=u((t,e)=>ez(t,"name",{value:e,configurable:!0}),"t$9");const mE=wp.element.createContext(null),gE=tz(t=>{const e=YP(t),{radioGroupProps:n,labelProps:r,descriptionProps:i}=L2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-radio-group"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("div",{className:"tf-radio-group-container",...n},wp.element.createElement(mE.Provider,{value:e},t.children)),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"RadioGroup");var nz=Object.defineProperty,rz=u((t,e)=>nz(t,"name",{value:e,configurable:!0}),"r$8");const OE=rz(t=>{const e=wp.element.useContext(mE),n=wp.element.useRef(null),{inputProps:r}=I2(t,e,n);return wp.element.createElement("label",{className:"tf-radio"},wp.element.createElement("input",{...r,ref:n}),t.children)},"Radio");var iz=Object.defineProperty,lz=u((t,e)=>iz(t,"name",{value:e,configurable:!0}),"i$g");const az=lz(t=>{const[e,n]=wp.element.useState(t.value??""),r=["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"];return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement("div",{className:"tf-alignment-matrix"},wp.element.createElement(gE,{...t,onChange:n},wp.element.createElement("div",{className:"tf-alignment-matrix-container"},r.map(i=>wp.element.createElement(OE,{key:i,id:i,value:i},wp.element.createElement(gn,null,i))))))},"AlignmentMatrix");var oz=Object.defineProperty,Ss=u((t,e)=>oz(t,"name",{value:e,configurable:!0}),"a$a");const bE=Ss(t=>{if(t.config===!1)return t.children;const{dynamics:e}=yr(),n=wp.element.useRef(),r=wp.element.useRef(),[i,l]=wp.element.useState(!1),[a,o]=wp.element.useState(!1),[s,c]=wp.element.useState({}),[d,f]=wp.element.useState(!1),h=pi({}),{triggerProps:p,overlayProps:m}=cs({type:"dialog"},h,n);wp.element.useEffect(()=>{t.isOpen?h.open():h.close()},[t.isOpen]),wp.element.useEffect(()=>{d!==!1&&(t?.onValueSelection(d),f(!1))},[d]);const g=Ss(T=>{if(!T)return;const B=e.values[T]?.fields;if(l(T),!Array.isArray(B)||B.length===0)return O(T);o(B)},"saveDynamicValue"),O=Ss(T=>{f(t.config.stringify(T,s??!1)),b()},"selectAndClose"),b=Ss(()=>{l(!1),o(!1),c(!1),h.close()},"resetAndClose"),y=wp.element.useMemo(()=>{const T=t.config.getTypes();return t.config.getCategories().map(B=>{const w=e.categories[B],M=Object.keys(e.values).filter(A=>w.values.includes(A)&&T.includes(e.values[A]?.type)).reduce((A,E)=>({...A,[E]:e.values[E].label??E}),{});return{name:w.label,choices:M}}).filter(B=>Object.keys(B.choices).length!==0)},[]),$=wp.element.useRef(s),v=Ss((T,B)=>{c($.current={...s,[T]:B})},"updateSettings"),S=t.buttonType??"outside",x=!(t.readOnly||t.inputMasking)&&(S==="outside"||!t.remove||t.remove.isDisabled),C=!(t.readOnly||t.inputMasking)&&(S==="outside"||t.remove&&t.remove.isDisabled===!1),Q=`tf-dynamic-wrapper tf-dynamic-wrapper-buttons-${S} ${t.className??""}`;return wp.element.createElement("div",{className:Q,"data-dynamic":"true"},t.children,x&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-insert",ref:n,contentVisuallyHidden:S==="inside",...p},"Insert"),C&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-clear",contentVisuallyHidden:S==="inside",...t.remove},"Clear"),h.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover",ref:r,...m},a?wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-form"},wp.element.createElement(Zd,{level:4},"Dynamic value settings"),e.values[i].description&&wp.element.createElement("i",null,e.values[i].description),a.map(T=>wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-field"},wp.element.createElement(pp,{...T,value:s[T.name]??"",onChange:B=>v(T.name,B),visibility:{condition:T.condition?.condition??!1,action:T.condition?.action??"show"},data:{getValue:B=>$.current[B]??""}}))),wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-buttons"},wp.element.createElement(se,{type:"action",onPress:()=>O(i)},"Add"),wp.element.createElement(se,{type:"action",onPress:b},"Close"))):wp.element.createElement(Sh,{choices:y,label:"Select dynamic value to insert",labelVisuallyHidden:!0,autoFocus:!0,showButton:!1,onChange:g,onFocusChange:T=>T?!h.isOpen&&h.open():h.close()}),wp.element.createElement(fs,{onDismiss:h.close})))},"BaseWrapper");var sz=Object.defineProperty,uz=u((t,e)=>sz(t,"name",{value:e,configurable:!0}),"u$a");const Cs=wp.element.forwardRef(({inputProps:t={},...e},n)=>{const[r,i]=wp.element.useState(e.dynamic?e.dynamic.hasValues():!1),l=uz(a=>{const o=e.dynamic.parse(a);return o&&o.type?e.dynamic.getLabel(o.type):""},"getLabel");return wp.element.createElement(bE,{className:"tf-dynamic-field-wrapper",config:e.dynamic??!1,onValueSelection:a=>{i(!0),e.onValueSelection(a)},remove:{isDisabled:r===!1,onPress:()=>{i(!1),e.onValueRemove&&e.onValueRemove()}},buttonType:e.buttonType??"outside",readOnly:e.readOnly??!1},r?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"text",className:"tf-dynamic-value-input",value:l(e.value),disabled:!0}),wp.element.createElement("input",{...t,name:e.name??"",value:e.value??"",type:"hidden",ref:n})):e.children)});let $0=[],yE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t<$0[r])n=r;else if(t>=yE[r])e=r+1;else return!0;if(e==n)return!1}}u(cz,"isExtendingChar");function vE(t){return t>=127462&&t<=127487}u(vE,"isRegionalIndicator");const $E=8205;function dz(t,e,n=!0,r=!0){return(n?wE:fz)(t,e,r)}u(dz,"findClusterBreak$1");function wE(t,e,n){if(e==t.length)return e;e&&xE(t.charCodeAt(e))&&SE(t.charCodeAt(e-1))&&e--;let r=w0(t,e);for(e+=CE(r);e=0&&vE(w0(t,a));)l++,a-=2;if(l%2==0)break;e+=2}else break}return e}u(wE,"nextClusterBreak");function fz(t,e,n){for(;e>0;){let r=wE(t,e-2,n);if(r=56320&&t<57344}u(xE,"surrogateLow$1");function SE(t){return t>=55296&&t<56320}u(SE,"surrogateHigh$1");function CE(t){return t<65536?1:2}u(CE,"codePointSize$1");const vp=class vp{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Qa(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),qd.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Qa(this,e,n);let r=[];return this.decompose(e,n,r,0),qd.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new ol(this),l=new ol(e);for(let a=n,o=n;;){if(i.next(a),l.next(a),a=0,i.lineBreak!=l.lineBreak||i.done!=l.done||i.value!=l.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new ol(this,e)}iterRange(e,n=this.length){return new Yd(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Kd(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?vp.empty:e.length<=32?new Kt(e):qd.from(Kt.split(e,[]))}};u(vp,"Text");let pe=vp;const Dn=class Dn extends pe{constructor(e,n=hz(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let l=0;;l++){let a=this.text[l],o=i+a.length;if((n?r:o)>=e)return new x0(i,o,r,a);i=o+1,r++}}decompose(e,n,r,i){let l=e<=0&&n>=this.length?this:new Dn(kE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=Wd(l.text,a.text.slice(),0,l.length);if(o.length<=32)r.push(new Dn(o,a.length+l.length));else{let s=o.length>>1;r.push(new Dn(o.slice(0,s)),new Dn(o.slice(s)))}}else r.push(l)}replace(e,n,r){if(!(r instanceof Dn))return super.replace(e,n,r);[e,n]=Qa(this,e,n);let i=Wd(this.text,Wd(r.text,kE(this.text,0,e)),n),l=this.length+r.length-(n-e);return i.length<=32?new Dn(i,l):qd.from(Dn.split(i,[]),l)}sliceString(e,n=this.length,r=` +}`.trim(),document.head.prepend(r);let i=u(s=>{if(!(s.touches.length===2||e)){if(!t||t===document.documentElement||t===document.body){s.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&s.preventDefault()}},"onTouchMove"),l=u(s=>{let c=s.target,d=s.relatedTarget;if(d&&ym(d))d.focus({preventScroll:!0}),dk(d,ym(c));else if(!d){var f;let h=(f=c.parentElement)===null||f===void 0?void 0:f.closest("[tabindex]");h?.focus({preventScroll:!0})}},"onBlur"),a=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(s){let c=document.activeElement!=null&&ym(document.activeElement);a.call(this,{...s,preventScroll:!0}),(!s||!s.preventScroll)&&dk(this,c)};let o=vr(Ug(document,"touchstart",n,{passive:!1,capture:!0}),Ug(document,"touchmove",i,{passive:!1,capture:!0}),Ug(document,"blur",l,!0));return()=>{o(),r.remove(),HTMLElement.prototype.focus=a}}u(IN,"$49c51c25361d4cd2$var$preventScrollMobileSafari");function Kg(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}u(Kg,"$49c51c25361d4cd2$var$setStyle");function Ug(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}u(Ug,"$49c51c25361d4cd2$var$addEvent");function dk(t,e){e||!ds?fk(t):ds.addEventListener("resize",()=>fk(t),{once:!0})}u(dk,"$49c51c25361d4cd2$var$scrollIntoViewWhenReady");function fk(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=Yc(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect(),l=n.getBoundingClientRect();if(l.topi.top+n.clientHeight){let a=i.bottom;ds&&(a=Math.min(a,ds.offsetTop+ds.height));let o=l.top-i.top-((a-i.top)/2-l.height/2);r.scrollTo({top:Math.max(0,Math.min(r.scrollHeight-r.clientHeight,r.scrollTop+o)),behavior:"smooth"})}}n=r.parentElement}}u(fk,"$49c51c25361d4cd2$var$scrollIntoView");const LN=(0,wp.element.createContext)({});function zN(){var t;return(t=(0,wp.element.useContext)(LN))!==null&&t!==void 0?t:{}}u(zN,"$96b38030c423d352$export$9fc1347d4195ccb3");const Gg=wp.element.createContext(null);function ZN(t){let{children:e}=t,n=(0,wp.element.useContext)(Gg),[r,i]=(0,wp.element.useState)(0),l=(0,wp.element.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(a=>a+1),n&&n.addModal()},removeModal(){i(a=>a-1),n&&n.removeModal()}}),[n,r]);return wp.element.createElement(Gg.Provider,{value:l},e)}u(ZN,"$f57aed4a881a3485$export$178405afcd8c5eb");function XN(){let t=(0,wp.element.useContext)(Gg);return{modalProviderProps:{"aria-hidden":t&&t.modalCount>0?!0:void 0}}}u(XN,"$f57aed4a881a3485$export$d9aaed4c3ece1bc0");function jN(t){let{modalProviderProps:e}=XN();return wp.element.createElement("div",{"data-overlay-container":!0,...t,...e})}u(jN,"$f57aed4a881a3485$var$OverlayContainerDOM");function hk(t){return wp.element.createElement(ZN,null,wp.element.createElement(jN,t))}u(hk,"$f57aed4a881a3485$export$bf688221f59024e5");var pk={};pk={dismiss:"\u062A\u062C\u0627\u0647\u0644"};var mk={};mk={dismiss:"\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435"};var gk={};gk={dismiss:"Odstranit"};var Ok={};Ok={dismiss:"Luk"};var bk={};bk={dismiss:"Schlie\xDFen"};var yk={};yk={dismiss:"\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7"};var vk={};vk={dismiss:"Dismiss"};var $k={};$k={dismiss:"Descartar"};var wk={};wk={dismiss:"L\xF5peta"};var xk={};xk={dismiss:"Hylk\xE4\xE4"};var Sk={};Sk={dismiss:"Rejeter"};var Ck={};Ck={dismiss:"\u05D4\u05EA\u05E2\u05DC\u05DD"};var kk={};kk={dismiss:"Odbaci"};var Dk={};Dk={dismiss:"Elutas\xEDt\xE1s"};var Pk={};Pk={dismiss:"Ignora"};var Ek={};Ek={dismiss:"\u9589\u3058\u308B"};var Tk={};Tk={dismiss:"\uBB34\uC2DC"};var Ak={};Ak={dismiss:"Atmesti"};var Qk={};Qk={dismiss:"Ner\u0101d\u012Bt"};var Mk={};Mk={dismiss:"Lukk"};var Bk={};Bk={dismiss:"Negeren"};var Rk={};Rk={dismiss:"Zignoruj"};var Vk={};Vk={dismiss:"Descartar"};var Nk={};Nk={dismiss:"Dispensar"};var Fk={};Fk={dismiss:"Revocare"};var Ik={};Ik={dismiss:"\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C"};var Lk={};Lk={dismiss:"Zru\u0161i\u0165"};var zk={};zk={dismiss:"Opusti"};var Zk={};Zk={dismiss:"Odbaci"};var Xk={};Xk={dismiss:"Avvisa"};var jk={};jk={dismiss:"Kapat"};var qk={};qk={dismiss:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438"};var Wk={};Wk={dismiss:"\u53D6\u6D88"};var Yk={};Yk={dismiss:"\u95DC\u9589"};var Kk={};Kk={"ar-AE":pk,"bg-BG":mk,"cs-CZ":gk,"da-DK":Ok,"de-DE":bk,"el-GR":yk,"en-US":vk,"es-ES":$k,"et-EE":wk,"fi-FI":xk,"fr-FR":Sk,"he-IL":Ck,"hr-HR":kk,"hu-HU":Dk,"it-IT":Pk,"ja-JP":Ek,"ko-KR":Tk,"lt-LT":Ak,"lv-LV":Qk,"nb-NO":Mk,"nl-NL":Bk,"pl-PL":Rk,"pt-BR":Vk,"pt-PT":Nk,"ro-RO":Fk,"ru-RU":Ik,"sk-SK":Lk,"sl-SI":zk,"sr-SP":Zk,"sv-SE":Xk,"tr-TR":jk,"uk-UA":qk,"zh-CN":Wk,"zh-TW":Yk};function qN(t){return t&&t.__esModule?t.default:t}u(qN,"$parcel$interopDefault$7");function fs(t){let{onDismiss:e,...n}=t,r=Yt(qN(Kk),"@react-aria/overlays"),i=zn(n,r.format("dismiss")),l=u(()=>{e&&e()},"onClick");return wp.element.createElement(gn,null,wp.element.createElement("button",{...i,tabIndex:-1,onClick:l,style:{width:1,height:1}}))}u(fs,"$86ea4cb521eb2e37$export$2317d149ed6f78c4");const WN=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;let hs=new WeakMap,Nt=[];function _g(t,e){let n=bt(t?.[0]),r=e instanceof n.Element?{root:e}:e;var i;let l=(i=r?.root)!==null&&i!==void 0?i:document.body,a=r?.shouldUseInert&&WN,o=new Set(t),s=new Set,c=u(g=>a&&g instanceof n.HTMLElement?g.inert:g.getAttribute("aria-hidden")==="true","getHidden"),d=u((g,O)=>{a&&g instanceof n.HTMLElement?g.inert=O:O?g.setAttribute("aria-hidden","true"):(g.removeAttribute("aria-hidden"),g instanceof n.HTMLElement&&(g.inert=!1))},"setHidden"),f=u(g=>{for(let $ of g.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))o.add($);let O=u($=>{if(s.has($)||o.has($)||$.parentElement&&s.has($.parentElement)&&$.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let v of o)if($.contains(v))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},"acceptNode"),b=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode:O}),y=O(g);if(y===NodeFilter.FILTER_ACCEPT&&h(g),y!==NodeFilter.FILTER_REJECT){let $=b.nextNode();for(;$!=null;)h($),$=b.nextNode()}},"walk"),h=u(g=>{var O;let b=(O=hs.get(g))!==null&&O!==void 0?O:0;c(g)&&b===0||(b===0&&d(g,!0),s.add(g),hs.set(g,b+1))},"hide");Nt.length&&Nt[Nt.length-1].disconnect(),f(l);let p=new MutationObserver(g=>{for(let O of g)if(O.type==="childList"&&![...o,...s].some(b=>b.contains(O.target)))for(let b of O.addedNodes)(b instanceof HTMLElement||b instanceof SVGElement)&&(b.dataset.liveAnnouncer==="true"||b.dataset.reactAriaTopLayer==="true")?o.add(b):b instanceof Element&&f(b)});p.observe(l,{childList:!0,subtree:!0});let m={visibleNodes:o,hiddenNodes:s,observe(){p.observe(l,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return Nt.push(m),()=>{p.disconnect();for(let g of s){let O=hs.get(g);O!=null&&(O===1?(d(g,!1),hs.delete(g)):hs.set(g,O-1))}m===Nt[Nt.length-1]?(Nt.pop(),Nt.length&&Nt[Nt.length-1].observe()):Nt.splice(Nt.indexOf(m),1)}}u(_g,"$5e3802645cc19319$export$1c3ebcada18427bf");function YN(t){let e=Nt[Nt.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}u(YN,"$5e3802645cc19319$export$1020fa7f77e17884");function KN(t,e){let{triggerRef:n,popoverRef:r,groupRef:i,isNonModal:l,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o,...s}=t,c=s.trigger==="SubmenuTrigger",{overlayProps:d,underlayProps:f}=uk({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!l||c,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o},i??r),{overlayProps:h,arrowProps:p,placement:m,triggerAnchorPoint:g}=RN({...s,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:l&&!c?e.close:null});return ck({isDisabled:l||!e.isOpen}),(0,wp.element.useEffect)(()=>{if(e.isOpen&&r.current){var O,b;return l?YN((O=i?.current)!==null&&O!==void 0?O:r.current):_g([(b=i?.current)!==null&&b!==void 0?b:r.current],{shouldUseInert:!0})}},[l,e.isOpen,r,i]),{popoverProps:ne(d,h),arrowProps:p,underlayProps:f,placement:m,triggerAnchorPoint:g}}u(KN,"$f2f8a6077418541e$export$542a6fd13ac93354");const Uk=wp.element.createContext(null);function Gk(t){let e=fm(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[i,l]=(0,wp.element.useState)(!1),a=(0,wp.element.useMemo)(()=>({contain:i,setContain:l}),[i,l]),{getContainer:o}=zN();if(!t.portalContainer&&o&&(n=o()),!n)return null;let s=t.children;return t.disableFocusManagement||(s=wp.element.createElement($d,{restoreFocus:!0,contain:(t.shouldContainFocus||i)&&!r},s)),s=wp.element.createElement(Uk.Provider,{value:a},wp.element.createElement(yR,null,s)),wp.element.createPortal(s,n)}u(Gk,"$337b884510726a0d$export$c6fdb837b070b4ff");function _k(){let t=(0,wp.element.useContext)(Uk),e=t?.setContain;Pe(()=>{e?.(!0)},[e])}u(_k,"$337b884510726a0d$export$14c98a7594375490");function UN(t,e,n){let{overlayProps:r,underlayProps:i}=uk({...t,isOpen:e.isOpen,onClose:e.close},n);return ck({isDisabled:!e.isOpen}),_k(),(0,wp.element.useEffect)(()=>{if(e.isOpen&&n.current)return _g([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:ne(r),underlayProps:i}}u(UN,"$8ac8429251c45e4b$export$dbc0f175b25fb0fb");const Qd=new WeakMap;function GN(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}u(GN,"$b1f0cad8af73213b$var$normalizeKey");function Hk(t,e){let n=Qd.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${GN(e)}`}u(Hk,"$b1f0cad8af73213b$export$9145995848b05025");function Hg(t){return qc()?t.altKey:t.ctrlKey}u(Hg,"$feb5ffebff200149$export$d3e3bd3e26688c04");function Md(t,e){var n,r;let i=`[data-key="${CSS.escape(String(e))}"]`,l=(n=t.current)===null||n===void 0?void 0:n.dataset.collection;return l&&(i=`[data-collection="${CSS.escape(l)}"]${i}`),(r=t.current)===null||r===void 0?void 0:r.querySelector(i)}u(Md,"$feb5ffebff200149$export$c3d8340acf92597f");const Jk=new WeakMap;function _N(t){let e=Ie();return Jk.set(t,e),e}u(_N,"$feb5ffebff200149$export$881eb0d9f3605d9d");function HN(t){return Jk.get(t)}u(HN,"$feb5ffebff200149$export$6aeb1680a0ae8741");const JN=1e3;function eD(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,i=(0,wp.element.useRef)({search:"",timeout:void 0}).current,l=u(a=>{let o=eF(a.key);if(!(!o||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target)||i.search.length===0&&o===" ")){if(o===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=o,e.getKeyForSearch!=null){let s=e.getKeyForSearch(i.search,n.focusedKey);s==null&&(s=e.getKeyForSearch(i.search)),s!=null&&(n.setFocusedKey(s),r&&r(s))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},JN)}},"onKeyDown");return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?l:void 0}}}u(eD,"$fb3050f43d946246$export$e32c88dfddc6e1d8");function eF(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}u(eF,"$fb3050f43d946246$var$getStringForKey");function tD(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:l=!1,disallowEmptySelection:a=!1,disallowSelectAll:o=!1,escapeKeyBehavior:s="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:h=!1,isVirtualized:p,scrollRef:m=r,linkBehavior:g="action"}=t,{direction:O}=Re(),b=Wc(),y=u(P=>{var R;if(P.altKey&&P.key==="Tab"&&P.preventDefault(),!(!((R=r.current)===null||R===void 0)&&R.contains(P.target)))return;const L=u((Z,ee)=>{if(Z!=null){if(e.isLink(Z)&&g==="selection"&&c&&!Hg(P)){(0,wp.element.flushSync)(()=>{e.setFocusedKey(Z,ee)});let De=Md(r,Z),qt=e.getItemProps(Z);De&&b.open(De,P,qt.href,qt.routerOptions);return}if(e.setFocusedKey(Z,ee),e.isLink(Z)&&g==="override")return;P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&!Hg(P)&&e.replaceSelection(Z)}},"navigateToKey");switch(P.key){case"ArrowDown":if(n.getKeyBelow){var k,F,N;let Z=e.focusedKey!=null?(k=n.getKeyBelow)===null||k===void 0?void 0:k.call(n,e.focusedKey):(F=n.getFirstKey)===null||F===void 0?void 0:F.call(n);Z==null&&l&&(Z=(N=n.getFirstKey)===null||N===void 0?void 0:N.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowUp":if(n.getKeyAbove){var z,G,le;let Z=e.focusedKey!=null?(z=n.getKeyAbove)===null||z===void 0?void 0:z.call(n,e.focusedKey):(G=n.getLastKey)===null||G===void 0?void 0:G.call(n);Z==null&&l&&(Z=(le=n.getLastKey)===null||le===void 0?void 0:le.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowLeft":if(n.getKeyLeftOf){var ie,me,ve;let Z=e.focusedKey!=null?(ie=n.getKeyLeftOf)===null||ie===void 0?void 0:ie.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(me=n.getFirstKey)===null||me===void 0?void 0:me.call(n,e.focusedKey):(ve=n.getLastKey)===null||ve===void 0?void 0:ve.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var ce,K,W;let Z=e.focusedKey!=null?(ce=n.getKeyRightOf)===null||ce===void 0?void 0:ce.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(K=n.getLastKey)===null||K===void 0?void 0:K.call(n,e.focusedKey):(W=n.getFirstKey)===null||W===void 0?void 0:W.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getFirstKey(e.focusedKey,ca(P));e.setFocusedKey(Z),Z!=null&&(ca(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getLastKey(e.focusedKey,ca(P));e.setFocusedKey(Z),Z!=null&&(ca(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let Z=n.getKeyPageBelow(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let Z=n.getKeyPageAbove(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"a":ca(P)&&e.selectionMode==="multiple"&&o!==!0&&(P.preventDefault(),e.selectAll());break;case"Escape":s==="clearSelection"&&!a&&e.selectedKeys.size!==0&&(P.stopPropagation(),P.preventDefault(),e.clearSelection());break;case"Tab":if(!h){if(P.shiftKey)r.current.focus();else{let Z=ut(r.current,{tabbable:!0}),ee,De;do De=Z.lastChild(),De&&(ee=De);while(De);ee&&!ee.contains(document.activeElement)&&Bt(ee)}break}}},"onKeyDown"),$=(0,wp.element.useRef)({top:0,left:0});un(m,"scroll",p?void 0:()=>{var P,R,L,k;$.current={top:(L=(P=m.current)===null||P===void 0?void 0:P.scrollTop)!==null&&L!==void 0?L:0,left:(k=(R=m.current)===null||R===void 0?void 0:R.scrollLeft)!==null&&k!==void 0?k:0}});let v=u(P=>{if(e.isFocused){P.currentTarget.contains(P.target)||e.setFocused(!1);return}if(P.currentTarget.contains(P.target)){if(e.setFocused(!0),e.focusedKey==null){var R,L;let N=u(G=>{G!=null&&(e.setFocusedKey(G),c&&!e.isSelected(G)&&e.replaceSelection(G))},"navigateToKey"),z=P.relatedTarget;var k,F;z&&P.currentTarget.compareDocumentPosition(z)&Node.DOCUMENT_POSITION_FOLLOWING?N((k=e.lastSelectedKey)!==null&&k!==void 0?k:(R=n.getLastKey)===null||R===void 0?void 0:R.call(n)):N((F=e.firstSelectedKey)!==null&&F!==void 0?F:(L=n.getFirstKey)===null||L===void 0?void 0:L.call(n))}else!p&&m.current&&(m.current.scrollTop=$.current.top,m.current.scrollLeft=$.current.left);if(e.focusedKey!=null&&m.current){let N=Md(r,e.focusedKey);N instanceof HTMLElement&&(!N.contains(document.activeElement)&&!f&&Bt(N),Zo()==="keyboard"&&Kc(N,{containingElement:r.current}))}}},"onFocus"),S=u(P=>{P.currentTarget.contains(P.relatedTarget)||e.setFocused(!1)},"onBlur"),x=(0,wp.element.useRef)(!1);un(r,KB,f?P=>{let{detail:R}=P;P.stopPropagation(),e.setFocused(!0),R?.focusStrategy==="first"&&(x.current=!0)}:void 0);let C=Me(()=>{var P,R;let L=(R=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&R!==void 0?R:null;if(L==null){let k=Ke();Nw(r.current),Eg(k,null),e.collection.size>0&&(x.current=!1)}else e.setFocusedKey(L),x.current=!1});e3(()=>{x.current&&C()},[e.collection,C]);let Q=Me(()=>{e.collection.size>0&&(x.current=!1)});e3(()=>{Q()},[e.focusedKey,Q]),un(r,YB,f?P=>{var R;P.stopPropagation(),e.setFocused(!1),!((R=P.detail)===null||R===void 0)&&R.clearFocusKey&&e.setFocusedKey(null)}:void 0);const T=(0,wp.element.useRef)(i),B=(0,wp.element.useRef)(!1);(0,wp.element.useEffect)(()=>{if(T.current){var P,R;let F=null;var L;i==="first"&&(F=(L=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&L!==void 0?L:null);var k;i==="last"&&(F=(k=(R=n.getLastKey)===null||R===void 0?void 0:R.call(n))!==null&&k!==void 0?k:null);let N=e.selectedKeys;if(N.size){for(let z of N)if(e.canSelectItem(z)){F=z;break}}e.setFocused(!0),e.setFocusedKey(F),F==null&&!f&&r.current&&Ki(r.current),e.collection.size>0&&(T.current=!1,B.current=!0)}});let w=(0,wp.element.useRef)(e.focusedKey),M=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==w.current||B.current)&&m.current&&r.current){let P=Zo(),R=Md(r,e.focusedKey);if(!(R instanceof HTMLElement))return;(P==="keyboard"||B.current)&&(M.current&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame(()=>{m.current&&(r3(m.current,R),P!=="virtual"&&Kc(R,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&w.current!=null&&r.current&&Ki(r.current),w.current=e.focusedKey,B.current=!1}),(0,wp.element.useEffect)(()=>()=>{M.current&&cancelAnimationFrame(M.current)},[]),un(r,"react-aria-focus-scope-restore",P=>{P.preventDefault(),e.setFocused(!0)});let A={onKeyDown:y,onFocus:v,onBlur:S,onMouseDown(P){m.current===P.target&&P.preventDefault()}},{typeSelectProps:E}=eD({keyboardDelegate:n,selectionManager:e});d||(A=ne(E,A));let I;f||(I=e.focusedKey==null?0:-1);let D=_N(e.collection);return{collectionProps:ne(A,{tabIndex:I,"data-collection":D})}}u(tD,"$ae20dd8cbca75726$export$d6daf82dcd84e87c");function tF(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:l,shouldUseVirtualFocus:a,focus:o,isDisabled:s,onAction:c,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,h=Wc();e=Ie(e);let p=u(k=>{if(k.pointerType==="keyboard"&&Hg(k))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&i.current){let F=n.getItemProps(r);h.open(i.current,k,F.href,F.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):k&&k.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||k&&(ca(k)||k.pointerType==="touch"||k.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}},"onSelect");(0,wp.element.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(a?Nw(i.current):o?o():document.activeElement!==i.current&&i.current&&Ki(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,a]),s=s||n.isDisabled(r);let m={};!a&&!s?m={tabIndex:r===n.focusedKey?0:-1,onFocus(k){k.target===i.current&&n.setFocusedKey(r)}}:s&&(m.onMouseDown=k=>{k.preventDefault()});let g=n.isLink(r)&&f==="override",O=c&&t.UNSTABLE_itemBehavior==="action",b=n.isLink(r)&&f!=="selection"&&f!=="none",y=!s&&n.canSelectItem(r)&&!g&&!O,$=(c||b)&&!s,v=$&&(n.selectionBehavior==="replace"?!y:!y||n.isEmpty),S=$&&y&&n.selectionBehavior==="replace",x=v||S,C=(0,wp.element.useRef)(null),Q=x&&y,T=(0,wp.element.useRef)(!1),B=(0,wp.element.useRef)(!1),w=n.getItemProps(r),M=u(k=>{if(c){var F;c(),(F=i.current)===null||F===void 0||F.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}b&&i.current&&h.open(i.current,k,w.href,w.routerOptions)},"performAction"),A={ref:i};if(l?(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,k.pointerType==="keyboard"&&(!x||rD())&&p(k)},d?(A.onPressUp=v?void 0:k=>{k.pointerType==="mouse"&&y&&p(k)},A.onPress=v?M:k=>{k.pointerType!=="keyboard"&&k.pointerType!=="mouse"&&y&&p(k)}):A.onPress=k=>{if(v||S&&k.pointerType!=="mouse"){if(k.pointerType==="keyboard"&&!nD())return;M(k)}else k.pointerType!=="keyboard"&&y&&p(k)}):(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,B.current=v,y&&(k.pointerType==="mouse"&&!v||k.pointerType==="keyboard"&&(!$||rD()))&&p(k)},A.onPress=k=>{(k.pointerType==="touch"||k.pointerType==="pen"||k.pointerType==="virtual"||k.pointerType==="keyboard"&&x&&nD()||k.pointerType==="mouse"&&B.current)&&(x?M(k):y&&p(k))}),m["data-collection"]=HN(n.collection),m["data-key"]=r,A.preventFocusOnPress=a,a&&(A=ne(A,{onPressStart(k){k.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(k){k.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),w)for(let k of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])w[k]&&(A[k]=vr(A[k],w[k]));let{pressProps:E,isPressed:I}=Zn(A),D=S?k=>{C.current==="mouse"&&(k.stopPropagation(),k.preventDefault(),M(k))}:void 0,{longPressProps:P}=D3({isDisabled:!Q,onLongPress(k){k.pointerType==="touch"&&(p(k),n.setSelectionBehavior("toggle"))}}),R=u(k=>{C.current==="touch"&&T.current&&k.preventDefault()},"onDragStartCapture"),L=f!=="none"&&n.isLink(r)?k=>{ji.isOpening||k.preventDefault()}:void 0;return{itemProps:ne(m,y||v||a&&!s?E:{},Q?P:{},{onDoubleClick:D,onDragStartCapture:R,onClick:L,id:e},a?{onMouseDown:k=>k.preventDefault()}:void 0),isPressed:I,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:s,allowsSelection:y,hasAction:x}}u(tF,"$880e95eb8b93ba9a$export$ecf600387e221c37");function nD(){let t=window.event;return t?.key==="Enter"}u(nD,"$880e95eb8b93ba9a$var$isActionKey");function rD(){let t=window.event;return t?.key===" "||t?.code==="Space"}u(rD,"$880e95eb8b93ba9a$var$isSelectionKey");const bv=class bv{getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?Md(this.ref,e):null;if(!r)return null;let i=n.getBoundingClientRect(),l=r.getBoundingClientRect();return{x:l.left-i.left-n.clientLeft+n.scrollLeft,y:l.top-i.top-n.clientTop+n.scrollTop,width:l.width,height:l.height}}getContentSize(){let e=this.ref.current;var n,r;return{width:(n=e?.scrollWidth)!==null&&n!==void 0?n:0,height:(r=e?.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let e=this.ref.current;var n,r,i,l;return{x:(n=e?.scrollLeft)!==null&&n!==void 0?n:0,y:(r=e?.scrollTop)!==null&&r!==void 0?r:0,width:(i=e?.clientWidth)!==null&&i!==void 0?i:0,height:(l=e?.clientHeight)!==null&&l!==void 0?l:0}}constructor(e){this.ref=e}};u(bv,"$657e4dc4a6e88df0$export$8f5ed9ff9f511381");let Bd=bv;const yv=class yv{isDisabled(e){var n;return this.disabledBehavior==="all"&&(((n=e.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,n){let r=e;for(;r!=null;){let i=this.collection.getItem(r);if(i?.type==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(e){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(e){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(e,n,r){let i=e,l=this.layoutDelegate.getItemRect(i);if(!l||i==null)return null;let a=l;do{if(i=n(i),i==null)break;l=this.layoutDelegate.getItemRect(i)}while(l&&r(a,l)&&i!=null);return i}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,n){return n?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!ua(n))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let l=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let l=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!ua(n))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let l=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xl||new ps({collection:n,disabledKeys:r,disabledBehavior:s,ref:i,collator:o,layoutDelegate:a}),[l,a,n,r,i,o,s]),{collectionProps:d}=tD({...t,ref:i,selectionManager:e,keyboardDelegate:c});return{listProps:d}}u(nF,"$982254629710d113$export$b95089534ab7c1fd");function iD(t,e,n){let r=yt(t,{labelable:!0}),i=t.selectionBehavior||"toggle",l=t.linkBehavior||(i==="replace"?"action":"override");i==="toggle"&&l==="action"&&(l="override");let{listProps:a}=nF({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:l}),{focusWithinProps:o}=Wt({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),s=Ie(t.id);Qd.set(e,{id:s,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:l,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:c,fieldProps:d}=kd({...t,id:s,labelElementType:"span"});return{labelProps:c,listBoxProps:ne(r,o,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...ne(d,a)})}}u(iD,"$c132121280ec012d$export$50eacbbf140a3141");function lD(t){return null}u(lD,"$c1d7fb2ec91bae71$var$Item"),lD.getCollectionNode=u(function*(e,n){let{childItems:r,title:i,children:l}=e,a=e.title||e.children,o=e.textValue||(typeof a=="string"?a:"")||e["aria-label"]||"";!o&&!n?.suppressTextValueWarning&&process.env.NODE_ENV!=="production"&&console.warn(" with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:e,rendered:a,textValue:o,"aria-label":e["aria-label"],hasChildNodes:rF(e),*childNodes(){if(r)for(let s of r)yield{type:"item",value:s};else if(i){let s=[];wp.element.Children.forEach(l,c=>{s.push({type:"item",element:c})}),yield*s}}}},"getCollectionNode");function rF(t){return t.hasChildItems!=null?t.hasChildItems:!!(t.childItems||t.title&&wp.element.Children.count(t.children)>0)}u(rF,"$c1d7fb2ec91bae71$var$hasChildItems");let Qr=lD;function aD(t){return null}u(aD,"$9fc4852771d079eb$var$Section"),aD.getCollectionNode=u(function*(e){let{children:n,title:r,items:i}=e;yield{type:"section",props:e,hasChildNodes:!0,rendered:r,"aria-label":e["aria-label"],*childNodes(){if(typeof n=="function"){if(!i)throw new Error("props.children was a function but props.items is missing");for(let l of i)yield{type:"item",value:l,renderer:n}}else{let l=[];wp.element.Children.forEach(n,a=>{l.push({type:"item",element:a})}),yield*l}}}},"getCollectionNode");let iF=aD;const vv=class vv{build(e,n){return this.context=n,oD(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(wp.element.isValidElement(n)&&n.type===wp.element.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let l of r)yield*this.getFullNode({value:l,index:i},{renderer:n}),i++}else{let i=[];wp.element.Children.forEach(n,a=>{a&&i.push(a)});let l=0;for(let a of i){let o=this.getFullNode({element:a,index:l},{});for(let s of o)l++,yield s}}}getKey(e,n,r,i){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let l=n.value;if(l!=null){var a;let o=(a=l.key)!==null&&a!==void 0?a:l.id;if(o==null)throw new Error("No key found for item");return o}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,i){if(wp.element.isValidElement(e.element)&&e.element.type===wp.element.Fragment){let O=[];wp.element.Children.forEach(e.element.props.children,y=>{O.push(y)});var l;let b=(l=e.index)!==null&&l!==void 0?l:0;for(const y of O)yield*this.getFullNode({element:y,index:b++},n,r,i);return}let a=e.element;if(!a&&e.value&&n&&n.renderer){let O=this.cache.get(e.value);if(O&&(!O.shouldInvalidate||!O.shouldInvalidate(this.context))){O.index=e.index,O.parentKey=i?i.key:null,yield O;return}a=n.renderer(e.value)}if(wp.element.isValidElement(a)){let O=a.type;if(typeof O!="function"&&typeof O.getCollectionNode!="function"){let v=a.type;throw new Error(`Unknown element <${v}> in collection.`)}let b=O.getCollectionNode(a.props,this.context);var o;let y=(o=e.index)!==null&&o!==void 0?o:0,$=b.next();for(;!$.done&&$.value;){let v=$.value;e.index=y;var s;let S=(s=v.key)!==null&&s!==void 0?s:null;S==null&&(S=v.element?null:this.getKey(a,e,n,r));let C=[...this.getFullNode({...v,key:S,index:y,wrapper:lF(e.wrapper,v.wrapper)},this.getChildState(n,v),r?`${r}${a.key}`:a.key,i)];for(let Q of C){var c,d;Q.value=(d=(c=v.value)!==null&&c!==void 0?c:e.value)!==null&&d!==void 0?d:null,Q.value&&this.cache.set(Q.value,Q);var f;if(e.type&&Q.type!==e.type)throw new Error(`Unsupported type <${e0(Q.type)}> in <${e0((f=i?.type)!==null&&f!==void 0?f:"unknown parent type")}>. Only <${e0(e.type)}> is supported.`);y++,yield Q}$=b.next(C)}return}if(e.key==null||e.type==null)return;let h=this;var p,m;let g={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:(p=e.value)!==null&&p!==void 0?p:null,level:i?i.level+1:0,index:e.index,rendered:e.rendered,textValue:(m=e.textValue)!==null&&m!==void 0?m:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:oD(function*(){if(!e.hasChildNodes||!e.childNodes)return;let O=0;for(let b of e.childNodes()){b.key!=null&&(b.key=`${g.key}${b.key}`);let y=h.getFullNode({...b,index:O},h.getChildState(n,b),g.key,g);for(let $ of y)O++,yield $}})};yield g}constructor(){this.cache=new WeakMap}};u(vv,"$eb2240fc39a57fa5$export$bf788dd355e3a401");let Jg=vv;function oD(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}u(oD,"$eb2240fc39a57fa5$var$iterable");function lF(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}u(lF,"$eb2240fc39a57fa5$var$compose");function e0(t){return t[0].toUpperCase()+t.slice(1)}u(e0,"$eb2240fc39a57fa5$var$capitalize");function aF(t,e,n){let r=(0,wp.element.useMemo)(()=>new Jg,[]),{children:i,items:l,collection:a}=t;return(0,wp.element.useMemo)(()=>{if(a)return a;let s=r.build({children:i,items:l},n);return e(s)},[r,i,l,a,n,e])}u(aF,"$7613b1592d41b092$export$6cd28814d92fa9c9");function Rd(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}u(Rd,"$c5a24bc478652b5f$export$1005530eda016c13");function oF(t){return sF(t,0)}u(oF,"$c5a24bc478652b5f$export$fbdeaa6a76694f71");function sF(t,e){if(e<0)return;let n=0;for(let r of t){if(n===e)return r;n++}}u(sF,"$c5a24bc478652b5f$export$5f3398f8733f90e2");function t0(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...sD(t,e),e],i=[...sD(t,n),n],l=r.slice(0,i.length).findIndex((a,o)=>a!==i[o]);return l!==-1?(e=r[l],n=i[l],e.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===e)>=0,-1)}u(t0,"$c5a24bc478652b5f$export$8c434b3a7a4dad6");function sD(t,e){let n=[],r=e;for(;r?.parentKey!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}u(sD,"$c5a24bc478652b5f$var$getAncestors");const uD=new WeakMap;function cD(t){let e=uD.get(t);if(e!=null)return e;let n=0,r=u(i=>{for(let l of i)l.type==="section"?r(Rd(l,t)):l.type==="item"&&n++},"countItems");return r(t),uD.set(t,n),n}u(cD,"$453cc9f0df89c0a5$export$77d5aafae4e095b2");function uF(t,e,n){var r,i;let{key:l}=t,a=Qd.get(e);var o;let s=(o=t.isDisabled)!==null&&o!==void 0?o:e.selectionManager.isDisabled(l);var c;let d=(c=t.isSelected)!==null&&c!==void 0?c:e.selectionManager.isSelected(l);var f;let h=(f=t.shouldSelectOnPressUp)!==null&&f!==void 0?f:a?.shouldSelectOnPressUp;var p;let m=(p=t.shouldFocusOnHover)!==null&&p!==void 0?p:a?.shouldFocusOnHover;var g;let O=(g=t.shouldUseVirtualFocus)!==null&&g!==void 0?g:a?.shouldUseVirtualFocus;var b;let y=(b=t.isVirtualized)!==null&&b!==void 0?b:a?.isVirtualized,$=sa(),v=sa(),S={role:"option","aria-disabled":s||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?d:void 0};wr()&&mm()||(S["aria-label"]=t["aria-label"],S["aria-labelledby"]=$,S["aria-describedby"]=v);let x=e.collection.getItem(l);if(y){let P=Number(x?.index);S["aria-posinset"]=Number.isNaN(P)?void 0:P+1,S["aria-setsize"]=cD(e.collection)}let C=a?.onAction?()=>{var P;return a==null||(P=a.onAction)===null||P===void 0?void 0:P.call(a,l)}:void 0,Q=Hk(e,l),{itemProps:T,isPressed:B,isFocused:w,hasAction:M,allowsSelection:A}=tF({selectionManager:e.selectionManager,key:l,ref:n,shouldSelectOnPressUp:h,allowsDifferentPressOrigin:h&&m,isVirtualized:y,shouldUseVirtualFocus:O,isDisabled:s,onAction:C||!(x==null||(r=x.props)===null||r===void 0)&&r.onAction?vr(x==null||(i=x.props)===null||i===void 0?void 0:i.onAction,C):void 0,linkBehavior:a?.linkBehavior,UNSTABLE_itemBehavior:a?.UNSTABLE_itemBehavior,id:Q}),{hoverProps:E}=$R({isDisabled:s||!m,onHoverStart(){nd()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l))}}),I=yt(x?.props);delete I.id;let D=LB(x?.props);return{optionProps:{...S,...ne(I,T,E,D),id:Q},labelProps:{id:$},descriptionProps:{id:v},isFocused:w,isFocusVisible:w&&e.selectionManager.isFocused&&nd(),isSelected:d,isDisabled:s,isPressed:B,allowsSelection:A,hasAction:M}}u(uF,"$293f70390ea03370$export$497855f14858aa34");function cF(t){let{heading:e,"aria-label":n}=t,r=Ie();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}u(cF,"$af383d3bef1cfdc9$export$c3f9f39876e4bc7");var dD={};dD={longPressMessage:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u0627\u064B \u0623\u0648 \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 Alt + \u0627\u0644\u0633\u0647\u0645 \u0644\u0623\u0633\u0641\u0644 \u0644\u0641\u062A\u062D \u0627\u0644\u0642\u0627\u0626\u0645\u0629"};var fD={};fD={longPressMessage:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E \u0438\u043B\u0438 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Alt+ \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u0434\u043E\u043B\u0443, \u0437\u0430 \u0434\u0430 \u043E\u0442\u0432\u043E\u0440\u0438\u0442\u0435 \u043C\u0435\u043D\u044E\u0442\u043E"};var hD={};hD={longPressMessage:"Dlouh\xFDm stiskem nebo stisknut\xEDm kl\xE1ves Alt + \u0161ipka dol\u016F otev\u0159ete nab\xEDdku"};var pD={};pD={longPressMessage:"Langt tryk eller tryk p\xE5 Alt + pil ned for at \xE5bne menuen"};var mD={};mD={longPressMessage:"Dr\xFCcken Sie lange oder dr\xFCcken Sie Alt + Nach-unten, um das Men\xFC zu \xF6ffnen"};var gD={};gD={longPressMessage:"\u03A0\u03B9\u03AD\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03AE \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 Alt + \u03BA\u03AC\u03C4\u03C9 \u03B2\u03AD\u03BB\u03BF\u03C2 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B1\u03BD\u03BF\u03AF\u03BE\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BC\u03B5\u03BD\u03BF\u03CD"};var OD={};OD={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var bD={};bD={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xFA"};var yD={};yD={longPressMessage:"Men\xFC\xFC avamiseks vajutage pikalt v\xF5i vajutage klahve Alt + allanool"};var vD={};vD={longPressMessage:"Avaa valikko painamalla pohjassa tai n\xE4pp\xE4inyhdistelm\xE4ll\xE4 Alt + Alanuoli"};var $D={};$D={longPressMessage:"Appuyez de mani\xE8re prolong\xE9e ou appuyez sur Alt\xA0+\xA0Fl\xE8che vers le bas pour ouvrir le menu."};var wD={};wD={longPressMessage:"\u05DC\u05D7\u05E5 \u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05D0\u05D5 \u05D4\u05E7\u05E9 Alt + ArrowDown \u05DB\u05D3\u05D9 \u05DC\u05E4\u05EA\u05D5\u05D7 \u05D0\u05EA \u05D4\u05EA\u05E4\u05E8\u05D9\u05D8"};var xD={};xD={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var SD={};SD={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele ny\xEDl gombot a men\xFC megnyit\xE1s\xE1hoz"};var CD={};CD={longPressMessage:"Premere a lungo o premere Alt + Freccia gi\xF9 per aprire il menu"};var kD={};kD={longPressMessage:"\u9577\u62BC\u3057\u307E\u305F\u306F Alt+\u4E0B\u77E2\u5370\u30AD\u30FC\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u958B\u304F"};var DD={};DD={longPressMessage:"\uAE38\uAC8C \uB204\uB974\uAC70\uB098 Alt + \uC544\uB798\uCABD \uD654\uC0B4\uD45C\uB97C \uB20C\uB7EC \uBA54\uB274 \uC5F4\uAE30"};var PD={};PD={longPressMessage:"Nor\u0117dami atidaryti meniu, nuspaud\u0119 palaikykite arba paspauskite \u201EAlt + ArrowDown\u201C."};var ED={};ED={longPressMessage:"Lai atv\u0113rtu izv\u0113lni, turiet nospiestu vai nospiediet tausti\u0146u kombin\u0101ciju Alt + lejupv\u0113rst\u0101 bulti\u0146a"};var TD={};TD={longPressMessage:"Langt trykk eller trykk Alt + PilNed for \xE5 \xE5pne menyen"};var AD={};AD={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var QD={};QD={longPressMessage:"Naci\u015Bnij i przytrzymaj lub naci\u015Bnij klawisze Alt + Strza\u0142ka w d\xF3\u0142, aby otworzy\u0107 menu"};var MD={};MD={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var BD={};BD={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var RD={};RD={longPressMessage:"Ap\u0103sa\u021Bi lung sau ap\u0103sa\u021Bi pe Alt + s\u0103geat\u0103 \xEEn jos pentru a deschide meniul"};var VD={};VD={longPressMessage:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0438\u043B\u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 Alt + \u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E"};var ND={};ND={longPressMessage:"Ponuku otvor\xEDte dlh\xFDm stla\u010Den\xEDm alebo stla\u010Den\xEDm kl\xE1vesu Alt + kl\xE1vesu so \u0161\xEDpkou nadol"};var FD={};FD={longPressMessage:"Za odprtje menija pritisnite in dr\u017Eite gumb ali pritisnite Alt+pu\u0161\u010Dica navzdol"};var ID={};ID={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var LD={};LD={longPressMessage:"H\xE5ll nedtryckt eller tryck p\xE5 Alt + pil ned\xE5t f\xF6r att \xF6ppna menyn"};var zD={};zD={longPressMessage:"Men\xFCy\xFC a\xE7mak i\xE7in uzun bas\u0131n veya Alt + A\u015Fa\u011F\u0131 Ok tu\u015Funa bas\u0131n"};var ZD={};ZD={longPressMessage:"\u0414\u043E\u0432\u0433\u043E \u0430\u0431\u043E \u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E \u043D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u043A\u043E\u043C\u0431\u0456\u043D\u0430\u0446\u0456\u044E \u043A\u043B\u0430\u0432\u0456\u0448 Alt \u0456 \u0441\u0442\u0440\u0456\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0449\u043E\u0431 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u043C\u0435\u043D\u044E"};var XD={};XD={longPressMessage:"\u957F\u6309\u6216\u6309 Alt + \u5411\u4E0B\u65B9\u5411\u952E\u4EE5\u6253\u5F00\u83DC\u5355"};var jD={};jD={longPressMessage:"\u9577\u6309\u6216\u6309 Alt+\u5411\u4E0B\u9375\u4EE5\u958B\u555F\u529F\u80FD\u8868"};var qD={};qD={"ar-AE":dD,"bg-BG":fD,"cs-CZ":hD,"da-DK":pD,"de-DE":mD,"el-GR":gD,"en-US":OD,"es-ES":bD,"et-EE":yD,"fi-FI":vD,"fr-FR":$D,"he-IL":wD,"hr-HR":xD,"hu-HU":SD,"it-IT":CD,"ja-JP":kD,"ko-KR":DD,"lt-LT":PD,"lv-LV":ED,"nb-NO":TD,"nl-NL":AD,"pl-PL":QD,"pt-BR":MD,"pt-PT":BD,"ro-RO":RD,"ru-RU":VD,"sk-SK":ND,"sl-SI":FD,"sr-SP":ID,"sv-SE":LD,"tr-TR":zD,"uk-UA":ZD,"zh-CN":XD,"zh-TW":jD};function dF(t){return t&&t.__esModule?t.default:t}u(dF,"$parcel$interopDefault$6");function WD(t,e,n){let{type:r="menu",isDisabled:i,trigger:l="press"}=t,a=Ie(),{triggerProps:o,overlayProps:s}=cs({type:r},e,n),c=u(p=>{if(!i&&!(l==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(l==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},"onKeyDown"),d=Yt(dF(qD),"@react-aria/menu"),{longPressProps:f}=D3({isDisabled:i||l!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),h={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!i&&(Bt(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!i&&(Bt(p.target),e.toggle())}};return delete o.onPress,{menuTriggerProps:{...o,...l==="press"?h:f,id:a,onKeyDown:c},menuProps:{...s,"aria-labelledby":a,autoFocus:e.focusStrategy||!0,onClose:e.close}}}u(WD,"$168583247155ddda$export$dc9c12ed27dd1b49");function fF(t){return t&&t.__esModule?t.default:t}u(fF,"$parcel$interopDefault$5");function YD(t,e){let{buttonRef:n,popoverRef:r,inputRef:i,listBoxRef:l,keyboardDelegate:a,layoutDelegate:o,shouldFocusWrap:s,isReadOnly:c,isDisabled:d}=t,f=(0,wp.element.useRef)(null);n=n??f;let h=Yt(fF(ek),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:m}=WD({type:"listbox",isDisabled:d||c},e,n);Qd.set(e,{id:m.id});let{collection:g}=e,{disabledKeys:O}=e.selectionManager,b=(0,wp.element.useMemo)(()=>a||new ps({collection:g,disabledKeys:O,ref:l,layoutDelegate:o}),[a,o,g,O,l]),{collectionProps:y}=tD({selectionManager:e.selectionManager,keyboardDelegate:b,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:s,ref:i,isVirtualized:!0}),$=Wc(),v=u(W=>{if(!W.nativeEvent.isComposing)switch(W.key){case"Enter":case"Tab":if(e.isOpen&&W.key==="Enter"&&W.preventDefault(),e.isOpen&&l.current&&e.selectionManager.focusedKey!=null){let Z=e.collection.getItem(e.selectionManager.focusedKey);if(Z?.props.href){let ee=l.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);W.key==="Enter"&&ee instanceof HTMLAnchorElement&&$.open(ee,W,Z.props.href,Z.props.routerOptions),e.close();break}else if(Z?.props.onAction){Z.props.onAction(),e.close();break}}e.commit();break;case"Escape":(e.selectedKey!==null||e.inputValue===""||t.allowsCustomValue)&&W.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},"onKeyDown"),S=u(W=>{var Z;let ee=n?.current&&n.current===W.relatedTarget,De=(Z=r.current)===null||Z===void 0?void 0:Z.contains(W.relatedTarget);ee||De||(t.onBlur&&t.onBlur(W),e.setFocused(!1))},"onBlur"),x=u(W=>{e.isFocused||(t.onFocus&&t.onFocus(W),e.setFocused(!0))},"onFocus"),{isInvalid:C,validationErrors:Q,validationDetails:T}=e.displayValidation,{labelProps:B,inputProps:w,descriptionProps:M,errorMessageProps:A}=si({...t,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:vr(e.isOpen&&y.onKeyDown,v,t.onKeyDown),onBlur:S,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:x,autoComplete:"off",validate:void 0,[Ar]:e},i),E=u(W=>{if(W.pointerType==="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(null,"manual")}},"onPress"),I=u(W=>{if(W.pointerType!=="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(W.pointerType==="keyboard"||W.pointerType==="virtual"?"first":null,"manual")}},"onPressStart"),D=zn({id:p.id,"aria-label":h.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),P=zn({id:m.id,"aria-label":h.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),R=(0,wp.element.useRef)(0),L=u(W=>{if(d||c)return;if(W.timeStamp-R.current<500){var Z;W.preventDefault(),(Z=i.current)===null||Z===void 0||Z.focus();return}let ee=W.target.getBoundingClientRect(),De=W.changedTouches[0],qt=Math.ceil(ee.left+.5*ee.width),ni=Math.ceil(ee.top+.5*ee.height);if(De.clientX===qt&&De.clientY===ni){var br;W.preventDefault(),(br=i.current)===null||br===void 0||br.focus(),e.toggle(null,"manual"),R.current=W.timeStamp}},"onTouchEnd"),k=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0;var F;let N=(F=k?.parentKey)!==null&&F!==void 0?F:null;var z;let G=(z=e.selectionManager.focusedKey)!==null&&z!==void 0?z:null,le=(0,wp.element.useRef)(N),ie=(0,wp.element.useRef)(G);(0,wp.element.useEffect)(()=>{if(qc()&&k!=null&&G!=null&&G!==ie.current){let Z=e.selectionManager.isSelected(G),ee=N!=null?e.collection.getItem(N):null,De=ee?.["aria-label"]||(typeof ee?.rendered=="string"?ee.rendered:"")||"";var W;let qt=h.format("focusAnnouncement",{isGroupChange:(W=ee&&N!==le.current)!==null&&W!==void 0?W:!1,groupTitle:De,groupCount:ee?[...Rd(ee,e.collection)].length:0,optionText:k["aria-label"]||k.textValue||"",isSelected:Z});$a(qt)}le.current=N,ie.current=G});let me=cD(e.collection),ve=(0,wp.element.useRef)(me),ce=(0,wp.element.useRef)(e.isOpen);(0,wp.element.useEffect)(()=>{let W=e.isOpen!==ce.current&&(e.selectionManager.focusedKey==null||qc());if(e.isOpen&&(W||me!==ve.current)){let Z=h.format("countAnnouncement",{optionCount:me});$a(Z)}ve.current=me,ce.current=e.isOpen});let K=(0,wp.element.useRef)(e.selectedKey);return(0,wp.element.useEffect)(()=>{if(qc()&&e.isFocused&&e.selectedItem&&e.selectedKey!==K.current){let W=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",Z=h.format("selectedAnnouncement",{optionText:W});$a(Z)}K.current=e.selectedKey}),(0,wp.element.useEffect)(()=>{if(e.isOpen)return _g([i.current,r.current].filter(W=>W!=null))},[e.isOpen,i,r]),bm(()=>{!k&&i.current&&Ke(he(i.current))===i.current&&Eg(i.current,null)},[k]),un(l,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:B,buttonProps:{...p,...D,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:E,onPressStart:I,isDisabled:d||c},inputProps:ne(w,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?m.id:void 0,"aria-autocomplete":"list","aria-activedescendant":k?Hk(e,k.key):void 0,onTouchEnd:L,autoCorrect:"off",spellCheck:"false"}),listBoxProps:ne(m,P,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),descriptionProps:M,errorMessageProps:A,isInvalid:C,validationErrors:Q,validationDetails:T}}u(YD,"$c350ade66beef0af$export$8c18d1b4f7232bbf");var KD={};KD={calendar:"\u0627\u0644\u062A\u0642\u0648\u064A\u0645",day:"\u064A\u0648\u0645",dayPeriod:"\u0635/\u0645",endDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621",era:"\u0627\u0644\u0639\u0635\u0631",hour:"\u0627\u0644\u0633\u0627\u0639\u0627\u062A",minute:"\u0627\u0644\u062F\u0642\u0627\u0626\u0642",month:"\u0627\u0644\u0634\u0647\u0631",second:"\u0627\u0644\u062B\u0648\u0627\u0646\u064A",selectedDateDescription:t=>`\u062A\u0627\u0631\u064A\u062E \u0645\u062D\u062F\u062F: ${t.date}`,selectedRangeDescription:t=>`\u0627\u0644\u0645\u062F\u0649 \u0627\u0644\u0632\u0645\u0646\u064A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.startDate} \u0625\u0644\u0649 ${t.endDate}`,selectedTimeDescription:t=>`\u0627\u0644\u0648\u0642\u062A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.time}`,startDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621",timeZoneName:"\u0627\u0644\u062A\u0648\u0642\u064A\u062A",weekday:"\u0627\u0644\u064A\u0648\u0645",year:"\u0627\u0644\u0633\u0646\u0629"};var UD={};UD={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D",dayPeriod:"\u043F\u0440.\u043E\u0431./\u0441\u043B.\u043E\u0431.",endDate:"\u041A\u0440\u0430\u0439\u043D\u0430 \u0434\u0430\u0442\u0430",era:"\u0435\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u0434\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u043E \u0432\u0440\u0435\u043C\u0435: ${t.time}`,startDate:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430 \u0434\u0430\u0442\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0435\u043D \u043E\u0442 \u0441\u0435\u0434\u043C\u0438\u0446\u0430\u0442\u0430",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var GD={};GD={calendar:"Kalend\xE1\u0159",day:"den",dayPeriod:"\u010D\xE1st dne",endDate:"Kone\u010Dn\xE9 datum",era:"letopo\u010Det",hour:"hodina",minute:"minuta",month:"m\u011Bs\xEDc",second:"sekunda",selectedDateDescription:t=>`Vybran\xE9 datum: ${t.date}`,selectedRangeDescription:t=>`Vybran\xE9 obdob\xED: ${t.startDate} a\u017E ${t.endDate}`,selectedTimeDescription:t=>`Vybran\xFD \u010Das: ${t.time}`,startDate:"Po\u010D\xE1te\u010Dn\xED datum",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"den v t\xFDdnu",year:"rok"};var _D={};_D={calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xE6ra",hour:"time",minute:"minut",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt interval: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tidspunkt: ${t.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xE5r"};var HD={};HD={calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xE4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:t=>`Ausgew\xE4hltes Datum: ${t.date}`,selectedRangeDescription:t=>`Ausgew\xE4hlter Bereich: ${t.startDate} bis ${t.endDate}`,selectedTimeDescription:t=>`Ausgew\xE4hlte Zeit: ${t.time}`,startDate:"Startdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"};var JD={};JD={calendar:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BB\u03CC\u03B3\u03B9\u03BF",day:"\u03B7\u03BC\u03AD\u03C1\u03B1",dayPeriod:"\u03C0.\u03BC./\u03BC.\u03BC.",endDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2",era:"\u03C0\u03B5\u03C1\u03AF\u03BF\u03B4\u03BF\u03C2",hour:"\u03CE\u03C1\u03B1",minute:"\u03BB\u03B5\u03C0\u03C4\u03CC",month:"\u03BC\u03AE\u03BD\u03B1\u03C2",second:"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03BF",selectedDateDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1: ${t.date}`,selectedRangeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03BF \u03B5\u03CD\u03C1\u03BF\u03C2: ${t.startDate} \u03AD\u03C9\u03C2 ${t.endDate}`,selectedTimeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03CE\u03C1\u03B1: ${t.time}`,startDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2",timeZoneName:"\u03B6\u03CE\u03BD\u03B7 \u03CE\u03C1\u03B1\u03C2",weekday:"\u03BA\u03B1\u03B8\u03B7\u03BC\u03B5\u03C1\u03B9\u03BD\u03AE",year:"\u03AD\u03C4\u03BF\u03C2"};var e2={};e2={era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:t=>`Selected Date: ${t.date}`,selectedRangeDescription:t=>`Selected Range: ${t.startDate} to ${t.endDate}`,selectedTimeDescription:t=>`Selected Time: ${t.time}`};var t2={};t2={calendar:"Calendario",day:"d\xEDa",dayPeriod:"a.\xA0m./p.\xA0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:t=>`Fecha seleccionada: ${t.date}`,selectedRangeDescription:t=>`Rango seleccionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora seleccionada: ${t.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xEDa de la semana",year:"a\xF1o"};var n2={};n2={calendar:"Kalender",day:"p\xE4ev",dayPeriod:"enne/p\xE4rast l\xF5unat",endDate:"L\xF5ppkuup\xE4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:t=>`Valitud kuup\xE4ev: ${t.date}`,selectedRangeDescription:t=>`Valitud vahemik: ${t.startDate} kuni ${t.endDate}`,selectedTimeDescription:t=>`Valitud aeg: ${t.time}`,startDate:"Alguskuup\xE4ev",timeZoneName:"ajav\xF6\xF6nd",weekday:"n\xE4dalap\xE4ev",year:"aasta"};var r2={};r2={calendar:"Kalenteri",day:"p\xE4iv\xE4",dayPeriod:"vuorokaudenaika",endDate:"P\xE4\xE4ttymisp\xE4iv\xE4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:t=>`Valittu p\xE4iv\xE4m\xE4\xE4r\xE4: ${t.date}`,selectedRangeDescription:t=>`Valittu aikav\xE4li: ${t.startDate} \u2013 ${t.endDate}`,selectedTimeDescription:t=>`Valittu aika: ${t.time}`,startDate:"Alkamisp\xE4iv\xE4",timeZoneName:"aikavy\xF6hyke",weekday:"viikonp\xE4iv\xE4",year:"vuosi"};var i2={};i2={calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xE8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:t=>`Date s\xE9lectionn\xE9e\xA0: ${t.date}`,selectedRangeDescription:t=>`Plage s\xE9lectionn\xE9e\xA0: ${t.startDate} au ${t.endDate}`,selectedTimeDescription:t=>`Heure choisie\xA0: ${t.time}`,startDate:"Date de d\xE9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xE9e"};var l2={};l2={calendar:"\u05DC\u05D5\u05D7 \u05E9\u05E0\u05D4",day:"\u05D9\u05D5\u05DD",dayPeriod:"\u05DC\u05E4\u05E0\u05D4\u05F4\u05E6/\u05D0\u05D7\u05D4\u05F4\u05E6",endDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05E1\u05D9\u05D5\u05DD",era:"\u05EA\u05E7\u05D5\u05E4\u05D4",hour:"\u05E9\u05E2\u05D4",minute:"\u05D3\u05E7\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",second:"\u05E9\u05E0\u05D9\u05D9\u05D4",selectedDateDescription:t=>`\u05EA\u05D0\u05E8\u05D9\u05DA \u05E0\u05D1\u05D7\u05E8: ${t.date}`,selectedRangeDescription:t=>`\u05D8\u05D5\u05D5\u05D7 \u05E0\u05D1\u05D7\u05E8: ${t.startDate} \u05E2\u05D3 ${t.endDate}`,selectedTimeDescription:t=>`\u05D6\u05DE\u05DF \u05E0\u05D1\u05D7\u05E8: ${t.time}`,startDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05EA\u05D7\u05DC\u05D4",timeZoneName:"\u05D0\u05D6\u05D5\u05E8 \u05D6\u05DE\u05DF",weekday:"\u05D9\u05D5\u05DD \u05D1\u05E9\u05D1\u05D5\u05E2",year:"\u05E9\u05E0\u05D4"};var a2={};a2={calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum zavr\u0161etka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:t=>`Odabrani datum: ${t.date}`,selectedRangeDescription:t=>`Odabrani raspon: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Odabrano vrijeme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"};var o2={};o2={calendar:"Napt\xE1r",day:"nap",dayPeriod:"napszak",endDate:"Befejez\u0151 d\xE1tum",era:"\xE9ra",hour:"\xF3ra",minute:"perc",month:"h\xF3nap",second:"m\xE1sodperc",selectedDateDescription:t=>`Kijel\xF6lt d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Kijel\xF6lt tartom\xE1ny: ${t.startDate}\u2013${t.endDate}`,selectedTimeDescription:t=>`Kijel\xF6lt id\u0151: ${t.time}`,startDate:"Kezd\u0151 d\xE1tum",timeZoneName:"id\u0151z\xF3na",weekday:"h\xE9t napja",year:"\xE9v"};var s2={};s2={calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:t=>`Data selezionata: ${t.date}`,selectedRangeDescription:t=>`Intervallo selezionato: da ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Ora selezionata: ${t.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"};var u2={};u2={calendar:"\u30AB\u30EC\u30F3\u30C0\u30FC",day:"\u65E5",dayPeriod:"\u5348\u524D/\u5348\u5F8C",endDate:"\u7D42\u4E86\u65E5",era:"\u6642\u4EE3",hour:"\u6642",minute:"\u5206",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u629E\u3057\u305F\u65E5\u4ED8 : ${t.date}`,selectedRangeDescription:t=>`\u9078\u629E\u7BC4\u56F2 : ${t.startDate} \u304B\u3089 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u629E\u3057\u305F\u6642\u9593 : ${t.time}`,startDate:"\u958B\u59CB\u65E5",timeZoneName:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3",weekday:"\u66DC\u65E5",year:"\u5E74"};var c2={};c2={calendar:"\uB2EC\uB825",day:"\uC77C",dayPeriod:"\uC624\uC804/\uC624\uD6C4",endDate:"\uC885\uB8CC\uC77C",era:"\uC5F0\uD638",hour:"\uC2DC",minute:"\uBD84",month:"\uC6D4",second:"\uCD08",selectedDateDescription:t=>`\uC120\uD0DD \uC77C\uC790: ${t.date}`,selectedRangeDescription:t=>`\uC120\uD0DD \uBC94\uC704: ${t.startDate} ~ ${t.endDate}`,selectedTimeDescription:t=>`\uC120\uD0DD \uC2DC\uAC04: ${t.time}`,startDate:"\uC2DC\uC791\uC77C",timeZoneName:"\uC2DC\uAC04\uB300",weekday:"\uC694\uC77C",year:"\uB144"};var d2={};d2={calendar:"Kalendorius",day:"diena",dayPeriod:"iki piet\u0173 / po piet\u0173",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minut\u0117",month:"m\u0117nuo",second:"sekund\u0117",selectedDateDescription:t=>`Pasirinkta data: ${t.date}`,selectedRangeDescription:t=>`Pasirinktas intervalas: nuo ${t.startDate} iki ${t.endDate}`,selectedTimeDescription:t=>`Pasirinktas laikas: ${t.time}`,startDate:"Prad\u017Eios data",timeZoneName:"laiko juosta",weekday:"savait\u0117s diena",year:"metai"};var f2={};f2={calendar:"Kalend\u0101rs",day:"diena",dayPeriod:"priek\u0161pusdien\u0101/p\u0113cpusdien\u0101",endDate:"Beigu datums",era:"\u0113ra",hour:"stundas",minute:"min\u016Btes",month:"m\u0113nesis",second:"sekundes",selectedDateDescription:t=>`Atlas\u012Btais datums: ${t.date}`,selectedRangeDescription:t=>`Atlas\u012Btais diapazons: no ${t.startDate} l\u012Bdz ${t.endDate}`,selectedTimeDescription:t=>`Atlas\u012Btais laiks: ${t.time}`,startDate:"S\u0101kuma datums",timeZoneName:"laika josla",weekday:"ned\u0113\u013Cas diena",year:"gads"};var h2={};h2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt omr\xE5de: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tid: ${t.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xE5r"};var p2={};p2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:t=>`Geselecteerde datum: ${t.date}`,selectedRangeDescription:t=>`Geselecteerd bereik: ${t.startDate} tot ${t.endDate}`,selectedTimeDescription:t=>`Geselecteerde tijd: ${t.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"};var m2={};m2={calendar:"Kalendarz",day:"dzie\u0144",dayPeriod:"rano / po po\u0142udniu / wieczorem",endDate:"Data ko\u0144cowa",era:"era",hour:"godzina",minute:"minuta",month:"miesi\u0105c",second:"sekunda",selectedDateDescription:t=>`Wybrana data: ${t.date}`,selectedRangeDescription:t=>`Wybrany zakres: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Wybrany czas: ${t.time}`,startDate:"Data pocz\u0105tkowa",timeZoneName:"strefa czasowa",weekday:"dzie\u0144 tygodnia",year:"rok"};var g2={};g2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var O2={};O2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xE9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data de In\xEDcio",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var b2={};b2={calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dat\u0103 final",era:"er\u0103",hour:"or\u0103",minute:"minut",month:"lun\u0103",second:"secund\u0103",selectedDateDescription:t=>`Dat\u0103 selectat\u0103: ${t.date}`,selectedRangeDescription:t=>`Interval selectat: de la ${t.startDate} p\xE2n\u0103 la ${t.endDate}`,selectedTimeDescription:t=>`Ora selectat\u0103: ${t.time}`,startDate:"Dat\u0103 \xEEnceput",timeZoneName:"fus orar",weekday:"ziua din s\u0103pt\u0103m\xE2n\u0103",year:"an"};var y2={};y2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C",day:"\u0434\u0435\u043D\u044C",dayPeriod:"AM/PM",endDate:"\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",era:"\u044D\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u044F\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: \u0441 ${t.startDate} \u043F\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u043D\u0435\u0434\u0435\u043B\u0438",year:"\u0433\u043E\u0434"};var v2={};v2={calendar:"Kalend\xE1r",day:"de\u0148",dayPeriod:"AM/PM",endDate:"D\xE1tum ukon\u010Denia",era:"letopo\u010Det",hour:"hodina",minute:"min\xFAta",month:"mesiac",second:"sekunda",selectedDateDescription:t=>`Vybrat\xFD d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Vybrat\xFD rozsah: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Vybrat\xFD \u010Das: ${t.time}`,startDate:"D\xE1tum za\u010Datia",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"de\u0148 t\xFD\u017Ed\u0148a",year:"rok"};var $2={};$2={calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:t=>`Izbrani datum: ${t.date}`,selectedRangeDescription:t=>`Izbrano obmo\u010Dje: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izbrani \u010Das: ${t.time}`,startDate:"Datum za\u010Detka",timeZoneName:"\u010Dasovni pas",weekday:"dan v tednu",year:"leto"};var w2={};w2={calendar:"Kalendar",day:"\u0434\u0430\u043D",dayPeriod:"\u043F\u0440\u0435 \u043F\u043E\u0434\u043D\u0435/\u043F\u043E \u043F\u043E\u0434\u043D\u0435",endDate:"Datum zavr\u0161etka",era:"\u0435\u0440\u0430",hour:"\u0441\u0430\u0442",minute:"\u043C\u0438\u043D\u0443\u0442",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434",selectedDateDescription:t=>`Izabrani datum: ${t.date}`,selectedRangeDescription:t=>`Izabrani opseg: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izabrano vreme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"\u0432\u0440\u0435\u043C\u0435\u043D\u0441\u043A\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0430\u043D \u0443 \u043D\u0435\u0434\u0435\u0459\u0438",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var x2={};x2={calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xE5nad",second:"sekund",selectedDateDescription:t=>`Valt datum: ${t.date}`,selectedRangeDescription:t=>`Valt intervall: ${t.startDate} till ${t.endDate}`,selectedTimeDescription:t=>`Vald tid: ${t.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xE5r"};var S2={};S2={calendar:"Takvim",day:"g\xFCn",dayPeriod:"\xD6\xD6/\xD6S",endDate:"Biti\u015F Tarihi",era:"\xE7a\u011F",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:t=>`Se\xE7ilen Tarih: ${t.date}`,selectedRangeDescription:t=>`Se\xE7ilen Aral\u0131k: ${t.startDate} - ${t.endDate}`,selectedTimeDescription:t=>`Se\xE7ilen Zaman: ${t.time}`,startDate:"Ba\u015Flang\u0131\xE7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftan\u0131n g\xFCn\xFC",year:"y\u0131l"};var C2={};C2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D\u044C",dayPeriod:"\u0434\u043F/\u043F\u043F",endDate:"\u0414\u0430\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F",era:"\u0435\u0440\u0430",hour:"\u0433\u043E\u0434\u0438\u043D\u0430",minute:"\u0445\u0432\u0438\u043B\u0438\u043D\u0430",month:"\u043C\u0456\u0441\u044F\u0446\u044C",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u2014 ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0447\u0430\u0441: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0438\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u0442\u0438\u0436\u043D\u044F",year:"\u0440\u0456\u043A"};var k2={};k2={calendar:"\u65E5\u5386",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7ED3\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9009\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9009\u5B9A\u7684\u8303\u56F4\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9009\u5B9A\u7684\u65F6\u95F4\uFF1A${t.time}`,startDate:"\u5F00\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var D2={};D2={calendar:"\u65E5\u66C6",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7D50\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9078\u5B9A\u7684\u7BC4\u570D\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u5B9A\u7684\u6642\u9593\uFF1A${t.time}`,startDate:"\u958B\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var ms={};ms={"ar-AE":KD,"bg-BG":UD,"cs-CZ":GD,"da-DK":_D,"de-DE":HD,"el-GR":JD,"en-US":e2,"es-ES":t2,"et-EE":n2,"fi-FI":r2,"fr-FR":i2,"he-IL":l2,"hr-HR":a2,"hu-HU":o2,"it-IT":s2,"ja-JP":u2,"ko-KR":c2,"lt-LT":d2,"lv-LV":f2,"nb-NO":h2,"nl-NL":p2,"pl-PL":m2,"pt-BR":g2,"pt-PT":O2,"ro-RO":b2,"ru-RU":y2,"sk-SK":v2,"sl-SI":$2,"sr-SP":w2,"sv-SE":x2,"tr-TR":S2,"uk-UA":C2,"zh-CN":k2,"zh-TW":D2};function n0(t,e,n){let{direction:r}=Re(),i=(0,wp.element.useMemo)(()=>xd(e),[e]),l=u(s=>{if(s.currentTarget.contains(s.target)&&(s.altKey&&(s.key==="ArrowDown"||s.key==="ArrowUp")&&"setOpen"in t&&(s.preventDefault(),s.stopPropagation(),t.setOpen(!0)),!n))switch(s.key){case"ArrowLeft":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=P2(e.current,c.getBoundingClientRect().left,-1);d&&d.focus()}}else i.focusPrevious();break;case"ArrowRight":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=P2(e.current,c.getBoundingClientRect().left,1);d&&d.focus()}}else i.focusNext();break}},"onKeyDown"),a=u(()=>{var s;if(!e.current)return;let c=(s=window.event)===null||s===void 0?void 0:s.target,d=ut(e.current,{tabbable:!0});if(c&&(d.currentNode=c,c=d.previousNode()),!c){let f;do f=d.lastChild(),f&&(c=f);while(f)}for(;c?.hasAttribute("data-placeholder");){let f=d.previousNode();if(f&&f.hasAttribute("data-placeholder"))c=f;else break}c&&c.focus()},"focusLast"),{pressProps:o}=Zn({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(s){s.pointerType==="mouse"&&a()},onPress(s){(s.pointerType==="touch"||s.pointerType==="pen")&&a()}});return ne(o,{onKeyDown:l})}u(n0,"$3dfb0f96be0d6a08$export$4a931266a3838b86");function P2(t,e,n){let r=ut(t,{tabbable:!0}),i=r.nextNode(),l=null,a=1/0;for(;i;){let s=i.getBoundingClientRect().left-e,c=Math.abs(s);Math.sign(s)===n&&c{var w;e.confirmPlaceholder(),e.value!==f.current&&e.commitValidation(),(w=t.onBlur)===null||w===void 0||w.call(t,B)},onFocusWithinChange:t.onFocusChange}),p=Yt(hF(ms),"@react-aria/datepicker"),m=e.maxGranularity==="hour"?"selectedTimeDescription":"selectedDateDescription",g=e.maxGranularity==="hour"?"time":"date",O=e.value?p.format(m,{[g]:e.formatValue({month:"long"})}):"",b=Io(O),y=t[gs]==="presentation"?s["aria-describedby"]:[b["aria-describedby"],s["aria-describedby"]].filter(Boolean).join(" ")||void 0,$=t[T2],v=(0,wp.element.useMemo)(()=>$||xd(n),[$,n]),S=n0(e,n,t[gs]==="presentation");E2.set(e,{ariaLabel:t["aria-label"],ariaLabelledBy:[o.id,t["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:y,focusManager:v});let x=(0,wp.element.useRef)(t.autoFocus),C;t[gs]==="presentation"?C={role:"presentation"}:C=ne(s,{role:"group","aria-disabled":t.isDisabled||void 0,"aria-describedby":y}),(0,wp.element.useEffect)(()=>{x.current&&v.focusFirst(),x.current=!1},[v]),Sr(t.inputRef,e.defaultValue,e.setValue),ss({...t,focus(){v.focusFirst()}},e,t.inputRef);let Q={type:"hidden",name:t.name,form:t.form,value:((r=e.value)===null||r===void 0?void 0:r.toString())||"",disabled:t.isDisabled};t.validationBehavior==="native"&&(Q.type="text",Q.hidden=!0,Q.required=t.isRequired,Q.onChange=()=>{});let T=yt(t);return{labelProps:{...o,onClick:()=>{v.focusFirst()}},fieldProps:ne(T,C,S,h,{onKeyDown(B){t.onKeyDown&&t.onKeyDown(B)},onKeyUp(B){t.onKeyUp&&t.onKeyUp(B)},style:{unicodeBidi:"isolate"}}),inputProps:Q,descriptionProps:c,errorMessageProps:d,isInvalid:i,validationErrors:l,validationDetails:a}}u(A2,"$16f0b7bb276bc17e$export$5591b0b878c1a989");function pF(t,e,n){var r;let i=A2(t,e,n);return i.inputProps.value=((r=e.timeValue)===null||r===void 0?void 0:r.toString())||"",i}u(pF,"$16f0b7bb276bc17e$export$4c842f6a241dc825");function mF(t){return t&&t.__esModule?t.default:t}u(mF,"$parcel$interopDefault$3");function gF(t,e,n){let r=Ie(),i=Ie(),l=Ie(),a=Yt(mF(ms),"@react-aria/datepicker"),{isInvalid:o,validationErrors:s,validationDetails:c}=e.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:h,errorMessageProps:p}=$t({...t,labelElementType:"span",isInvalid:o,errorMessage:t.errorMessage||s}),m=n0(e,n),g=f["aria-labelledby"]||f.id,{locale:O}=Re(),b=e.formatValue(O,{month:"long"}),y=b?a.format("selectedDateDescription",{date:b}):"",$=Io(y),v=[$["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,S=yt(t),x=(0,wp.element.useMemo)(()=>xd(n),[n]),C=(0,wp.element.useRef)(!1),{focusWithinProps:Q}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:T=>{let B=document.getElementById(i);if(!B?.contains(T.relatedTarget)){var w,M;C.current=!1,(w=t.onBlur)===null||w===void 0||w.call(t,T),(M=t.onFocusChange)===null||M===void 0||M.call(t,!1)}},onFocusWithin:T=>{if(!C.current){var B,w;C.current=!0,(B=t.onFocus)===null||B===void 0||B.call(t,T),(w=t.onFocusChange)===null||w===void 0||w.call(t,!0)}}});return{groupProps:ne(S,m,f,$,Q,{role:"group","aria-disabled":t.isDisabled||null,"aria-labelledby":g,"aria-describedby":v,onKeyDown(T){e.isOpen||t.onKeyDown&&t.onKeyDown(T)},onKeyUp(T){e.isOpen||t.onKeyUp&&t.onKeyUp(T)}}),labelProps:{...d,onClick:()=>{x.focusFirst()}},fieldProps:{...f,id:l,[gs]:"presentation","aria-describedby":v,value:e.value,defaultValue:e.defaultValue,onChange:e.setValue,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,granularity:t.granularity,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior,[Ar]:e,autoFocus:t.autoFocus,name:t.name,form:t.form},descriptionProps:h,errorMessageProps:p,buttonProps:{...$,id:r,"aria-haspopup":"dialog","aria-label":a.format("calendar"),"aria-labelledby":`${r} ${g}`,"aria-describedby":v,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:i,"aria-labelledby":`${r} ${g}`},calendarProps:{autoFocus:!0,value:e.dateValue,onChange:e.setDateValue,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,defaultFocusedValue:e.dateValue?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:o,validationErrors:s,validationDetails:c}}u(gF,"$6057a3d2a53a12fd$export$42df105a73306d51");function OF(t){return t&&t.__esModule?t.default:t}u(OF,"$parcel$interopDefault$2");function bF(){let{locale:t}=Re(),e=M3(OF(ms),"@react-aria/datepicker");return(0,wp.element.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new r0(t,e)}},[t,e])}u(bF,"$3aeceb3a64eb8358$export$d42c60378c8168f8");const $v=class $v{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,n){this.locale=e,this.dictionary=n}};u($v,"$3aeceb3a64eb8358$var$DisplayNamesPolyfill");let r0=$v;function yF(t,e,n){let r=(0,wp.element.useRef)(""),{locale:i,direction:l}=Re(),a=bF(),{ariaLabel:o,ariaLabelledBy:s,ariaDescribedBy:c,focusManager:d}=E2.get(e),f=t.isPlaceholder?"":t.text,h=(0,wp.element.useMemo)(()=>e.dateFormatter.resolvedOptions(),[e.dateFormatter]),p=Xn({month:"long",timeZone:h.timeZone}),m=Xn({hour:"numeric",hour12:h.hour12,timeZone:h.timeZone});if(t.type==="month"&&!t.isPlaceholder){let k=p.format(e.dateValue);f=k!==f?`${f} \u2013 ${k}`:k}else t.type==="hour"&&!t.isPlaceholder&&(f=m.format(e.dateValue));let{spinButtonProps:g}=Xg({value:t.value,textValue:f,minValue:t.minValue,maxValue:t.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly||!t.isEditable,isRequired:e.isRequired,onIncrement:()=>{r.current="",e.increment(t.type)},onDecrement:()=>{r.current="",e.decrement(t.type)},onIncrementPage:()=>{r.current="",e.incrementPage(t.type)},onDecrementPage:()=>{r.current="",e.decrementPage(t.type)},onIncrementToMax:()=>{r.current="",t.maxValue!==void 0&&e.setSegment(t.type,t.maxValue)},onDecrementToMin:()=>{r.current="",t.minValue!==void 0&&e.setSegment(t.type,t.minValue)}}),O=(0,wp.element.useMemo)(()=>new ts(i,{maximumFractionDigits:0}),[i]),b=u(()=>{if(t.text===t.placeholder&&d.focusPrevious(),O.isValidPartialNumber(t.text)&&!e.isReadOnly&&!t.isPlaceholder){let k=t.text.slice(0,-1),F=O.parse(k);k=F===0?"":k,k.length===0||F===0?e.clearSegment(t.type):e.setSegment(t.type,F),r.current=k}else t.type==="dayPeriod"&&e.clearSegment(t.type)},"backspace"),y=u(k=>{if(k.key==="a"&&(wr()?k.metaKey:k.ctrlKey)&&k.preventDefault(),!(k.ctrlKey||k.metaKey||k.shiftKey||k.altKey))switch(k.key){case"Backspace":case"Delete":k.preventDefault(),k.stopPropagation(),b();break}},"onKeyDown"),{startsWith:$}=Sg({sensitivity:"base"}),v=Xn({hour:"numeric",hour12:!0}),S=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(0),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),x=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(12),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),C=Xn({year:"numeric",era:"narrow",timeZone:"UTC"}),Q=(0,wp.element.useMemo)(()=>{if(t.type!=="era")return[];let k=Ne(new Fe(1,1,1),e.calendar),F=e.calendar.getEras().map(z=>{let G=k.set({year:1,month:1,day:1,era:z}).toDate("UTC"),ie=C.formatToParts(G).find(me=>me.type==="era").value;return{era:z,formatted:ie}}),N=vF(F.map(z=>z.formatted));if(N)for(let z of F)z.formatted=z.formatted.slice(N);return F},[C,e.calendar,t.type]),T=u(k=>{if(e.isDisabled||e.isReadOnly)return;let F=r.current+k;switch(t.type){case"dayPeriod":if($(S,k))e.setSegment("dayPeriod",0);else if($(x,k))e.setSegment("dayPeriod",12);else break;d.focusNext();break;case"era":{let N=Q.find(z=>$(z.formatted,k));N&&(e.setSegment("era",N.era),d.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!O.isValidPartialNumber(F))return;let N=O.parse(F),z=N,G=t.minValue===0;if(t.type==="hour"&&e.dateFormatter.resolvedOptions().hour12){switch(e.dateFormatter.resolvedOptions().hourCycle){case"h11":N>11&&(z=O.parse(k));break;case"h12":G=!1,N>12&&(z=O.parse(k));break}t.value!==void 0&&t.value>=12&&N>1&&(N+=12)}else t.maxValue!==void 0&&N>t.maxValue&&(z=O.parse(k));if(isNaN(N))return;let le=z!==0||G;le&&e.setSegment(t.type,z),t.maxValue!==void 0&&(+(N+"0")>t.maxValue||F.length>=String(t.maxValue).length)?(r.current="",le&&d.focusNext()):r.current=F;break}}},"onInput"),B=u(()=>{r.current="",n.current&&Kc(n.current,{containingElement:Yc(n.current)});let k=window.getSelection();k?.collapse(n.current)},"onFocus"),w=(0,wp.element.useRef)(typeof document<"u"?document:null);un(w,"selectionchange",()=>{var k;let F=window.getSelection();F?.anchorNode&&(!((k=n.current)===null||k===void 0)&&k.contains(F?.anchorNode))&&F.collapse(n.current)});let M=(0,wp.element.useRef)("");un(n,"beforeinput",k=>{if(n.current)switch(k.preventDefault(),k.inputType){case"deleteContentBackward":case"deleteContentForward":O.isValidPartialNumber(t.text)&&!e.isReadOnly&&b();break;case"insertCompositionText":M.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:k.data!=null&&T(k.data);break}}),un(n,"input",k=>{let{inputType:F,data:N}=k;switch(F){case"insertCompositionText":n.current&&(n.current.textContent=M.current),N!=null&&($(S,N)||$(x,N))&&T(N);break}}),Pe(()=>{let k=n.current;return()=>{document.activeElement===k&&(d.focusPrevious()||d.focusNext())}},[n,d]);let A=Xi()||t.type==="timeZoneName"?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{},E=(0,wp.element.useMemo)(()=>e.segments.find(k=>k.isEditable),[e.segments]);t!==E&&!e.isInvalid&&(c=void 0);let I=Ie(),D=!e.isDisabled&&!e.isReadOnly&&t.isEditable,P=t.type==="literal"?"":a.of(t.type),R=zn({"aria-label":`${P}${o?`, ${o}`:""}${s?", ":""}`,"aria-labelledby":s});if(t.type==="literal")return{segmentProps:{"aria-hidden":!0}};let L={caretColor:"transparent"};if(l==="rtl"){L.unicodeBidi="embed";let k=h[t.type];(k==="numeric"||k==="2-digit")&&(L.direction="ltr")}return{segmentProps:ne(g,R,{id:I,...A,"aria-invalid":e.isInvalid?"true":void 0,"aria-describedby":c,"aria-readonly":e.isReadOnly||!t.isEditable?"true":void 0,"data-placeholder":t.isPlaceholder||void 0,contentEditable:D,suppressContentEditableWarning:D,spellCheck:D?"false":void 0,autoCorrect:D?"off":void 0,[parseInt(wp.element.version,10)>=17?"enterKeyHint":"enterkeyhint"]:D?"next":void 0,inputMode:e.isDisabled||t.type==="dayPeriod"||t.type==="era"||!D?void 0:"numeric",tabIndex:e.isDisabled?void 0:0,onKeyDown:y,onFocus:B,style:L,onPointerDown(k){k.stopPropagation()},onMouseDown(k){k.stopPropagation()}})}}u(yF,"$32489daedd52963e$export$1315d136e6f7581");function vF(t){t.sort();let e=t[0],n=t[t.length-1];for(let r=0;rxd(n,{accept:k=>k.id!==C}),[n,C]),M={[T2]:w,[gs]:"presentation","aria-describedby":B,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,granularity:t.granularity,shouldForceLeadingZeros:t.shouldForceLeadingZeros,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior},A=yt(t),E=(0,wp.element.useRef)(!1),{focusWithinProps:I}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:k=>{let F=document.getElementById(Q);if(!F?.contains(k.relatedTarget)){var N,z;E.current=!1,(N=t.onBlur)===null||N===void 0||N.call(t,k),(z=t.onFocusChange)===null||z===void 0||z.call(t,!1)}},onFocusWithin:k=>{if(!E.current){var F,N;E.current=!0,(F=t.onFocus)===null||F===void 0||F.call(t,k),(N=t.onFocusChange)===null||N===void 0||N.call(t,!0)}}}),D=(0,wp.element.useRef)(el),P=(0,wp.element.useRef)(el);var R,L;return{groupProps:ne(A,T,p,v,I,{role:"group","aria-disabled":t.isDisabled||null,"aria-describedby":B,onKeyDown(k){e.isOpen||t.onKeyDown&&t.onKeyDown(k)},onKeyUp(k){e.isOpen||t.onKeyUp&&t.onKeyUp(k)}}),labelProps:{...h,onClick:()=>{w.focusFirst()}},buttonProps:{...v,id:C,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${C} ${O}`,"aria-describedby":B,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:Q,"aria-labelledby":`${C} ${O}`},startFieldProps:{...S,...M,value:(R=(r=e.value)===null||r===void 0?void 0:r.start)!==null&&R!==void 0?R:null,defaultValue:(i=e.defaultValue)===null||i===void 0?void 0:i.start,onChange:k=>e.setDateTime("start",k),autoFocus:t.autoFocus,name:t.startName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){D.current=k,e.updateValidation(Cd(k,P.current))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},endFieldProps:{...x,...M,value:(L=(l=e.value)===null||l===void 0?void 0:l.end)!==null&&L!==void 0?L:null,defaultValue:(a=e.defaultValue)===null||a===void 0?void 0:a.end,onChange:k=>e.setDateTime("end",k),name:t.endName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){P.current=k,e.updateValidation(Cd(D.current,k))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},descriptionProps:m,errorMessageProps:g,calendarProps:{autoFocus:!0,value:!((o=e.dateRange)===null||o===void 0)&&o.start&&e.dateRange.end?e.dateRange:null,onChange:e.setDateRange,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,allowsNonContiguousRanges:t.allowsNonContiguousRanges,defaultFocusedValue:e.dateRange?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:c,validationErrors:d,validationDetails:f}}u(Q2,"$887cac91b7cc8801$export$12fd5f0e9f4bb192");function wF(t,e){let{role:n="dialog"}=t,r=sa();r=t["aria-label"]?void 0:r;let i=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{if(e.current&&!e.current.contains(document.activeElement)){Ki(e.current);let l=setTimeout(()=>{(document.activeElement===e.current||document.activeElement===document.body)&&(i.current=!0,e.current&&(e.current.blur(),Ki(e.current)),i.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),_k(),{dialogProps:{...yt(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{i.current&&l.stopPropagation()}},titleProps:{id:r}}}u(wF,"$40df3f8667284809$export$d55e7ee900f34e93");var i0=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};function M2(){throw new Error("setTimeout has not been defined")}u(M2,"defaultSetTimout");function B2(){throw new Error("clearTimeout has not been defined")}u(B2,"defaultClearTimeout");var ui=M2,ci=B2;typeof i0.setTimeout=="function"&&(ui=setTimeout),typeof i0.clearTimeout=="function"&&(ci=clearTimeout);function R2(t){if(ui===setTimeout)return setTimeout(t,0);if((ui===M2||!ui)&&setTimeout)return ui=setTimeout,setTimeout(t,0);try{return ui(t,0)}catch{try{return ui.call(null,t,0)}catch{return ui.call(this,t,0)}}}u(R2,"runTimeout");function xF(t){if(ci===clearTimeout)return clearTimeout(t);if((ci===B2||!ci)&&clearTimeout)return ci=clearTimeout,clearTimeout(t);try{return ci(t)}catch{try{return ci.call(null,t)}catch{return ci.call(this,t)}}}u(xF,"runClearTimeout");var Mr=[],Da=!1,tl,Vd=-1;function SF(){!Da||!tl||(Da=!1,tl.length?Mr=tl.concat(Mr):Vd=-1,Mr.length&&V2())}u(SF,"cleanUpNextTick");function V2(){if(!Da){var t=R2(SF);Da=!0;for(var e=Mr.length;e;){for(tl=Mr,Mr=[];++Vd1)for(var n=1;n{I.stopPropagation(),e.setSelectedValue(r)},"onChange"),{pressProps:y,isPressed:$}=Zn({onPressStart:o,onPressEnd:s,onPressChange:c,onPress:d,onPressUp:f,onClick:h,isDisabled:p}),{pressProps:v,isPressed:S}=Zn({onPressStart:o,onPressEnd:s,onPressChange:c,onPressUp:f,onClick:h,isDisabled:p,onPress(I){var D;d?.(I),e.setSelectedValue(r),(D=n.current)===null||D===void 0||D.focus()}}),{focusableProps:x}=jo(ne(t,{onFocus:()=>e.setLastFocusedValue(r)}),n),C=ne(y,x),Q=yt(t,{labelable:!0}),T=-1;e.selectedValue!=null?e.selectedValue===r&&(T=0):(e.lastFocusedValue===r||e.lastFocusedValue==null)&&(T=0),p&&(T=void 0);let{name:B,form:w,descriptionId:M,errorMessageId:A,validationBehavior:E}=F2.get(e);return Sr(n,e.defaultSelectedValue,e.setSelectedValue),ss({validationBehavior:E},e,n),{labelProps:ne(v,(0,wp.element.useMemo)(()=>({onClick:I=>I.preventDefault(),onMouseDown:I=>I.preventDefault()}),[])),inputProps:ne(Q,{...C,type:"radio",name:B,form:w,tabIndex:T,disabled:p,required:e.isRequired&&E==="native",checked:O,value:r,onChange:b,"aria-describedby":[t["aria-describedby"],e.isInvalid?A:null,M].filter(Boolean).join(" ")||void 0}),isDisabled:p,isSelected:O,isPressed:$||S}}u(I2,"$0d5c49892c1215da$export$37b0961d2f4751e2");function L2(t,e){let{name:n,form:r,isReadOnly:i,isRequired:l,isDisabled:a,orientation:o="vertical",validationBehavior:s="aria"}=t,{direction:c}=Re(),{isInvalid:d,validationErrors:f,validationDetails:h}=e.displayValidation,{labelProps:p,fieldProps:m,descriptionProps:g,errorMessageProps:O}=$t({...t,labelElementType:"span",isInvalid:e.isInvalid,errorMessage:t.errorMessage||f}),b=yt(t,{labelable:!0}),{focusWithinProps:y}=Wt({onBlurWithin(S){var x;(x=t.onBlur)===null||x===void 0||x.call(t,S),e.selectedValue||e.setLastFocusedValue(null)},onFocusWithin:t.onFocus,onFocusWithinChange:t.onFocusChange}),$=u(S=>{let x;switch(S.key){case"ArrowRight":c==="rtl"&&o!=="vertical"?x="prev":x="next";break;case"ArrowLeft":c==="rtl"&&o!=="vertical"?x="next":x="prev";break;case"ArrowDown":x="next";break;case"ArrowUp":x="prev";break;default:return}S.preventDefault();let C=ut(S.currentTarget,{from:S.target,accept:T=>T instanceof bt(T).HTMLInputElement&&T.type==="radio"}),Q;x==="next"?(Q=C.nextNode(),Q||(C.currentNode=S.currentTarget,Q=C.firstChild())):(Q=C.previousNode(),Q||(C.currentNode=S.currentTarget,Q=C.lastChild())),Q&&(Q.focus(),e.setSelectedValue(Q.value))},"onKeyDown"),v=Ie(n);return F2.set(e,{name:v,form:r,descriptionId:g.id,errorMessageId:O.id,validationBehavior:s}),{radioGroupProps:ne(b,{role:"radiogroup",onKeyDown:$,"aria-invalid":e.isInvalid||void 0,"aria-errormessage":t["aria-errormessage"],"aria-readonly":i||void 0,"aria-required":l||void 0,"aria-disabled":a||void 0,"aria-orientation":o,...m,...y}),labelProps:p,descriptionProps:g,errorMessageProps:O,isInvalid:d,validationErrors:f,validationDetails:h}}u(L2,"$430f30ed08ec25fa$export$62b9571f283ff5c2");const a0=new WeakMap;function GF(t,e,n){let{keyboardDelegate:r,isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s="aria"}=t,c=xg({usage:"search",sensitivity:"base"}),d=(0,wp.element.useMemo)(()=>r||new ps(e.collection,e.disabledKeys,n,c),[r,e.collection,e.disabledKeys,c,n]),{menuTriggerProps:f,menuProps:h}=WD({isDisabled:i,type:"listbox"},e,n),p=u(T=>{if(e.selectionManager.selectionMode!=="multiple")switch(T.key){case"ArrowLeft":{var B,w;T.preventDefault();let E=e.selectedKey!=null?(B=d.getKeyAbove)===null||B===void 0?void 0:B.call(d,e.selectedKey):(w=d.getFirstKey)===null||w===void 0?void 0:w.call(d);E&&e.setSelectedKey(E);break}case"ArrowRight":{var M,A;T.preventDefault();let E=e.selectedKey!=null?(M=d.getKeyBelow)===null||M===void 0?void 0:M.call(d,e.selectedKey):(A=d.getFirstKey)===null||A===void 0?void 0:A.call(d);E&&e.setSelectedKey(E);break}}},"onKeyDown"),{typeSelectProps:m}=eD({keyboardDelegate:d,selectionManager:e.selectionManager,onTypeSelect(T){e.setSelectedKey(T)}}),{isInvalid:g,validationErrors:O,validationDetails:b}=e.displayValidation,{labelProps:y,fieldProps:$,descriptionProps:v,errorMessageProps:S}=$t({...t,labelElementType:"span",isInvalid:g,errorMessage:t.errorMessage||O});m.onKeyDown=m.onKeyDownCapture,delete m.onKeyDownCapture,e.selectionManager.selectionMode==="multiple"&&(m={});let x=yt(t,{labelable:!0}),C=ne(m,f,$),Q=Ie();return a0.set(e,{isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s}),{labelProps:{...y,onClick:()=>{if(!t.isDisabled){var T;(T=n.current)===null||T===void 0||T.focus(),Mm("keyboard")}}},triggerProps:ne(x,{...C,isDisabled:i,onKeyDown:vr(C.onKeyDown,p,t.onKeyDown),onKeyUp:t.onKeyUp,"aria-labelledby":[Q,C["aria-labelledby"],C["aria-label"]&&!C["aria-labelledby"]?C.id:null].filter(Boolean).join(" "),onFocus(T){e.isFocused||(t.onFocus&&t.onFocus(T),t.onFocusChange&&t.onFocusChange(!0),e.setFocused(!0))},onBlur(T){e.isOpen||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:Q},menuProps:{...h,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[$["aria-labelledby"],C["aria-label"]&&!$["aria-labelledby"]?C.id:null].filter(Boolean).join(" ")},descriptionProps:v,errorMessageProps:S,isInvalid:g,validationErrors:O,validationDetails:b,hiddenSelectProps:{isDisabled:i,name:a,label:t.label,state:e,triggerRef:n,form:o}}}u(GF,"$58aed456727eb0f3$export$e64b2f635402ca43");function _F(t,e,n){let r=a0.get(e)||{},{autoComplete:i,name:l=r.name,form:a=r.form,isDisabled:o=r.isDisabled}=t,{validationBehavior:s,isRequired:c}=r,{visuallyHiddenProps:d}=Pd({style:{position:"fixed",top:0,left:0}});Sr(t.selectRef,e.defaultValue,e.setValue),ss({validationBehavior:s,focus:()=>{var m;return(m=n.current)===null||m===void 0?void 0:m.focus()}},e,t.selectRef);let f=e.setValue,h=(0,wp.element.useCallback)(m=>{m.target.multiple?f(Array.from(m.target.selectedOptions,g=>g.value)):f(m.currentTarget.value)},[f]);var p;return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:i,disabled:o,multiple:e.selectionManager.selectionMode==="multiple",required:s==="native"&&c,name:l,form:a,value:(p=e.value)!==null&&p!==void 0?p:"",onChange:h,onInput:h}}}u(_F,"$bdd25dc72710631f$export$f809e80f58e251d1");function HF(t){let{state:e,triggerRef:n,label:r,name:i,form:l,isDisabled:a}=t,o=(0,wp.element.useRef)(null),s=(0,wp.element.useRef)(null),{containerProps:c,selectProps:d}=_F({...t,selectRef:e.collection.size<=300?o:s},e,n);if(e.collection.size<=300)return wp.element.createElement("div",{...c,"data-testid":"hidden-select-container"},wp.element.createElement("label",null,r,wp.element.createElement("select",{...d,ref:o},wp.element.createElement("option",null),[...e.collection.getKeys()].map(f=>{let h=e.collection.getItem(f);if(h&&h.type==="item")return wp.element.createElement("option",{key:h.key,value:h.key},h.textValue)}))));if(i){let f=a0.get(e)||{},{validationBehavior:h}=f,p=Array.isArray(e.value)?e.value:[e.value];p.length===0&&(p=[null]);let m=p.map((g,O)=>{let b={type:"hidden",autoComplete:d.autoComplete,name:i,form:l,disabled:a,value:g??""};return h==="native"?wp.element.createElement("input",{key:O,...b,ref:O===0?s:null,style:{display:"none"},type:"text",required:O===0?d.required:!1,onChange:()=>{}}):wp.element.createElement("input",{key:O,...b,ref:O===0?s:null})});return wp.element.createElement(wp.element.Fragment,null,m)}return null}u(HF,"$bdd25dc72710631f$export$cbd84cdb2e668835");function JF(t){let e=yt(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}u(JF,"$f4b273590fab9f93$export$52210f68a14655d0");function eI(t,e,n){let{labelProps:r,inputProps:i,isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}=Sx(t,e,n);return{labelProps:r,inputProps:{...i,role:"switch",checked:l},isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}}u(eI,"$b418ec0c85c52f27$export$d853f7095ae95f88");var tI=Object.defineProperty,z2=u((t,e)=>tI(t,"name",{value:e,configurable:!0}),"l$k");const nI=z2((t,e=!1)=>{if(e===!1)return`[[${t}]]`;let n="";for(const r in e){const i=e[r];n+=`::${r}=${typeof i=="object"?JSON.stringify(i):i}`}return`[[${t}${n}]]`},"dynamicValueToString"),Z2=z2(t=>{if(typeof t!="string")return!1;const e=t.replace("[[","").replace("]]","").split("::");return e.length===0?!1:e.reduce((n,r,i)=>{if(i===0)return n;const l=r.split("=");return{...n,fields:{...n.fields,[l[0]]:l[1]}}},{type:e[0],settings:{}})},"stringToDynamicValue");var rI=Object.defineProperty,o0=u((t,e)=>rI(t,"name",{value:e,configurable:!0}),"r$e");const iI=["color-picker","conditional-panel","date-picker","number","text"],X2=/\[\[((?:(?!\]\]).)+\]?)\]\]/g,j2=o0(t=>typeof t=="string"?Array.from(t.matchAll(X2),e=>e[1]):[],"getDynamicStrings"),s0={"color-picker":{mode:{default:"replace",supported:["replace"]},types:["color"]},"conditional-panel":{mode:{default:"replace",supported:["replace","insert"],types:["text","date","color","number"]},types:["color"]},"date-picker":{mode:{default:"replace",supported:["replace"]},types:["date"]},number:{mode:{default:"replace",supported:["replace"]},types:["number"]},text:{mode:{default:"insert",supported:["insert","replace"]},types:["text","date","color","number"]}},lI=o0((t,e)=>s0[t].mode.supported.includes(e)?e:s0[t].mode.default,"getMode"),aI=o0((t,e,{dynamic:n,type:r})=>{const i=yr().dynamics;return iI.includes(r)?{getTypes:()=>n.types??s0[r].types,getMode:()=>lI(r,n.mode??!1),getCategories:()=>n.categories??Object.keys(i.categories),getList:()=>i.values,getAll:()=>j2(t).map(Z2),getLabel:l=>i.values[l]?i.values[l].label:l,stringify:nI,parse:Z2,hasValues:()=>j2(t).length!==0,setValue:l=>e(l)}:!1},"dynamicValuesAPI");var oI=Object.defineProperty,di=u((t,e)=>oI(t,"name",{value:e,configurable:!0}),"e$5");const fi=di(()=>(Date.now()*1e3+Math.random()*1e3).toString(16).replace(/\./g,"").padEnd(14,"0"),"uniqid"),On=di((t,e=!1)=>{if(Array.isArray(t)||typeof t=="object")return t;if(t===""&&e)return e;try{return JSON.parse(t)}catch{return{}}},"initJSON"),q2=di(t=>t instanceof Set?t:Array.isArray(t)?new Set(t):t.startsWith("[")&&t.endsWith("]")?On(t,new Set):new Set(t.split(",")),"initSet"),rl=di(t=>Object.keys(t).map(e=>t[e].choices?{...t[e],key:t[e].name,label:t[e].name,choices:Object.keys(t[e].choices).map(n=>({value:n,label:t[e].choices[n]}))}:{value:e,label:t[e]}),"getOptions"),W2=di((t,e)=>e.filter(n=>n.value===t)[0]??!1,"getOption"),sI=di((t,e)=>JSON.stringify(t)===JSON.stringify(e),"areSameObjects"),u0=di(t=>JSON.parse(JSON.stringify(t)),"deepCopy"),uI=di(()=>({dispatcher:Y2,init:K2}),"getRepeaterHelpers");var cI=Object.freeze({__proto__:null,areSameObjects:sI,deepCopy:u0,getOption:W2,getOptions:rl,getRepeaterHelpers:uI,initJSON:On,initSet:q2,uniqid:fi}),dI=Object.defineProperty,c0=u((t,e)=>dI(t,"name",{value:e,configurable:!0}),"a$i");const Y2=c0((t,e,n)=>(r,i)=>{switch(i.callback&&setTimeout(i.callback),i.type){case"add":return r.length>=e?r:[...r,{key:fi(),...i.data??t}];case"insert":return r.length>=e?r:[...r.slice(0,i.position),{key:fi(),...i.data??t},...r.slice(i.position)];case"remove":return[...r.slice(0,i.item),...r.slice(i.item+1)];case"update":return r[i.item][i.control]=i.value,[...r];case"clone":return r.length>=e?r:[...r,{...d0(i.item,n),key:fi()}];case"clear":return[];case"bulkCheck":return r.map(l=>({...l,_bulkCheckbox:!0}));case"bulkUncheck":return r.map(l=>({...l,_bulkCheckbox:!1}));case"bulkUpdate":return r.map(l=>l._bulkCheckbox===!0?{...l,[i.control]:i.value}:l);case"bulkRemove":return r.filter(l=>l._bulkCheckbox!==!0);default:return r}},"repeaterDispatcher"),d0=c0((t,e)=>{if(typeof e?.clone?.exclude!="object")return t;const n={...t};return Object.keys(e.clone.exclude).map(r=>{const i=e.clone.exclude[r];i===!0&&delete n[r],typeof i=="object"&&(n[r]=Array.isArray(n[r])?n[r].map(l=>d0(l,{clone:{exclude:i}})):d0(n[r],{clone:{exclude:i}}))}),n},"formatClone"),K2=c0((t,e)=>{try{const n=Array.isArray(t)?t:JSON.parse(t);return Array.isArray(n)?n:[e]}catch{return[{key:fi(),...e}]}},"initDispatcher"),se=wp.element.forwardRef(({children:t,...e},n)=>{const r=wp.element.useRef(),i=n??r,l=e.content??t,a=e.buttonType??"button",o=e.layout?e.layout?`tf-button-${e.layout}`:"":e.type?`tf-button-${e.type}`:"",{buttonProps:s}=kV(e,n),c=e.context?`tf-button-is-${e.context}`:"",d=`tf-button ${o} ${c} ${e.className??""}`,f=e.changeTag&&e.changeTag=="span"?"span":"button";return wp.element.createElement(f,{className:d,style:e.style,...s,onClick:h=>{s.onClick(h),aa("buttonPressed",{name:e.name??!1,props:e,event:h})},ref:i,type:a},e.contentVisuallyHidden?wp.element.createElement(gn,null,l):l)});var fI=Object.defineProperty,hI=u((t,e)=>fI(t,"name",{value:e,configurable:!0}),"i$p");const we=hI(({descriptionProps:t,parent:e,children:n,...r})=>{const i=e?.descriptionVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("div",{className:"tf-description",...t},l))},"Description");var pI=Object.defineProperty,mI=u((t,e)=>pI(t,"name",{value:e,configurable:!0}),"t$d");const Os=mI(({title:t,children:e,...n})=>{const r=wp.element.useRef(),{dialogProps:i}=wF(n,r);return wp.element.createElement("div",{className:"tf-dialog",...i,ref:r},t&&wp.element.createElement(Zd,{level:4},t),wp.element.createElement("div",{className:"tf-dialog-content"},e))},"Dialog");var gI=Object.defineProperty,U2=u((t,e)=>gI(t,"name",{value:e,configurable:!0}),"l$i");const G2=U2(t=>{const[e,n]=wp.element.useState(!0);wp.element.useEffect(()=>{t.isOpen!==e&&n(t.isOpen)},[t.isOpen]);const r=U2(()=>{n(!e),t.onChange&&t.onChange(!e)},"toggle");let i="tf-panel";return i+=` tf-panel-${e?"open":"closed"}`,i+=t.className?` ${t.className}`:"",i+=t.class?` ${t.class}`:"",i+=t.footer?"":" tf-panel-no-footer",wp.element.createElement("div",{className:i,"data-status":e?"open":"closed"},wp.element.createElement(se,{className:"tf-panel-header",type:"action",onClick:r},wp.element.createElement("div",{className:"tf-panel-header-left"},t.headerLeft?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerLeft):null,t.title?wp.element.createElement("div",{className:"tf-panel-header-title"},wp.element.isValidElement(t.title)?t.title:wp.element.createElement("strong",null,t.title)):null),wp.element.createElement("div",{className:"tf-panel-header-right"},t.headerRight?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerRight):null,wp.element.createElement("span",{className:"tf-panel-arrow"}))),e||t?.behavior==="hide"?wp.element.createElement("div",{className:"tf-panel-content"},t.children):null,t.footer?wp.element.createElement("div",{className:"tf-panel-footer"},t.footer):null)},"ExpandablePanel");var OI=Object.defineProperty,bI=u((t,e)=>OI(t,"name",{value:e,configurable:!0}),"t$c");const xe=bI(({labelProps:t,parent:e,children:n,...r})=>{const i=e?.labelVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("label",{className:"tf-label",...t,htmlFor:e?.name??""},l))},"Label");var yI=Object.defineProperty,vI=u((t,e)=>yI(t,"name",{value:e,configurable:!0}),"i$o");const f0=vI(({item:t,state:e})=>{const n=wp.element.useRef(),{optionProps:r,isSelected:i,isFocused:l,isDisabled:a}=uF({key:t.key},e,n),{focusProps:o}=is();let s="tf-list-box-option";return i&&(s=s+=" tf-list-box-option-selected"),a&&(s=s+=" tf-list-box-option-disabled"),l&&(s=s+=" tf-list-box-option-focus"),wp.element.createElement("li",{...ne(r,o),ref:n,className:s},t.rendered)},"Option");var $I=Object.defineProperty,wI=u((t,e)=>$I(t,"name",{value:e,configurable:!0}),"a$f");const xI=wI(({section:t,state:e})=>{const{itemProps:n,headingProps:r,groupProps:i}=cF({heading:t.rendered,"aria-label":t["aria-label"]}),{separatorProps:l}=JF({elementType:"li"}),a=t.key===e.collection.getFirstKey();return wp.element.createElement(wp.element.Fragment,null,!a&&wp.element.createElement("li",{className:"tf-list-box-section-separator",...l}),wp.element.createElement("li",{className:"tf-list-box-section",...n},t.rendered&&wp.element.createElement("span",{...r},t.rendered),wp.element.createElement("ul",{...i},[...t.childNodes].map(o=>wp.element.createElement(f0,{key:o.key??o.name,item:o,state:e})))))},"Section");var SI=Object.defineProperty,CI=u((t,e)=>SI(t,"name",{value:e,configurable:!0}),"l$h");const Nd=CI(t=>{const e=wp.element.useRef(),{listBoxRef:n=e,state:r}=t,{listBoxProps:i}=iD(t,r,n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("ul",{...i,ref:n,className:"tf-list-box"},["loading","filtering"].includes(t?.loadingState)?wp.element.createElement(f0,{key:"_loading",state:r,item:{rendered:"Loading...",isDisabled:!0},shouldUseVirtualFocus:!0}):[...r.collection].map(l=>l.type==="section"?wp.element.createElement(xI,{key:l.key??l.level,section:l,state:r,shouldUseVirtualFocus:!0}):wp.element.createElement(f0,{key:l.key??l.name,item:l,state:r,shouldUseVirtualFocus:!0}))),wp.element.createElement(fs,{onDismiss:r.close}))},"ListBox");var kI=Object.defineProperty,DI=u((t,e)=>kI(t,"name",{value:e,configurable:!0}),"a$d");const PI=DI(({state:t,children:e,...n})=>{const r=wp.element.useContext(Oo),i=wp.element.useRef(null),{modalProps:l,underlayProps:a}=UN(n,t,i);return wp.element.createElement(Gk,{portalContainer:r.portalContainer},wp.element.createElement("div",{className:r.wrapper},wp.element.createElement("div",{className:"tf-modal",...a,style:{zIndex:1e6}},wp.element.createElement("div",{className:"tf-modal-container",ref:i,...l},e))))},"Modal");function Ea(t,e,n){return e!=null&&t.compare(e)<0||n!=null&&t.compare(n)>0}u(Ea,"$f62d864046160412$export$eac50920cf2fd59a");function h0(t,e,n,r,i){let l={};for(let o in e)l[o]=Math.floor(e[o]/2),l[o]>0&&e[o]%2===0&&l[o]--;let a=il(t,e,n).subtract(l);return bs(t,a,e,n,r,i)}u(h0,"$f62d864046160412$export$f4a51ff076cc9a09");function il(t,e,n,r,i){let l=t;return e.years?l=IR(t):e.months?l=Gi(t):e.weeks&&(l=Ko(t,n)),bs(t,l,e,n,r,i)}u(il,"$f62d864046160412$export$144a00ba6044eb9");function p0(t,e,n,r,i){let l={...e};l.days?l.days--:l.weeks?l.weeks--:l.months?l.months--:l.years&&l.years--;let a=il(t,e,n).subtract(l);return bs(t,a,e,n,r,i)}u(p0,"$f62d864046160412$export$530edbfc915b2b04");function bs(t,e,n,r,i,l){if(i&&t.compare(i)>=0){let a=Zm(e,il(vt(i),n,r));a&&(e=a)}if(l&&t.compare(l)<=0){let a=zm(e,p0(vt(l),n,r));a&&(e=a)}return e}u(bs,"$f62d864046160412$export$5bb865b12696a77d");function hi(t,e,n){if(e){let r=Zm(t,vt(e));r&&(t=r)}if(n){let r=zm(t,vt(n));r&&(t=r)}return t}u(hi,"$f62d864046160412$export$4f5203c0d889109e");function _2(t,e,n){if(!n)return t;for(;t.compare(e)>=0&&n(t);)t=t.subtract({days:1});return t.compare(e)>=0?t:null}u(_2,"$f62d864046160412$export$a1d3911297b952d7");function H2(t){let e=(0,wp.element.useMemo)(()=>new Rt(t.locale),[t.locale]),n=(0,wp.element.useMemo)(()=>e.resolvedOptions(),[e]),{locale:r,createCalendar:i,visibleDuration:l={months:1},minValue:a,maxValue:o,selectionAlignment:s,isDateUnavailable:c,pageBehavior:d="visible",firstDayOfWeek:f}=t,h=(0,wp.element.useMemo)(()=>i(n.calendar),[i,n.calendar]);var p;let[m,g]=je(t.value,(p=t.defaultValue)!==null&&p!==void 0?p:null,t.onChange),O=(0,wp.element.useMemo)(()=>m?Ne(vt(m),h):null,[m,h]),b=(0,wp.element.useMemo)(()=>m&&"timeZone"in m?m.timeZone:n.timeZone,[m,n.timeZone]),y=(0,wp.element.useMemo)(()=>t.focusedValue?hi(Ne(vt(t.focusedValue),h),a,o):void 0,[t.focusedValue,h,a,o]),$=(0,wp.element.useMemo)(()=>hi(t.defaultFocusedValue?Ne(vt(t.defaultFocusedValue),h):O||Ne(Cr(b),h),a,o),[t.defaultFocusedValue,O,b,h,a,o]),[v,S]=je(y,$,t.onFocusChange),[x,C]=(0,wp.element.useState)(()=>{switch(s){case"start":return il(v,l,r,a,o);case"end":return p0(v,l,r,a,o);case"center":default:return h0(v,l,r,a,o)}}),[Q,T]=(0,wp.element.useState)(t.autoFocus||!1),B=(0,wp.element.useMemo)(()=>{let F={...l};return F.days?F.days--:F.days=-1,x.add(F)},[x,l]),[w,M]=(0,wp.element.useState)(h);if(!sd(h,w)){let F=Ne(v,h);C(h0(F,l,r,a,o)),S(F),M(h)}Ea(v,a,o)?S(hi(v,a,o)):v.compare(x)<0?C(p0(v,l,r,a,o)):v.compare(B)>0&&C(il(v,l,r,a,o));function A(F){F=hi(F,a,o),S(F)}u(A,"focusCell");function E(F){if(!t.isDisabled&&!t.isReadOnly){let N=F;if(N===null){g(null);return}if(N=hi(N,a,o),N=_2(N,x,c),!N)return;N=Ne(N,m?.calendar||new tt),m&&"hour"in m?g(m.set(N)):g(N)}}u(E,"setValue");let I=(0,wp.element.useMemo)(()=>O?c&&c(O)?!0:Ea(O,a,o):!1,[O,c,a,o]),D=t.isInvalid||t.validationState==="invalid"||I,P=D?"invalid":null,R=(0,wp.element.useMemo)(()=>d==="visible"?l:m0(l),[d,l]);var L,k;return{isDisabled:(L=t.isDisabled)!==null&&L!==void 0?L:!1,isReadOnly:(k=t.isReadOnly)!==null&&k!==void 0?k:!1,value:O,setValue:E,visibleRange:{start:x,end:B},minValue:a,maxValue:o,focusedDate:v,timeZone:b,validationState:P,isValueInvalid:D,setFocusedDate(F){A(F),T(!0)},focusNextDay(){A(v.add({days:1}))},focusPreviousDay(){A(v.subtract({days:1}))},focusNextRow(){l.days?this.focusNextPage():(l.weeks||l.months||l.years)&&A(v.add({weeks:1}))},focusPreviousRow(){l.days?this.focusPreviousPage():(l.weeks||l.months||l.years)&&A(v.subtract({weeks:1}))},focusNextPage(){let F=x.add(R);S(hi(v.add(R),a,o)),C(il(bs(v,F,R,r,a,o),R,r))},focusPreviousPage(){let F=x.subtract(R);S(hi(v.subtract(R),a,o)),C(il(bs(v,F,R,r,a,o),R,r))},focusSectionStart(){l.days?A(x):l.weeks?A(Ko(v,r)):(l.months||l.years)&&A(Gi(v))},focusSectionEnd(){l.days?A(B):l.weeks?A(ZR(v,r)):(l.months||l.years)&&A(ma(v))},focusNextSection(F){if(!F&&!l.days){A(v.add(m0(l)));return}l.days?this.focusNextPage():l.weeks?A(v.add({months:1})):(l.months||l.years)&&A(v.add({years:1}))},focusPreviousSection(F){if(!F&&!l.days){A(v.subtract(m0(l)));return}l.days?this.focusPreviousPage():l.weeks?A(v.subtract({months:1})):(l.months||l.years)&&A(v.subtract({years:1}))},selectFocusedDate(){c&&c(v)||E(v)},selectDate(F){E(F)},isFocused:Q,setFocused:T,isInvalid(F){return Ea(F,a,o)},isSelected(F){return O!=null&&Ue(F,O)&&!this.isCellDisabled(F)&&!this.isCellUnavailable(F)},isCellFocused(F){return Q&&v&&Ue(F,v)},isCellDisabled(F){return t.isDisabled||F.compare(x)<0||F.compare(B)>0||this.isInvalid(F)},isCellUnavailable(F){return t.isDateUnavailable?t.isDateUnavailable(F):!1},isPreviousVisibleRangeInvalid(){let F=x.subtract({days:1});return Ue(F,x)||this.isInvalid(F)},isNextVisibleRangeInvalid(){let F=B.add({days:1});return Ue(F,B)||this.isInvalid(F)},getDatesInWeek(F,N=x){let z=N.add({weeks:F}),G=[];z=Ko(z,r,f);let le=Fm(z,r,f);for(let ie=0;ie0&&(m="start")}let g=(0,wp.element.useRef)(null),[O,b]=(0,wp.element.useState)(null),y=(0,wp.element.useMemo)(()=>Zm(o,O?.start),[o,O]),$=(0,wp.element.useMemo)(()=>zm(s,O?.end),[s,O]),v=H2({...c,value:d&&d.start,createCalendar:i,locale:l,visibleDuration:a,minValue:y,maxValue:$,selectionAlignment:t.selectionAlignment||m}),S=u(P=>{if(P&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const R=eP(P,v,-1),L=eP(P,v,1);g.current={start:R,end:L},b(g.current)}else g.current=null,b(null)},"updateAvailableRange"),[x,C]=(0,wp.element.useState)(v.visibleRange);(!Nm(v.visibleRange.start,x.start)||!Nm(v.visibleRange.end,x.end))&&(S(h),C(v.visibleRange));let Q=u(P=>{P?(p(P),S(P)):(p(null),S(null))},"setAnchorDate"),T=h?g0(h,v.focusedDate):d&&g0(d.start,d.end),B=u(P=>{if(t.isReadOnly)return;const R=hi(P,y,$),L=_2(R,v.visibleRange.start,t.isDateUnavailable);if(L)if(!h)Q(L);else{let k=g0(h,L);k&&f({start:J2(k.start,d?.start),end:J2(k.end,d?.end)}),Q(null)}},"selectDate"),[w,M]=(0,wp.element.useState)(!1),{isDateUnavailable:A}=t,E=(0,wp.element.useMemo)(()=>!d||h?!1:A&&(A(d.start)||A(d.end))?!0:Ea(d.start,o,s)||Ea(d.end,o,s),[A,d,h,o,s]),I=t.isInvalid||t.validationState==="invalid"||E;return{...v,value:d,setValue:f,anchorDate:h,setAnchorDate:Q,highlightedRange:T,validationState:I?"invalid":null,isValueInvalid:I,selectFocusedDate(){B(v.focusedDate)},selectDate:B,highlightDate(P){h&&v.setFocusedDate(P)},isSelected(P){return!!(T&&P.compare(T.start)>=0&&P.compare(T.end)<=0&&!v.isCellDisabled(P)&&!v.isCellUnavailable(P))},isInvalid(P){var R,L;return v.isInvalid(P)||Ea(P,(R=g.current)===null||R===void 0?void 0:R.start,(L=g.current)===null||L===void 0?void 0:L.end)},isDragging:w,setDragging:M}}u(EI,"$9a36b6ba2fb1a7c5$export$9a987164d97ecc90");function g0(t,e){return!t||!e?null:(e.compare(t)<0&&([t,e]=[e,t]),{start:vt(t),end:vt(e)})}u(g0,"$9a36b6ba2fb1a7c5$var$makeRange");function J2(t,e){return t=Ne(t,e?.calendar||new tt),e&&"hour"in e?e.set(t):t}u(J2,"$9a36b6ba2fb1a7c5$var$convertValue");function eP(t,e,n){let r=t.add({days:n});for(;(n<0?r.compare(e.visibleRange.start)>=0:r.compare(e.visibleRange.end)<=0)&&!e.isCellUnavailable(r);)r=r.add({days:n});if(e.isCellUnavailable(r))return r.add({days:-n})}u(eP,"$9a36b6ba2fb1a7c5$var$nextUnavailableDate");const wv=class wv{*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(e){let n=this.keyMap.get(e);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return n?.childNodes||[]}constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=u(o=>{if(this.keyMap.set(o.key,o),o.childNodes&&o.type==="section")for(let s of o.childNodes)n(s)},"visit");for(let o of e)n(o);let r=null,i=0,l=0;for(let[o,s]of this.keyMap)r?(r.nextKey=o,s.prevKey=r.key):(this.firstKey=o,s.prevKey=void 0),s.type==="item"&&(s.index=i++),(s.type==="section"||s.type==="item")&&l++,r=s,r.nextKey=void 0;this._size=l;var a;this.lastKey=(a=r?.key)!==null&&a!==void 0?a:null}};u(wv,"$a02d57049d202695$export$d085fb9e920b5ca7");let ys=wv;const bp=class bp extends Set{constructor(e,n,r){super(e),e instanceof bp?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};u(bp,"$e40ea825a81a3709$export$52baac22726c72bf");let En=bp;function TI(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}u(TI,"$7af3f5b51489e0b5$var$equalSets");function AI(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:l="all"}=t,a=(0,wp.element.useRef)(!1),[,o]=(0,wp.element.useState)(!1),s=(0,wp.element.useRef)(null),c=(0,wp.element.useRef)(null),[,d]=(0,wp.element.useState)(null),f=(0,wp.element.useMemo)(()=>tP(t.selectedKeys),[t.selectedKeys]),h=(0,wp.element.useMemo)(()=>tP(t.defaultSelectedKeys,new En),[t.defaultSelectedKeys]),[p,m]=je(f,h,t.onSelectionChange),g=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[O,b]=(0,wp.element.useState)(i);i==="replace"&&O==="toggle"&&typeof p=="object"&&p.size===0&&b("replace");let y=(0,wp.element.useRef)(i);return(0,wp.element.useEffect)(()=>{i!==y.current&&(b(i),y.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:O,setSelectionBehavior:b,get isFocused(){return a.current},setFocused($){a.current=$,o($)},get focusedKey(){return s.current},get childFocusStrategy(){return c.current},setFocusedKey($,v="first"){s.current=$,c.current=v,d($)},selectedKeys:p,setSelectedKeys($){(r||!TI($,p))&&m($)},disabledKeys:g,disabledBehavior:l}}u(AI,"$7af3f5b51489e0b5$export$253fe78d46329472");function tP(t,e){return t?t==="all"?"all":new En(t):e}u(tP,"$7af3f5b51489e0b5$var$convertSelection");const yp=class yp{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&t0(this.collection,i,e)<0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&t0(this.collection,i,e)>0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new En([n],n,n);else{let a=this.state.selectedKeys;var i;let o=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new En(a,o,n);var l;for(let s of this.getKeyRange(o,(l=a.currentKey)!==null&&l!==void 0?l:n))r.delete(s);for(let s of this.getKeyRange(n,o))this.canSelectItem(s)&&r.add(s)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),i=this.collection.getItem(n);return r&&i?t0(this.collection,r,i)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let i=[],l=e;for(;l!=null;){let a=this.collection.getItem(l);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(l),l===n)return i;l=this.collection.getKeyAfter(l)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new En(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new En([n],n,n):new En;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new En;for(let r of e){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=[],n=u(r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);a?.type==="item"&&e.push(r);var l;a?.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((l=(i=oF(Rd(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&l!==void 0?l:null)}r=this.collection.getKeyAfter(r)}},"addKeys");return n(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new En)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=this.collection.getItem(e);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(e){var n,r;return!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))===null||n===void 0?void 0:n.props}withCollection(e){return new yp(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,n,r){this.collection=e,this.state=n;var i;this.allowsCellSelection=(i=r?.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null}};u(yp,"$d496c0a20b6e58ec$export$6c8a5aaad13c9852");let O0=yp;function b0(t){let{filter:e,layoutDelegate:n}=t,r=AI(t),i=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=(0,wp.element.useCallback)(c=>e?new ys(e(c)):new ys(c),[e]),a=(0,wp.element.useMemo)(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),o=aF(t,l,a),s=(0,wp.element.useMemo)(()=>new O0(o,r,{layoutDelegate:n}),[o,r,n]);return QI(o,s),{collection:o,disabledKeys:i,selectionManager:s}}u(b0,"$e72dd72e1c76a225$export$2f645645f7bca764");function QI(t,e){const n=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){const d=n.current.getItem(e.focusedKey),f=[...n.current.getKeys()].map(b=>{const y=n.current.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null),h=[...t.getKeys()].map(b=>{const y=t.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null);var r,i;const p=((r=f?.length)!==null&&r!==void 0?r:0)-((i=h?.length)!==null&&i!==void 0?i:0);var l,a,o;let m=Math.min(p>1?Math.max(((l=d?.index)!==null&&l!==void 0?l:0)-p+1,0):(a=d?.index)!==null&&a!==void 0?a:0,((o=h?.length)!==null&&o!==void 0?o:0)-1),g=null,O=!1;for(;m>=0;){if(!e.isDisabled(h[m].key)){g=h[m];break}if(m((s=d?.index)!==null&&s!==void 0?s:0)&&(m=(c=d?.index)!==null&&c!==void 0?c:0),m--}}e.setFocusedKey(g?g.key:null)}n.current=t},[t,e])}u(QI,"$e72dd72e1c76a225$var$useFocusedKeyReset");function MI(t){var e;let[n,r]=je(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),i=(0,wp.element.useMemo)(()=>n!=null?[n]:[],[n]),{collection:l,disabledKeys:a,selectionManager:o}=b0({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:c=>{if(c==="all")return;var d;let f=(d=c.values().next().value)!==null&&d!==void 0?d:null;f===n&&t.onSelectionChange&&t.onSelectionChange(f),r(f)}}),s=n!=null?l.getItem(n):null;return{collection:l,disabledKeys:a,selectionManager:o,selectedKey:n,setSelectedKey:r,selectedItem:s}}u(MI,"$a0d645289fe9b86b$export$e7f05e985daf4b5f");function pi(t){let[e,n]=je(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=(0,wp.element.useCallback)(()=>{n(!0)},[n]),i=(0,wp.element.useCallback)(()=>{n(!1)},[n]),l=(0,wp.element.useCallback)(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:i,toggle:l}}u(pi,"$fc909762b330b746$export$61c6a8c84e605fb6");function nP(t){var e;let{defaultFilter:n,menuTrigger:r="input",allowsEmptyCollection:i=!1,allowsCustomValue:l,shouldCloseOnBlur:a=!0}=t,[o,s]=(0,wp.element.useState)(!1),[c,d]=(0,wp.element.useState)(!1),[f,h]=(0,wp.element.useState)(null),p=u(oe=>{t.onSelectionChange&&t.onSelectionChange(oe),oe===b&&(z(),k())},"onSelectionChange");var m;let{collection:g,selectionManager:O,selectedKey:b,setSelectedKey:y,selectedItem:$,disabledKeys:v}=MI({...t,onSelectionChange:p,items:(m=t.items)!==null&&m!==void 0?m:t.defaultItems}),[S,x]=je(t.inputValue,iP(t.defaultInputValue,b,g)||"",t.onInputChange),[C]=(0,wp.element.useState)(b),[Q]=(0,wp.element.useState)(S),T=g,B=(0,wp.element.useMemo)(()=>t.items!=null||!n?g:BI(g,S,n),[g,S,n,t.items]),[w,M]=(0,wp.element.useState)(B),A=(0,wp.element.useRef)("focus"),I=pi({...t,onOpenChange:u(oe=>{t.onOpenChange&&t.onOpenChange(oe,oe?A.current:void 0),O.setFocused(oe),oe||O.setFocusedKey(null)},"onOpenChange"),isOpen:void 0,defaultOpen:void 0}),D=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";(i||B.size>0||$e&&T.size>0||t.items)&&($e&&!I.isOpen&&t.items===void 0&&s(!0),A.current=ge,h(oe),I.open())},"open"),P=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";!(i||B.size>0||$e&&T.size>0||t.items)&&!I.isOpen||($e&&!I.isOpen&&t.items===void 0&&s(!0),I.isOpen||(A.current=ge),L(oe))},"toggle"),R=(0,wp.element.useCallback)(()=>{M(o?T:B)},[o,T,B]),L=(0,wp.element.useCallback)((oe=null)=>{I.isOpen&&R(),h(oe),I.toggle()},[I,R]),k=(0,wp.element.useCallback)(()=>{I.isOpen&&(R(),I.close())},[I,R]),[F,N]=(0,wp.element.useState)(S),z=u(()=>{var oe,ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";N($e),x($e)},"resetInputValue");var G,le;let ie=(0,wp.element.useRef)((le=(G=t.selectedKey)!==null&&G!==void 0?G:t.defaultSelectedKey)!==null&&le!==void 0?le:null);var me;let ve=(0,wp.element.useRef)(b!=null&&(me=(e=g.getItem(b))===null||e===void 0?void 0:e.textValue)!==null&&me!==void 0?me:"");(0,wp.element.useEffect)(()=>{var oe;c&&(B.size>0||i)&&!I.isOpen&&S!==F&&r!=="manual"&&D(null,"input"),!o&&!i&&I.isOpen&&B.size===0&&k(),b!=null&&b!==ie.current&&k(),S!==F&&(O.setFocusedKey(null),s(!1),S===""&&(t.inputValue===void 0||t.selectedKey===void 0)&&y(null)),b!==ie.current&&(t.inputValue===void 0||t.selectedKey===void 0)?z():F!==S&&N(S);var ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";!c&&b!=null&&t.inputValue===void 0&&b===ie.current&&ve.current!==$e&&(N($e),x($e)),ie.current=b,ve.current=$e});let ce=qn({...t,value:(0,wp.element.useMemo)(()=>({inputValue:S,selectedKey:b}),[S,b])}),K=u(()=>{l&&b==null?W():Z()},"revert"),W=u(()=>{ie.current=null,y(null),k()},"commitCustomValue"),Z=u(()=>{if(t.selectedKey!==void 0&&t.inputValue!==void 0){var oe,ge;(oe=t.onSelectionChange)===null||oe===void 0||oe.call(t,b);var $e;let Zi=b!=null&&($e=(ge=g.getItem(b))===null||ge===void 0?void 0:ge.textValue)!==null&&$e!==void 0?$e:"";N(Zi),k()}else z(),k()},"commitSelection");const ee=u(()=>{if(l){var oe,ge;const $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";S===$e?Z():W()}else Z()},"commitValue");let De=u(()=>{I.isOpen&&O.focusedKey!=null?b===O.focusedKey?Z():y(O.focusedKey):ee()},"commit"),qt=(0,wp.element.useRef)(S),ni=u(oe=>{oe?(qt.current=S,r==="focus"&&!t.isReadOnly&&D(null,"focus")):(a&&ee(),S!==qt.current&&ce.commitValidation()),d(oe)},"setFocused"),br=(0,wp.element.useMemo)(()=>I.isOpen?o?T:B:w,[I.isOpen,T,B,o,w]);var la;let q=(la=t.defaultSelectedKey)!==null&&la!==void 0?la:C;var fe;return{...ce,...I,focusStrategy:f,toggle:P,open:D,close:ee,selectionManager:O,selectedKey:b,defaultSelectedKey:q,setSelectedKey:y,disabledKeys:v,isFocused:c,setFocused:ni,selectedItem:$,collection:br,inputValue:S,defaultInputValue:(fe=iP(t.defaultInputValue,q,g))!==null&&fe!==void 0?fe:Q,setInputValue:x,commit:De,revert:K}}u(nP,"$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e");function BI(t,e,n){return new ys(rP(t,t,e,n))}u(BI,"$a9e7382a7d111cb5$var$filterCollection");function rP(t,e,n,r){let i=[];for(let l of e)if(l.type==="section"&&l.hasChildNodes){let a=rP(t,Rd(l,t),n,r);[...a].some(o=>o.type==="item")&&i.push({...l,childNodes:a})}else l.type==="item"&&r(l.textValue,n)?i.push({...l}):l.type!=="item"&&i.push({...l});return i}u(rP,"$a9e7382a7d111cb5$var$filterNodes");function iP(t,e,n){if(t==null){var r,i;if(e!=null)return(i=(r=n.getItem(e))===null||r===void 0?void 0:r.textValue)!==null&&i!==void 0?i:""}return t}u(iP,"$a9e7382a7d111cb5$var$getDefaultInputValue");var lP={};lP={rangeOverflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.maxValue} \u0623\u0648 \u0642\u0628\u0644 \u0630\u0644\u0643.`,rangeReversed:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621 \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0642\u0628\u0644 \u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621.",rangeUnderflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.minValue} \u0623\u0648 \u0628\u0639\u062F \u0630\u0644\u0643.`,unavailableDate:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0645\u062D\u062F\u062F\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629."};var aP={};aP={rangeOverflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.maxValue} \u0438\u043B\u0438 \u043F\u043E-\u0440\u0430\u043D\u043D\u0430.`,rangeReversed:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 \u043F\u0440\u0435\u0434\u0438 \u043A\u0440\u0430\u0439\u043D\u0430\u0442\u0430.",rangeUnderflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.minValue} \u0438\u043B\u0438 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.`,unavailableDate:"\u0418\u0437\u0431\u0440\u0430\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435 \u0435 \u043D\u0430\u043B\u0438\u0447\u043D\u0430."};var oP={};oP={rangeOverflow:t=>`Hodnota mus\xED b\xFDt ${t.maxValue} nebo d\u0159\xEDv\u011Bj\u0161\xED.`,rangeReversed:"Datum zah\xE1jen\xED mus\xED p\u0159edch\xE1zet datu ukon\u010Den\xED.",rangeUnderflow:t=>`Hodnota mus\xED b\xFDt ${t.minValue} nebo pozd\u011Bj\u0161\xED.`,unavailableDate:"Vybran\xE9 datum nen\xED k dispozici."};var sP={};sP={rangeOverflow:t=>`V\xE6rdien skal v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xE6re f\xF8r slutdatoen.",rangeUnderflow:t=>`V\xE6rdien skal v\xE6re ${t.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xE6ngelig."};var uP={};uP={rangeOverflow:t=>`Der Wert muss ${t.maxValue} oder fr\xFCher sein.`,rangeReversed:"Das Startdatum muss vor dem Enddatum liegen.",rangeUnderflow:t=>`Der Wert muss ${t.minValue} oder sp\xE4ter sein.`,unavailableDate:"Das ausgew\xE4hlte Datum ist nicht verf\xFCgbar."};var cP={};cP={rangeOverflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.maxValue} \u03AE \u03C0\u03B1\u03BB\u03B1\u03B9\u03CC\u03C4\u03B5\u03C1\u03B7.`,rangeReversed:"\u0397 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2 \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2.",rangeUnderflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.minValue} \u03AE \u03BC\u03B5\u03C4\u03B1\u03B3\u03B5\u03BD\u03AD\u03C3\u03C4\u03B5\u03C1\u03B7.`,unavailableDate:"\u0397 \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03B7."};var dP={};dP={rangeUnderflow:t=>`Value must be ${t.minValue} or later.`,rangeOverflow:t=>`Value must be ${t.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."};var fP={};fP={rangeOverflow:t=>`El valor debe ser ${t.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xF3n.",rangeUnderflow:t=>`El valor debe ser ${t.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."};var hP={};hP={rangeOverflow:t=>`V\xE4\xE4rtus peab olema ${t.maxValue} v\xF5i varasem.`,rangeReversed:"Alguskuup\xE4ev peab olema enne l\xF5ppkuup\xE4eva.",rangeUnderflow:t=>`V\xE4\xE4rtus peab olema ${t.minValue} v\xF5i hilisem.`,unavailableDate:"Valitud kuup\xE4ev pole saadaval."};var pP={};pP={rangeOverflow:t=>`Arvon on oltava ${t.maxValue} tai sit\xE4 aikaisempi.`,rangeReversed:"Aloitusp\xE4iv\xE4n on oltava ennen lopetusp\xE4iv\xE4\xE4.",rangeUnderflow:t=>`Arvon on oltava ${t.minValue} tai sit\xE4 my\xF6h\xE4isempi.`,unavailableDate:"Valittu p\xE4iv\xE4m\xE4\xE4r\xE4 ei ole k\xE4ytett\xE4viss\xE4."};var mP={};mP={rangeOverflow:t=>`La valeur doit \xEAtre ${t.maxValue} ou ant\xE9rieure.`,rangeReversed:"La date de d\xE9but doit \xEAtre ant\xE9rieure \xE0 la date de fin.",rangeUnderflow:t=>`La valeur doit \xEAtre ${t.minValue} ou ult\xE9rieure.`,unavailableDate:"La date s\xE9lectionn\xE9e n\u2019est pas disponible."};var gP={};gP={rangeOverflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.maxValue} \u05D0\u05D5 \u05DE\u05D5\u05E7\u05D3\u05DD \u05D9\u05D5\u05EA\u05E8.`,rangeReversed:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05D4\u05EA\u05D7\u05DC\u05D4 \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05E0\u05D9 \u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E1\u05D9\u05D5\u05DD.",rangeUnderflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.minValue} \u05D0\u05D5 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.`,unavailableDate:"\u05D4\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E0\u05D1\u05D7\u05E8 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF."};var OP={};OP={rangeOverflow:t=>`Vrijednost mora biti ${t.maxValue} ili ranije.`,rangeReversed:"Datum po\u010Detka mora biti prije datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrijednost mora biti ${t.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."};var bP={};bP={rangeOverflow:t=>`Az \xE9rt\xE9knek ${t.maxValue} vagy kor\xE1bbinak kell lennie.`,rangeReversed:"A kezd\u0151 d\xE1tumnak a befejez\u0151 d\xE1tumn\xE1l kor\xE1bbinak kell lennie.",rangeUnderflow:t=>`Az \xE9rt\xE9knek ${t.minValue} vagy k\xE9s\u0151bbinek kell lennie.`,unavailableDate:"A kiv\xE1lasztott d\xE1tum nem \xE9rhet\u0151 el."};var yP={};yP={rangeOverflow:t=>`Il valore deve essere ${t.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:t=>`Il valore deve essere ${t.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."};var vP={};vP={rangeOverflow:t=>`\u5024\u306F ${t.maxValue} \u4EE5\u4E0B\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u306F\u7D42\u4E86\u65E5\u3088\u308A\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",rangeUnderflow:t=>`\u5024\u306F ${t.minValue} \u4EE5\u4E0A\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,unavailableDate:"\u9078\u629E\u3057\u305F\u65E5\u4ED8\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002"};var $P={};$P={rangeOverflow:t=>`\uAC12\uC740 ${t.maxValue} \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,rangeReversed:"\uC2DC\uC791\uC77C\uC740 \uC885\uB8CC\uC77C \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.",rangeUnderflow:t=>`\uAC12\uC740 ${t.minValue} \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,unavailableDate:"\uC120\uD0DD\uD55C \uB0A0\uC9DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."};var wP={};wP={rangeOverflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.maxValue} arba ankstesn\u0117.`,rangeReversed:"Prad\u017Eios data turi b\u016Bti ankstesn\u0117 nei pabaigos data.",rangeUnderflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.minValue} arba naujesn\u0117.`,unavailableDate:"Pasirinkta data nepasiekiama."};var xP={};xP={rangeOverflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.maxValue} vai agr\u0101kai.`,rangeReversed:"S\u0101kuma datumam ir j\u0101b\u016Bt pirms beigu datuma.",rangeUnderflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.minValue} vai v\u0113l\u0101kai.`,unavailableDate:"Atlas\u012Btais datums nav pieejams."};var SP={};SP={rangeOverflow:t=>`Verdien m\xE5 v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xE5 v\xE6re f\xF8r sluttdatoen.",rangeUnderflow:t=>`Verdien m\xE5 v\xE6re ${t.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."};var CP={};CP={rangeOverflow:t=>`Waarde moet ${t.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:t=>`Waarde moet ${t.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."};var kP={};kP={rangeOverflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.maxValue} lub wcze\u015Bniejsz\u0105.`,rangeReversed:"Data rozpocz\u0119cia musi by\u0107 wcze\u015Bniejsza ni\u017C data zako\u0144czenia.",rangeUnderflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.minValue} lub p\xF3\u017Aniejsz\u0105.`,unavailableDate:"Wybrana data jest niedost\u0119pna."};var DP={};DP={rangeOverflow:t=>`O valor deve ser ${t.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xE0 data final.",rangeUnderflow:t=>`O valor deve ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var PP={};PP={rangeOverflow:t=>`O valor tem de ser ${t.maxValue} ou anterior.`,rangeReversed:"A data de in\xEDcio deve ser anterior \xE0 data de fim.",rangeUnderflow:t=>`O valor tem de ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var EP={};EP={rangeOverflow:t=>`Valoarea trebuie s\u0103 fie ${t.maxValue} sau anterioar\u0103.`,rangeReversed:"Data de \xEEnceput trebuie s\u0103 fie anterioar\u0103 datei de sf\xE2r\u0219it.",rangeUnderflow:t=>`Valoarea trebuie s\u0103 fie ${t.minValue} sau ulterioar\u0103.`,unavailableDate:"Data selectat\u0103 nu este disponibil\u0103."};var TP={};TP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043F\u043E\u0437\u0436\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0434\u0430\u0442\u0435 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u0440\u0430\u043D\u044C\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var AP={};AP={rangeOverflow:t=>`Hodnota mus\xED by\u0165 ${t.maxValue} alebo skor\u0161ia.`,rangeReversed:"D\xE1tum za\u010Diatku mus\xED by\u0165 skor\u0161\xED ako d\xE1tum konca.",rangeUnderflow:t=>`Hodnota mus\xED by\u0165 ${t.minValue} alebo neskor\u0161ia.`,unavailableDate:"Vybrat\xFD d\xE1tum je nedostupn\xFD."};var QP={};QP={rangeOverflow:t=>`Vrednost mora biti ${t.maxValue} ali starej\u0161a.`,rangeReversed:"Za\u010Detni datum mora biti pred kon\u010Dnim datumom.",rangeUnderflow:t=>`Vrednost mora biti ${t.minValue} ali novej\u0161a.`,unavailableDate:"Izbrani datum ni na voljo."};var MP={};MP={rangeOverflow:t=>`Vrednost mora da bude ${t.maxValue} ili starija.`,rangeReversed:"Datum po\u010Detka mora biti pre datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrednost mora da bude ${t.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."};var BP={};BP={rangeOverflow:t=>`V\xE4rdet m\xE5ste vara ${t.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xE5ste vara f\xF6re slutdatumet.",rangeUnderflow:t=>`V\xE4rdet m\xE5ste vara ${t.minValue} eller senare.`,unavailableDate:"Det valda datumet \xE4r inte tillg\xE4ngligt."};var RP={};RP={rangeOverflow:t=>`De\u011Fer, ${t.maxValue} veya \xF6ncesi olmal\u0131d\u0131r.`,rangeReversed:"Ba\u015Flang\u0131\xE7 tarihi biti\u015F tarihinden \xF6nce olmal\u0131d\u0131r.",rangeUnderflow:t=>`De\u011Fer, ${t.minValue} veya sonras\u0131 olmal\u0131d\u0131r.`,unavailableDate:"Se\xE7ilen tarih kullan\u0131lam\u0131yor."};var VP={};VP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u043F\u0456\u0437\u043D\u0456\u0448\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443 \u043C\u0430\u0454 \u043F\u0435\u0440\u0435\u0434\u0443\u0432\u0430\u0442\u0438 \u0434\u0430\u0442\u0456 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u0440\u0430\u043D\u0456\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var NP={};NP={rangeOverflow:t=>`\u503C\u5FC5\u987B\u662F ${t.maxValue} \u6216\u66F4\u65E9\u65E5\u671F\u3002`,rangeReversed:"\u5F00\u59CB\u65E5\u671F\u5FC5\u987B\u65E9\u4E8E\u7ED3\u675F\u65E5\u671F\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u987B\u662F ${t.minValue} \u6216\u66F4\u665A\u65E5\u671F\u3002`,unavailableDate:"\u6240\u9009\u65E5\u671F\u4E0D\u53EF\u7528\u3002"};var FP={};FP={rangeOverflow:t=>`\u503C\u5FC5\u9808\u662F ${t.maxValue} \u6216\u66F4\u65E9\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u671F\u5FC5\u9808\u5728\u7D50\u675F\u65E5\u671F\u4E4B\u524D\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u9808\u662F ${t.minValue} \u6216\u66F4\u665A\u3002`,unavailableDate:"\u6240\u9078\u65E5\u671F\u7121\u6CD5\u4F7F\u7528\u3002"};var IP={};IP={"ar-AE":lP,"bg-BG":aP,"cs-CZ":oP,"da-DK":sP,"de-DE":uP,"el-GR":cP,"en-US":dP,"es-ES":fP,"et-EE":hP,"fi-FI":pP,"fr-FR":mP,"he-IL":gP,"hr-HR":OP,"hu-HU":bP,"it-IT":yP,"ja-JP":vP,"ko-KR":$P,"lt-LT":wP,"lv-LV":xP,"nb-NO":SP,"nl-NL":CP,"pl-PL":kP,"pt-BR":DP,"pt-PT":PP,"ro-RO":EP,"ru-RU":TP,"sk-SK":AP,"sl-SI":QP,"sr-SP":MP,"sv-SE":BP,"tr-TR":RP,"uk-UA":VP,"zh-CN":NP,"zh-TW":FP};function RI(t){return t&&t.__esModule?t.default:t}u(RI,"$parcel$interopDefault");const LP=new dn(RI(IP));function zP(){let t=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return t}u(zP,"$35a22f14a1f04b11$var$getLocale");function Fd(t,e,n,r,i){let l=t!=null&&n!=null&&t.compare(n)>0,a=t!=null&&e!=null&&t.compare(e)<0,o=t!=null&&r?.(t)||!1,s=l||a||o,c=[];if(s){let d=zP(),f=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||LP,h=new Wo(d,f),p=new Rt(d,Br({},i)),m=p.resolvedOptions().timeZone;a&&e!=null&&c.push(h.format("rangeUnderflow",{minValue:p.format(e.toDate(m))})),l&&n!=null&&c.push(h.format("rangeOverflow",{maxValue:p.format(n.toDate(m))})),o&&c.push(h.format("unavailableDate"))}return{isInvalid:s,validationErrors:c,validationDetails:{badInput:o,customError:!1,patternMismatch:!1,rangeOverflow:l,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!s}}}u(Fd,"$35a22f14a1f04b11$export$f18627323ab57ac0");function VI(t,e,n,r,i){var l;let a=Fd((l=t?.start)!==null&&l!==void 0?l:null,e,n,r,i);var o;let s=Fd((o=t?.end)!==null&&o!==void 0?o:null,e,n,r,i),c=Cd(a,s);if(t?.end!=null&&t.start!=null&&t.end.compare(t.start)<0){let d=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||LP;c=Cd(c,{isInvalid:!0,validationErrors:[d.getStringForLocale("rangeReversed",zP())],validationDetails:{...Sd,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return c}u(VI,"$35a22f14a1f04b11$export$80ff8fc0ae339c13");const NI={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},FI={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function Br(t,e){t={...e.shouldForceLeadingZeros?FI:NI,...t};let r=e.granularity||"minute",i=Object.keys(t);var l;let a=i.indexOf((l=e.maxGranularity)!==null&&l!==void 0?l:"year");a<0&&(a=0);let o=i.indexOf(r);if(o<0&&(o=2),a>o)throw new Error("maxGranularity must be greater than granularity");let s=i.slice(a,o+1).reduce((d,f)=>(d[f]=t[f],d),{});return e.hourCycle!=null&&(s.hour12=e.hourCycle===12),s.timeZone=e.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&e.timeZone&&!e.hideTimeZone&&(s.timeZoneName="short"),e.showEra&&a===0&&(s.era="short"),s}u(Br,"$35a22f14a1f04b11$export$7e319ea407e63bc0");function Ta(t){return t&&"hour"in t?t:new Tr}u(Ta,"$35a22f14a1f04b11$export$c5221a78ef73c5e9");function ZP(t,e){if(t===null)return null;if(t)return Ne(t,e)}u(ZP,"$35a22f14a1f04b11$export$61a490a80c552550");function vs(t,e,n,r){if(t)return ZP(t,n);let i=Ne(R3(r??kr()).set({hour:0,minute:0,second:0,millisecond:0}),n);return e==="year"||e==="month"||e==="day"?vt(i):r?i:Pn(i)}u(vs,"$35a22f14a1f04b11$export$66aa2b09de4b1ea5");function y0(t,e){let n=t&&"timeZone"in t?t.timeZone:void 0,r=t&&"minute"in t?"minute":"day";if(t&&e&&!(e in t))throw new Error("Invalid granularity "+e+" for value "+t.toString());let[i,l]=(0,wp.element.useState)([r,n]);t&&(i[0]!==r||i[1]!==n)&&l([r,n]),e||(e=t?r:i[0]);let a=t?n:i[1];return[e,a]}u(y0,"$35a22f14a1f04b11$export$2440da353cedad43");function II(t){let e=pi(t),[n,r]=je(t.value,t.defaultValue||null,t.onChange),[i]=(0,wp.element.useState)(n),l=n||t.placeholderValue||null,[a,o]=y0(l,t.granularity),s=n!=null?n.toDate(o??"UTC"):null,c=a==="hour"||a==="minute"||a==="second";var d;let f=(d=t.shouldCloseOnSelect)!==null&&d!==void 0?d:!0,[h,p]=(0,wp.element.useState)(null),[m,g]=(0,wp.element.useState)(null);if(n&&(h=n,"hour"in n&&(m=n)),l&&!(a in l))throw new Error("Invalid granularity "+a+" for value "+l.toString());let O=n?.calendar.identifier==="gregory"&&n.era==="BC",b=(0,wp.element.useMemo)(()=>({granularity:a,timeZone:o,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:O}),[a,t.hourCycle,t.shouldForceLeadingZeros,o,t.hideTimeZone,O]),{minValue:y,maxValue:$,isDateUnavailable:v}=t,S=(0,wp.element.useMemo)(()=>Fd(n,y,$,v,b),[n,y,$,v,b]),x=qn({...t,value:n,builtinValidation:S}),C=x.displayValidation.isInvalid,Q=t.validationState||(C?"invalid":null),T=u((A,E)=>{r("timeZone"in E?E.set(vt(A)):Pn(A,E)),p(null),g(null),x.commitValidation()},"commitValue"),B=u(A=>{let E=typeof f=="function"?f():f;c?m||E?T(A,m||Ta(t.defaultValue||t.placeholderValue)):p(A):(r(A),x.commitValidation()),E&&e.setOpen(!1)},"selectDate"),w=u(A=>{h&&A?T(h,A):g(A)},"selectTime");var M;return{...x,value:n,defaultValue:(M=t.defaultValue)!==null&&M!==void 0?M:i,setValue:r,dateValue:h,timeValue:m,setDateValue:B,setTimeValue:w,granularity:a,hasTime:c,...e,setOpen(A){!A&&!n&&h&&c&&T(h,m||Ta(t.defaultValue||t.placeholderValue)),e.setOpen(A)},validationState:Q,isInvalid:C,formatValue(A,E){if(!s)return"";let I=Br(E,b);return new Rt(A,I).format(s)},getDateFormatter(A,E){let I={...b,...E},D=Br({},I);return new Rt(A,D)}}}u(II,"$ab5bf3f618090389$export$87194bb378cc3ac2");const LI=new dn({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"\u12D3\u12D3\u12D3\u12D3",month:"\u121A\u121C",day:"\u1240\u1240"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"\u0633\u0646\u0629",month:"\u0634\u0647\u0631",day:"\u064A\u0648\u0645"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bg:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bn:{year:"yyyy",month:"\u09AE\u09BF\u09AE\u09BF",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"\u0633\u0627\u06B5",month:"\u0645\u0627\u0646\u06AF",day:"\u0695\u06C6\u0698"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"\u017A\u017A"},el:{year:"\u03B5\u03B5\u03B5\u03B5",month:"\u03BC\u03BC",day:"\u03B7\u03B7"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"\u0633\u0627\u0644",month:"\u0645\u0627\u0647",day:"\u0631\u0648\u0632"},ff:{year:"hhhh",month:"ll",day:"\xF1\xF1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"\u05E9\u05E0\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",day:"\u05D9\u05D5\u05DD"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xE9\xE9\xE9\xE9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"\u5E74",month:"\u6708",day:"\u65E5"},ka:{year:"\u10EC\u10EC\u10EC\u10EC",month:"\u10D7\u10D7",day:"\u10E0\u10E0"},kk:{year:"\u0436\u0436\u0436\u0436",month:"\u0430\u0430",day:"\u043A\u043A"},kn:{year:"\u0CB5\u0CB5\u0CB5\u0CB5",month:"\u0CAE\u0CBF\u0CAE\u0CC0",day:"\u0CA6\u0CBF\u0CA6\u0CBF"},ko:{year:"\uC5F0\uB3C4",month:"\uC6D4",day:"\uC77C"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"\u0E9B\u0E9B\u0E9B\u0E9B",month:"\u0E94\u0E94",day:"\u0EA7\u0EA7"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"\u0D35\u0D7C\u0D37\u0D02",month:"\u0D2E\u0D3E\u0D38\u0D02",day:"\u0D24\u0D40\u0D2F\u0D24\u0D3F"},ms:{year:"tttt",month:"mm",day:"hh"},nb:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},no:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sv:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"\u0441\u0441\u0441\u0441",month:"\u043C\u043C",day:"\u0440\u0440"},th:{year:"\u0E1B\u0E1B\u0E1B\u0E1B",month:"\u0E14\u0E14",day:"\u0E27\u0E27"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"\u0440\u0440\u0440\u0440",month:"\u043C\u043C",day:"\u0434\u0434"},"zh-CN":{year:"\u5E74",month:"\u6708",day:"\u65E5"},"zh-TW":{year:"\u5E74",month:"\u6708",day:"\u65E5"}},"en");function zI(t,e,n){return t==="era"||t==="dayPeriod"?e:t==="year"||t==="month"||t==="day"?LI.getStringForLocale(t,n):"\u2013\u2013"}u(zI,"$3e3ed55ab2966714$export$d3f5c5e0a5023fa0");const Id={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},XP={year:5,month:2,day:7,hour:2,minute:15,second:15},jP={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function qP(t){let{locale:e,createCalendar:n,hideTimeZone:r,isDisabled:i=!1,isReadOnly:l=!1,isRequired:a=!1,minValue:o,maxValue:s,isDateUnavailable:c}=t,d=t.value||t.defaultValue||t.placeholderValue||null,[f,h]=y0(d,t.granularity),p=h||"UTC";if(d&&!(f in d))throw new Error("Invalid granularity "+f+" for value "+d.toString());let m=(0,wp.element.useMemo)(()=>new Rt(e),[e]),g=(0,wp.element.useMemo)(()=>n(m.resolvedOptions().calendar),[n,m]);var O;let[b,y]=je(t.value,(O=t.defaultValue)!==null&&O!==void 0?O:null,t.onChange),[$]=(0,wp.element.useState)(b),v=(0,wp.element.useMemo)(()=>{var K;return(K=ZP(b,g))!==null&&K!==void 0?K:null},[b,g]),[S,x]=(0,wp.element.useState)(()=>vs(t.placeholderValue,f,g,h)),C=v||S,Q=g.identifier==="gregory"&&C.era==="BC",T=(0,wp.element.useMemo)(()=>{var K;return{granularity:f,maxGranularity:(K=t.maxGranularity)!==null&&K!==void 0?K:"year",timeZone:h,hideTimeZone:r,hourCycle:t.hourCycle,showEra:Q,shouldForceLeadingZeros:t.shouldForceLeadingZeros}},[t.maxGranularity,f,t.hourCycle,t.shouldForceLeadingZeros,h,r,Q]),B=(0,wp.element.useMemo)(()=>Br({},T),[T]),w=(0,wp.element.useMemo)(()=>new Rt(e,B),[e,B]),M=(0,wp.element.useMemo)(()=>w.resolvedOptions(),[w]),A=(0,wp.element.useMemo)(()=>w.formatToParts(new Date).filter(K=>Id[K.type]).reduce((K,W)=>(K[jP[W.type]||W.type]=!0,K),{}),[w]),[E,I]=(0,wp.element.useState)(()=>t.value||t.defaultValue?{...A}:{}),D=(0,wp.element.useRef)(null),P=(0,wp.element.useRef)(g);(0,wp.element.useEffect)(()=>{sd(g,P.current)||(P.current=g,x(K=>Object.keys(E).length>0?Ne(K,g):vs(t.placeholderValue,f,g,h)))},[g,f,E,h,t.placeholderValue]),b&&Object.keys(E).length=Object.keys(A).length?v:S,L=u(K=>{if(t.isDisabled||t.isReadOnly)return;let W=Object.keys(E),Z=Object.keys(A);K==null?(y(null),x(vs(t.placeholderValue,f,g,h)),I({})):W.length===0&&D.current==null||W.length>=Z.length||W.length===Z.length-1&&A.dayPeriod&&!E.dayPeriod&&D.current!=="dayPeriod"?(W.length===0&&(E={...A},I(E)),K=Ne(K,d?.calendar||new tt),y(K)):x(K),D.current=null},"setValue"),k=(0,wp.element.useMemo)(()=>R.toDate(p),[R,p]),F=(0,wp.element.useMemo)(()=>ZI(k,E,w,M,R,g,e,f),[k,E,w,M,R,g,e,f]);A.era&&E.year&&!E.era?(E.era=!0,I({...E})):!A.era&&E.era&&(delete E.era,I({...E}));let N=u(K=>{E[K]=!0,K==="year"&&A.era&&(E.era=!0),I({...E})},"markValid"),z=u((K,W)=>{if(E[K])L(XI(R,K,W,M));else{N(K);let Z=Object.keys(E),ee=Object.keys(A);(Z.length>=ee.length||Z.length===ee.length-1&&A.dayPeriod&&!E.dayPeriod)&&L(R)}},"adjustSegment"),G=(0,wp.element.useMemo)(()=>Fd(b,o,s,c,T),[b,o,s,c,T]),le=qn({...t,value:b,builtinValidation:G}),ie=le.displayValidation.isInvalid,me=t.validationState||(ie?"invalid":null);var ve,ce;return{...le,value:v,defaultValue:(ve=t.defaultValue)!==null&&ve!==void 0?ve:$,dateValue:k,calendar:g,setValue:L,segments:F,dateFormatter:w,validationState:me,isInvalid:ie,granularity:f,maxGranularity:(ce=t.maxGranularity)!==null&&ce!==void 0?ce:"year",isDisabled:i,isReadOnly:l,isRequired:a,increment(K){z(K,1)},decrement(K){z(K,-1)},incrementPage(K){z(K,XP[K]||1)},decrementPage(K){z(K,-(XP[K]||1))},setSegment(K,W){N(K),L(jI(R,K,W,M))},confirmPlaceholder(){if(t.isDisabled||t.isReadOnly)return;let K=Object.keys(E),W=Object.keys(A);K.length===W.length-1&&A.dayPeriod&&!E.dayPeriod&&(E={...A},I(E),L(R.copy()))},clearSegment(K){delete E[K],D.current=K,I({...E});let W=vs(t.placeholderValue,f,g,h),Z=R;if(K==="dayPeriod"&&"hour"in R&&"hour"in W){let ee=R.hour>=12,De=W.hour>=12;ee&&!De?Z=R.set({hour:R.hour-12}):!ee&&De&&(Z=R.set({hour:R.hour+12}))}else K==="hour"&&"hour"in R&&R.hour>=12&&E.dayPeriod?Z=R.set({hour:W.hour+12}):K in R&&(Z=R.set({[K]:W[K]}));y(null),L(Z)},formatValue(K){if(!v)return"";let W=Br(K,T);return new Rt(e,W).format(k)},getDateFormatter(K,W){let Z={...T,...W},ee=Br({},Z);return new Rt(K,ee)}}}u(qP,"$3c0fc76039f1c516$export$60e84778edff6d26");function ZI(t,e,n,r,i,l,a,o){let s=["hour","minute","second"],c=n.formatToParts(t),d=[];for(let f of c){let h=jP[f.type]||f.type,p=Id[h];h==="era"&&l.getEras().length===1&&(p=!1);let m=Id[h]&&!e[h],g=Id[h]?zI(h,f.value,a):null,O={type:h,text:m?g:f.value,...Ld(i,h,r),isPlaceholder:m,placeholder:g,isEditable:p};h==="hour"?(d.push({type:"literal",text:"\u2066",...Ld(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(O),h===o&&d.push({type:"literal",text:"\u2069",...Ld(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(h)&&h===o?(d.push(O),d.push({type:"literal",text:"\u2069",...Ld(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(O)}return d}u(ZI,"$3c0fc76039f1c516$var$processSegments");function Ld(t,e,n){switch(e){case"era":{let r=t.calendar.getEras();return{value:r.indexOf(t.era),minValue:0,maxValue:r.length-1}}case"year":return{value:t.year,minValue:1,maxValue:t.calendar.getYearsInEra(t)};case"month":return{value:t.month,minValue:LR(t),maxValue:t.calendar.getMonthsInYear(t)};case"day":return{value:t.day,minValue:zR(t),maxValue:t.calendar.getDaysInMonth(t)}}if("hour"in t)switch(e){case"dayPeriod":return{value:t.hour>=12?12:0,minValue:0,maxValue:12};case"hour":if(n.hour12){let r=t.hour>=12;return{value:t.hour,minValue:r?12:0,maxValue:r?23:11}}return{value:t.hour,minValue:0,maxValue:23};case"minute":return{value:t.minute,minValue:0,maxValue:59};case"second":return{value:t.second,minValue:0,maxValue:59}}return{}}u(Ld,"$3c0fc76039f1c516$var$getSegmentLimits");function XI(t,e,n,r){switch(e){case"era":case"year":case"month":case"day":return t.cycle(e,n,{round:e==="year"})}if("hour"in t)switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return t.set({hour:l?i-12:i+12})}case"hour":case"minute":case"second":return t.cycle(e,n,{round:e!=="hour",hourCycle:r.hour12?12:24})}throw new Error("Unknown segment: "+e)}u(XI,"$3c0fc76039f1c516$var$addSegment");function jI(t,e,n,r){switch(e){case"day":case"month":case"year":case"era":return t.set({[e]:n})}if("hour"in t&&typeof n=="number")switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return n>=12===l?t:t.set({hour:l?i-12:i+12})}case"hour":if(r.hour12){let l=t.hour>=12;!l&&n===12&&(n=0),l&&n<12&&(n+=12)}case"minute":case"second":return t.set({[e]:n})}throw new Error("Unknown segment: "+e)}u(jI,"$3c0fc76039f1c516$var$setSegment");function qI(t){var e,n;let r=pi(t),[i,l]=je(t.value,t.defaultValue||null,t.onChange),[a]=(0,wp.element.useState)(i),[o,s]=(0,wp.element.useState)(()=>i||{start:null,end:null});i==null&&o.start&&o.end&&(o={start:null,end:null},s(o));let c=i||o,d=u(R=>{c=R||{start:null,end:null},s(c),ll(c)?l(c):l(null)},"setValue"),f=c?.start||c?.end||t.placeholderValue||null,[h,p]=y0(f,t.granularity),m=h==="hour"||h==="minute"||h==="second";var g;let O=(g=t.shouldCloseOnSelect)!==null&&g!==void 0?g:!0,[b,y]=(0,wp.element.useState)(null),[$,v]=(0,wp.element.useState)(null);c&&ll(c)&&(b=c,"hour"in c.start&&($=c));let S=u((R,L)=>{d({start:"timeZone"in L.start?L.start.set(vt(R.start)):Pn(R.start,L.start),end:"timeZone"in L.end?L.end.set(vt(R.end)):Pn(R.end,L.end)}),y(null),v(null),E.commitValidation()},"commitValue"),x=u(R=>{let L=typeof O=="function"?O():O;m?ll(R)&&(L||$?.start&&$?.end)?S(R,{start:$?.start||Ta(t.placeholderValue),end:$?.end||Ta(t.placeholderValue)}):y(R):ll(R)?(d(R),E.commitValidation()):y(R),L&&r.setOpen(!1)},"setDateRange"),C=u(R=>{ll(b)&&ll(R)?S(b,R):v(R)},"setTimeRange"),Q=(c==null||(e=c.start)===null||e===void 0?void 0:e.calendar.identifier)==="gregory"&&c.start.era==="BC"||(c==null||(n=c.end)===null||n===void 0?void 0:n.calendar.identifier)==="gregory"&&c.end.era==="BC",T=(0,wp.element.useMemo)(()=>({granularity:h,timeZone:p,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:Q}),[h,t.hourCycle,t.shouldForceLeadingZeros,p,t.hideTimeZone,Q]),{minValue:B,maxValue:w,isDateUnavailable:M}=t,A=(0,wp.element.useMemo)(()=>VI(c,B,w,M,T),[c,B,w,M,T]),E=qn({...t,value:i,name:(0,wp.element.useMemo)(()=>[t.startName,t.endName].filter(R=>R!=null),[t.startName,t.endName]),builtinValidation:A}),I=E.displayValidation.isInvalid,D=t.validationState||(I?"invalid":null);var P;return{...E,value:c,defaultValue:(P=t.defaultValue)!==null&&P!==void 0?P:a,setValue:d,dateRange:b,timeRange:$,granularity:h,hasTime:m,setDate(R,L){var k,F;x(R==="start"?{start:L,end:(k=b?.end)!==null&&k!==void 0?k:null}:{start:(F=b?.start)!==null&&F!==void 0?F:null,end:L})},setTime(R,L){var k,F;C(R==="start"?{start:L,end:(k=$?.end)!==null&&k!==void 0?k:null}:{start:(F=$?.start)!==null&&F!==void 0?F:null,end:L})},setDateTime(R,L){var k,F;d(R==="start"?{start:L,end:(k=c?.end)!==null&&k!==void 0?k:null}:{start:(F=c?.start)!==null&&F!==void 0?F:null,end:L})},setDateRange:x,setTimeRange:C,...r,setOpen(R){!R&&!(c?.start&&c?.end)&&ll(b)&&m&&S(b,{start:$?.start||Ta(t.placeholderValue),end:$?.end||Ta(t.placeholderValue)}),r.setOpen(R)},validationState:D,isInvalid:I,formatValue(R,L){if(!c||!c.start||!c.end)return null;let k="timeZone"in c.start?c.start.timeZone:void 0,F=t.granularity||(c.start&&"minute"in c.start?"minute":"day"),N="timeZone"in c.end?c.end.timeZone:void 0,z=t.granularity||(c.end&&"minute"in c.end?"minute":"day"),G=Br(L,{granularity:F,timeZone:k,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,showEra:c.start.calendar.identifier==="gregory"&&c.start.era==="BC"||c.end.calendar.identifier==="gregory"&&c.end.era==="BC"}),le=c.start.toDate(k||"UTC"),ie=c.end.toDate(N||"UTC"),me=new Rt(R,G),ve;if(k===N&&F===z&&c.start.compare(c.end)!==0){try{let ce=me.formatRangeToParts(le,ie),K=-1;for(let ee=0;eeK&&(Z+=ce[ee].value);return{start:W,end:Z}}catch{}ve=me}else{let ce=Br(L,{granularity:z,timeZone:N,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle});ve=new Rt(R,ce)}return{start:me.format(le),end:ve.format(ie)}},getDateFormatter(R,L){let k={...T,...L},F=Br({},k);return new Rt(R,F)}}}u(qI,"$93c38a5e28be6249$export$e50a61c1de9f574");function ll(t){return t?.start!=null&&t.end!=null}u(ll,"$93c38a5e28be6249$var$isCompleteRange");function WI(t){let{placeholderValue:e=new Tr,minValue:n,maxValue:r,defaultValue:i,granularity:l,validate:a}=t,[o,s]=je(t.value,i??null,t.onChange),c=o||e,d=c&&"day"in c?c:void 0,f=i&&"timeZone"in i?i.timeZone:void 0,h=(0,wp.element.useMemo)(()=>{let v=c&&"timeZone"in c?c.timeZone:void 0;return(v||f)&&e?Y3(Aa(e),v||f):Aa(e)},[e,c,f]),p=(0,wp.element.useMemo)(()=>Aa(n,d),[n,d]),m=(0,wp.element.useMemo)(()=>Aa(r,d),[r,d]),g=(0,wp.element.useMemo)(()=>o&&"day"in o?W3(o):o,[o]),O=(0,wp.element.useMemo)(()=>o==null?null:Aa(o),[o]),b=(0,wp.element.useMemo)(()=>i==null?null:Aa(i),[i]);return{...qP({...t,value:O,defaultValue:b,minValue:p,maxValue:m,onChange:u(v=>{s(d||f?v:v&&W3(v))},"onChange"),granularity:l||"minute",maxGranularity:"hour",placeholderValue:h??void 0,createCalendar:()=>new tt,validate:(0,wp.element.useCallback)(()=>a?.(o),[a,o])}),timeValue:g}}u(WI,"$eff5d8ee529ac4bb$export$fd53cef0cc796101");function Aa(t,e=Cr(kr())){return t?"day"in t?t:Pn(e,t):null}u(Aa,"$eff5d8ee529ac4bb$var$convertValue");function YI(t,e){let{cursor:n,getKey:r}=t;return{setSelectedKeys(i){e(l=>({...l,selectedKeys:i}))},addKeysToSelection(i){e(l=>l.selectedKeys==="all"?l:i==="all"?{...l,selectedKeys:"all"}:{...l,selectedKeys:new Set([...l.selectedKeys,...i])})},removeKeysFromSelection(i){e(l=>{if(i==="all")return{...l,selectedKeys:new Set};let a=l.selectedKeys==="all"?new Set(l.items.map(r)):new Set(l.selectedKeys);for(let o of i)a.delete(o);return{...l,selectedKeys:a}})},setFilterText(i){e(l=>({...l,filterText:i}))},insert(i,...l){e(a=>$s(a,i,...l))},insertBefore(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return $s(a,o,...l)})},insertAfter(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return $s(a,o+1,...l)})},prepend(...i){e(l=>$s(l,0,...i))},append(...i){e(l=>$s(l,l.items.length,...i))},remove(...i){e(l=>{let a=new Set(i),o=l.items.filter(c=>!a.has(r(c))),s="all";if(l.selectedKeys!=="all"){s=new Set(l.selectedKeys);for(let c of i)s.delete(c)}return n==null&&o.length===0&&(s=new Set),{...l,items:o,selectedKeys:s}})},removeSelectedItems(){e(i=>{if(i.selectedKeys==="all")return{...i,items:[],selectedKeys:new Set};let l=i.selectedKeys,a=i.items.filter(o=>!l.has(r(o)));return{...i,items:a,selectedKeys:new Set}})},move(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let s=a.items.slice(),[c]=s.splice(o,1);return s.splice(l,0,c),{...a,items:s}})},moveBefore(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return WP(a,c,o)})},moveAfter(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return WP(a,c,o+1)})},update(i,l){e(a=>{let o=a.items.findIndex(s=>r(s)===i);return o===-1?a:{...a,items:[...a.items.slice(0,o),l,...a.items.slice(o+1)]}})}}}u(YI,"$0d86e9c8f07f9a7b$export$79c0c687a5963b0a");function $s(t,e,...n){return{...t,items:[...t.items.slice(0,e),...n,...t.items.slice(e)]}}u($s,"$0d86e9c8f07f9a7b$var$insert");function WP(t,e,n){n-=e.filter(l=>l({from:l,to:n++}));for(let l=0;la&&r[o].from--}for(let l=0;ll;o--){let s=r[o];s.fromf.id||f.key,"getKey"),initialFilterText:a=""}=t;let[o,s]=(0,wp.element.useReducer)(KI,{state:"idle",error:void 0,items:[],selectedKeys:r==="all"?"all":new Set(r),sortDescriptor:i,filterText:a});const c=u(async(f,h)=>{let p=new AbortController;try{s({...f,abortController:p});var m;let b=(m=f.filterText)!==null&&m!==void 0?m:o.filterText;var g;let y=await h({items:o.items.slice(),selectedKeys:o.selectedKeys,sortDescriptor:(g=f.sortDescriptor)!==null&&g!==void 0?g:o.sortDescriptor,signal:p.signal,cursor:f.type==="loadingMore"?o.cursor:void 0,filterText:b,loadingState:o.state});var O;let $=(O=y.filterText)!==null&&O!==void 0?O:b;s({type:"success",...y,abortController:p}),$&&$!==b&&!p.signal.aborted&&c({type:"filtering",filterText:$},e)}catch(b){s({type:"error",error:b,abortController:p})}},"dispatchFetch");let d=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{d.current||(c({type:"loading"},e),d.current=!0)},[]),{items:o.items,selectedKeys:o.selectedKeys,sortDescriptor:o.sortDescriptor,isLoading:o.state==="loading"||o.state==="loadingMore"||o.state==="sorting"||o.state==="filtering",loadingState:o.state,error:o.error,filterText:o.filterText,getItem(f){return o.items.find(h=>l(h)===f)},reload(){c({type:"loading"},e)},loadMore(){o.state==="loading"||o.state==="loadingMore"||o.state==="filtering"||o.cursor==null||c({type:"loadingMore"},e)},sort(f){c({type:"sorting",sortDescriptor:f},n||e)},...YI({...t,getKey:l,cursor:o.cursor},f=>{s({type:"update",updater:f})}),setFilterText(f){c({type:"filtering",filterText:f},e)}}}u(UI,"$f86e6c1ec7da6ebb$export$bc3384a35de93d66");let GI=Math.round(Math.random()*1e10),_I=0;function YP(t){let e=(0,wp.element.useMemo)(()=>t.name||`radio-group-${GI}-${++_I}`,[t.name]);var n;let[r,i]=je(t.value,(n=t.defaultValue)!==null&&n!==void 0?n:null,t.onChange),[l]=(0,wp.element.useState)(r),[a,o]=(0,wp.element.useState)(null),s=qn({...t,value:r}),c=u(h=>{!t.isReadOnly&&!t.isDisabled&&(i(h),s.commitValidation())},"setSelectedValue"),d=s.displayValidation.isInvalid;var f;return{...s,name:e,selectedValue:r,defaultSelectedValue:t.value!==void 0?l:(f=t.defaultValue)!==null&&f!==void 0?f:null,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:t.isDisabled||!1,isReadOnly:t.isReadOnly||!1,isRequired:t.isRequired||!1,validationState:t.validationState||(d?"invalid":null),isInvalid:d}}u(YP,"$a54cdc5c1942b639$export$bca9d026f8e704eb");function HI(t){let{selectionMode:e="single"}=t,n=pi(t),[r,i]=(0,wp.element.useState)(null),l=(0,wp.element.useMemo)(()=>{var v;return t.defaultValue!==void 0?t.defaultValue:e==="single"?(v=t.defaultSelectedKey)!==null&&v!==void 0?v:null:[]},[t.defaultValue,t.defaultSelectedKey,e]),a=(0,wp.element.useMemo)(()=>t.value!==void 0?t.value:e==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,e]),[o,s]=je(a,l,t.onChange),c=e==="single"&&Array.isArray(o)?o[0]:o,d=u(v=>{if(e==="single"){var S,x;let C=Array.isArray(v)?(x=v[0])!==null&&x!==void 0?x:null:v;s(C),C!==c&&((S=t.onSelectionChange)===null||S===void 0||S.call(t,C))}else{let C=[];Array.isArray(v)?C=v:v!=null&&(C=[v]),s(C)}},"setValue"),f=b0({...t,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:(0,wp.element.useMemo)(()=>JI(c),[c]),onSelectionChange:v=>{if(v!=="all"){if(e==="single"){var S;let x=(S=v.values().next().value)!==null&&S!==void 0?S:null;d(x),n.close()}else d([...v]);m.commitValidation()}}}),h=f.selectionManager.firstSelectedKey,p=(0,wp.element.useMemo)(()=>[...f.selectionManager.selectedKeys].map(v=>f.collection.getItem(v)).filter(v=>v!=null),[f.selectionManager.selectedKeys,f.collection]),m=qn({...t,value:Array.isArray(c)&&c.length===0?null:c}),[g,O]=(0,wp.element.useState)(!1),[b]=(0,wp.element.useState)(c);var y,$;return{...m,...f,...n,value:c,defaultValue:l??b,setValue:d,selectedKey:h,setSelectedKey:d,selectedItem:(y=p[0])!==null&&y!==void 0?y:null,selectedItems:p,defaultSelectedKey:($=t.defaultSelectedKey)!==null&&$!==void 0?$:t.selectionMode==="single"?b:null,focusStrategy:r,open(v=null){f.collection.size!==0&&(i(v),n.open())},toggle(v=null){f.collection.size!==0&&(i(v),n.toggle())},isFocused:g,setFocused:O}}u(HI,"$2bc3a590c5373a4e$export$5159ec8b34d4ec12");function JI(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}u(JI,"$2bc3a590c5373a4e$var$convertValue");var eL=Object.defineProperty,tL=u((t,e)=>eL(t,"name",{value:e,configurable:!0}),"n$p");const ws=tL(t=>{const e=t.content??t.children,n=pi(t),{triggerProps:r,overlayProps:i}=cs({type:"dialog"},n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(se,{...r,type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},t.label??"Open modal"),n.isOpen&&wp.element.createElement(PI,{className:"tf-modal",state:n},wp.element.createElement(Os,{title:t.title,...i},e,wp.element.createElement("div",{className:"tf-modal-actions"},wp.element.createElement(se,{type:"danger",onPress:()=>{n.close(),t.onValidate&&t.onValidate()}},t.confirmText??t.label),wp.element.createElement(se,{type:"action",onPress:()=>{n.close(),t.onCancel&&t.onCancel()}},t.cancelText??"Cancel")))))},"ModalTrigger");var nL=Object.defineProperty,rL=u((t,e)=>nL(t,"name",{value:e,configurable:!0}),"s$i");function KP({message:t,type:e,onDismiss:n}){return wp.element.createElement("div",{className:`tf-notice ${e} tf-is-dismissible`},wp.element.createElement("p",null,t),wp.element.createElement("button",{type:"button",className:"tf-notice-dismiss",onClick:n}))}u(KP,"n$o"),rL(KP,"Notice");var iL=Object.defineProperty,lL=u((t,e)=>iL(t,"name",{value:e,configurable:!0}),"i$n");function Rr({children:t,state:e,style:n,className:r="",...i}){const l=wp.element.useRef(null),{popoverProps:a,underlayProps:o}=KN({...i,popoverRef:l},e),s=wp.element.useContext(Oo);return wp.element.createElement(Gk,{portalContainer:s.portalContainer},wp.element.createElement("div",{className:s.wrapper},!i.isNonModal&&wp.element.createElement("div",{...o,className:"tf-underlay"}),wp.element.createElement("div",{...a,ref:l,style:{...a.style,...n,zIndex:1e6,boxSizing:"border-box"},className:`tf-popover ${r}`},t,wp.element.createElement(fs,{onDismiss:e.close}))))}u(Rr,"y$7"),lL(Rr,"Popover");var aL=Object.defineProperty,oL=u((t,e)=>aL(t,"name",{value:e,configurable:!0}),"o$i");const zd=oL(t=>t.choices?wp.element.createElement(iF,{key:t.key??t.name,title:t.label??"",items:t.choices??[]},e=>wp.element.createElement(Qr,{key:e.value??""},e.label??"")):wp.element.createElement(Qr,{key:t.value??""},t.label??""),"RenderChoices");var sL=Object.defineProperty,mi=u((t,e)=>sL(t,"name",{value:e,configurable:!0}),"e$4");const uL=mi(t=>wp.element.createElement("div",{className:"tf-tab-container "+(t.className??"")},t.children),"Container"),cL=mi(t=>wp.element.createElement("div",{className:"tf-tab-header"},wp.element.createElement("div",{className:"tf-tab-items "+(t.className??"")},t.children),t.actions&&wp.element.createElement("div",{className:"tf-tab-actions "+(t.actionsClassName??"")},t.actions)),"Header"),dL=mi(t=>wp.element.createElement("div",{className:"tf-tab-item "+(t.className??""),"data-open":t.isOpen??!1},wp.element.createElement(se,{type:"text-action",onPress:t.onPress},t.children)),"Title"),fL=mi(t=>{const[e,n]=wp.element.useState(t.isActive??!1);if(wp.element.useEffect(()=>{t.isActive!==e&&n(t.isActive)},[t.isActive]),!!e)return wp.element.createElement("div",{className:"tf-tab-content "+(t.className??"")},t.children)},"Content"),hL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row "+(t.className??"")},t.children),"Row"),pL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title tf-tab-row-title-section "+(t.className??"")},t.children),"RowTitle"),mL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title "+(t.className??"")},wp.element.createElement("span",{className:"tf-label"},t.children)),"RowLabel"),gL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-field "+(t.className??"")},t.children),"RowField");var UP=Object.freeze({__proto__:null,Container:uL,Content:fL,Header:cL,Row:hL,RowField:gL,RowLabel:mL,RowTitle:pL,Title:dL}),OL=Object.defineProperty,bL=u((t,e)=>OL(t,"name",{value:e,configurable:!0}),"l$g");const Zd=bL(t=>{const e=`h${t.level??"3"}`,n=t.content??t.children;return wp.element.createElement("div",{className:"tf-title"},wp.element.createElement(e,{className:t.className},n))},"Title");var yL=Object.defineProperty,vL=u((t,e)=>yL(t,"name",{value:e,configurable:!0}),"n$l");const $L=vL(t=>{const e=t.content??t.children,n=t.placement??"top",r=t.theme&&t.theme==="dark"?"dark":"light";return wp.element.createElement("div",{className:`tf-tooltip tf-tooltip-${n}`},wp.element.createElement("div",{className:`tf-tooltip-content tf-tooltip-content-${n} ${r}`},e))},"Tooltip");var wL=Object.defineProperty,GP=u((t,e)=>wL(t,"name",{value:e,configurable:!0}),"n$k");const xL=GP(t=>{const e=t.layout??"button",n=t.label??"Open tooltip",r=t.children??!1;return wp.element.createElement("div",{className:"tf-tooltip-trigger"},wp.element.createElement("div",{className:"tf-tooltip-trigger-content"},r||GP(()=>e==="button"?wp.element.createElement(se,{type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},n):wp.element.createElement("span",null,n),"renderContent")(),wp.element.createElement($L,{...t})))},"TooltipTrigger");var SL=Object.defineProperty,CL=u((t,e)=>SL(t,"name",{value:e,configurable:!0}),"t$b");const kL=CL(({content:t,children:e})=>wp.element.createElement(wp.element.Fragment,null,t??e),"Wrapper");var DL=Object.defineProperty,al=u((t,e)=>DL(t,"name",{value:e,configurable:!0}),"o$f");const _P=al(t=>{const e={},n=["sectionTitle"],r=t.dependent?.callback??!1,i=t.dependent?.callbackData??!1;for(const l in t){if(n.includes(l))continue;const a=t[l];if(a&&typeof a=="object"&&!Array.isArray(a)){const o=_P(a);if(Object.keys(o).length===0)continue;for(const s in o)e[s]||(e[s]={}),e[s][l]={__isWrapped:!0,...o[s]}}if(typeof a=="string")for(const o of JP(a)){const s=EL(o,r,i);s&&(e[s.name]||(e[s.name]={}),e[s.name][l]=s.config)}}return e},"getDependentFields"),PL=al((t=!0)=>t?/(\{\{.+?}\})/g:/\{\{(.+?)}\}/g,"dependentAttributeRegex"),HP=al(t=>JP(t).length>0,"isDependentString"),JP=al((t,e=!0)=>typeof t=="string"?Array.from(t.matchAll(PL(e)),n=>n[1]):[],"getDependentStrings"),EL=al((t,e,n)=>{if(!HP(t))return!1;const r=t.slice(2,t.length-2).trim();if(!r.includes("."))return{name:r,config:{__returnedType:"full",__callback:e,__callbackData:n}};const[i,l]=r.split(".");return{name:i,config:{__returnedType:"partial",__returnedAttribute:l,__callback:e,__callbackData:n}}},"getDependentValue"),eE=al((t,e,n,r,i)=>{const l=e.__returnedType==="partial"?n()?.[e.__returnedAttribute]:n();let a=e.__callback??!1;typeof a=="string"&&(a=J9.dependent.__callbacks[a]??!1);const o=a?a({attribute:t,value:l,...e.__callbackData??{}}):l;return typeof o=="string"&&typeof i=="string"?i.replace(e.__returnedType==="partial"?`{{${r}.${e.__returnedAttribute}}}`:`{{${r}}}`,o):o},"getFieldValue"),TL=al((t,e,n)=>{if(e===!1)return{...t};const r={...t};for(const i in e){const l=e[i];for(const a in l){const o=l[a];if(o.__isWrapped){for(const s in o){if(s==="__isWrapped")continue;const c=eE(s,o[s],()=>n(i),i,r[a][s]);r[a]={...r[a],[s]:c}}continue}r[a]=eE(a,o,()=>n(i),i,r[a])}}return r},"mergeDependentProps");var AL=Object.defineProperty,tE=u((t,e)=>AL(t,"name",{value:e,configurable:!0}),"o$e");const nE=tE(({itemProps:t,refresh:e,data:n,children:r})=>{const i=Object.assign({},t);delete i.value,delete i.onChange,delete i.class,delete i.wrapper;const l=wp.element.useMemo(()=>t.dependent?Object.assign({},_P(t)):!1,[]),a=tE(c=>{!t.dependent||!l||Object.keys(l).includes(c)&&e()},"maybeUpdateProps"),o=wp.element.useCallback(c=>{c.props?.itemType!=="subfield"&&a(c.name)},[]);wp.element.useEffect(()=>{const c=Vo("valueChange",o);return()=>um("valueChange",c)},[o]),wp.element.useEffect(()=>{n.watcher&&n.watcher(c=>{a(c)})},[o]);const s=wp.element.useMemo(()=>TL(i,l,n.getValue),[]);return r(s)},"DependendWrapper");var QL=Object.defineProperty,ML=u((t,e)=>QL(t,"name",{value:e,configurable:!0}),"u$e");const rE=ML(t=>{const e=[];if(t.length===0)return!0;for(const n in t){const r=t[n];if(["_and","_or"].includes(n)){const i=r.map(rE);if(i.length===0){e.push(!1);continue}switch(n){case"_or":e.push(i.filter(Boolean).length>0);break;case"_and":e.push(i.length===i.filter(Boolean).length);break}continue}Object.entries(r).forEach(([i,l])=>{switch(i){case"_eq":e.push(n==l);break;case"_neq":e.push(n!=l);break;case"_lt":e.push(nl);break;case"_lte":e.push(n<=l);break;case"_gte":e.push(n>=l);break;case"_in":e.push(l.includes(n));break;case"_nin":e.push(!l.includes(n));break;case"_contains":e.push(n.includes(l));break;case"_ncontains":e.push(!n.includes(l));break;case"_re":e.push(new RegExp(l).test(n));break;default:e.push(!1)}})}return e.length>0&&e.length===e.filter(Boolean).length},"evaluateCondition");var BL=Object.defineProperty,Xd=u((t,e)=>BL(t,"name",{value:e,configurable:!0}),"i$l");const RL=Xd((t,e)=>(t=typeof t=="object"?iE(t,e):{},rE(t)),"evaluateFieldVisibility"),iE=Xd((t,e)=>{const n={};for(const r in t){if(["_and","_or"].includes(r)){n[r]=t[r].map(l=>iE(l,e));continue}const i=r.includes(".")?VL(r,e):e(r);n[i]=t[r]}return n},"replaceFieldValue"),VL=Xd((t,e)=>{const[n,r]=t.split(".");let i=e(n);if(typeof i=="string")try{i=JSON.parse(i)}catch{return""}return i[r]??""},"getPartialValue"),lE=Xd(t=>{const e=[];for(const n in t){if(["_and","_or"].includes(n)){for(const r in t[n])e.push(lE(t[n][r]));continue}e.push(n)}return e.flat().map(n=>n.split(".")[0])},"getTriggerFields");var NL=Object.defineProperty,aE=u((t,e)=>NL(t,"name",{value:e,configurable:!0}),"o$d");const oE=aE(({visibility:t,data:e,...n})=>{const[r,i]=wp.element.useState(!1),l=aE(()=>{if(!t.condition){i(!0);return}const o=e.getValue??control.getValue,s=RL(t.condition,o);i(t.action!=="hide"?s:!s)},"evaluateVisibility");wp.element.useEffect(()=>{l(),!(!t.condition||!a)&&(Vo("valueChange",o=>{o.props?.itemType!=="subfield"&&a.includes(o.name)&&setTimeout(l)}),e.watcher&&e.watcher(o=>{a.includes(o)&&l()}),Vo("evaluateVisibility",()=>l()))},[]);const a=wp.element.useMemo(()=>t.condition?lE(t.condition):!1,[]);return r?n.children:wp.element.createElement(wp.element.Fragment,null)},"VisibilityWrapper");var FL=Object.defineProperty,jd=u((t,e)=>FL(t,"name",{value:e,configurable:!0}),"r$b");const sE=jd(({children:t,itemType:e,setValue:n=!1,name:r})=>{const[i,l]=wp.element.useState(0),a=jd(()=>l(i+1),"refreshRender"),o=jd(c=>{!r||r!==c.name||(a(),n&&n(c.value))},"fieldValueChanged"),s=jd(c=>{c===r&&a()},"maybeRerender");return wp.element.useEffect(()=>{if(e!=="field")return;const c=Vo("_refreshFieldValue",o),d=Vo("_fieldRerender",s);return()=>{um("_refreshFieldValue",c),um("_fieldRerender",d)}},[i]),wp.element.createElement(wp.element.Fragment,{key:i},t(a))},"RenderWrapper");var IL=Object.defineProperty,LL=u((t,e)=>IL(t,"name",{value:e,configurable:!0}),"i$k");const v0=LL(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Oo),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class,wp.element.useEffect(()=>{n&&n()},[]);const a=Hr.get(r.type??!1,"element");return a?wp.element.createElement(hk,{...l},wp.element.createElement(oE,{visibility:t,data:e},wp.element.createElement(sE,{itemType:r.itemType??"field",name:r.name??!1},o=>wp.element.createElement(nE,{refresh:o,data:e,itemProps:r},s=>wp.element.createElement(a,{...s,data:e}))))):wp.element.createElement(wp.element.Fragment,null)},"Element");var zL=Object.defineProperty,ZL=u((t,e)=>zL(t,"name",{value:e,configurable:!0}),"n$j");const XL=ZL(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?v0:pp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...a,...t})},"Item");var uE={common:{add:"Add item",clone:"Clone",delete:"Remove"},layoutOveride:{advanced:{clone:"Duplicate",delete:"Delete"},tab:{add:"+ Add Item"}}},jL=Object.defineProperty,Vr=u((t,e)=>jL(t,"name",{value:e,configurable:!0}),"l$b");const cE=Vr(t=>{const e=t.fields??[],n=t.layout&&Object.keys(Hr._types.repeater).includes(t.layout)?t.layout:"table",r=Hr.get(n,"repeater"),i=t.repeatable??!0,l=t.maxlength??1/0,a=e.map(S=>{const x=Object.assign({},S);return n==="table"?(x.labelVisuallyHidden=!0,x.descriptionVisuallyHidden=!0):n==="tab"&&(x.labelVisuallyHidden=!0),delete x.value,delete x.onChange,x}),o={};e.forEach(S=>{o[S.name]=t.newItem?t.newItem[S.name]??"":""});const[s,c]=wp.element.useReducer(Y2(o,l,t),t.value??"",S=>K2(S,o)),d=Vr(S=>a.map(x=>x.name??!1).includes(S),"hasField"),[f,h]=wp.element.useState([]),p=Vr((S,x)=>{f.forEach(C=>C(S,x))},"triggerRowCallbackEvents"),m=wp.element.useRef();m.current=s;const g=Vr((S,x,C)=>wp.element.createElement(XL,{key:x.key+C,values:x,config:{...S,repeaterRow:C},onChange:Q=>c({type:"update",item:C,control:S.name,value:Q,callback:()=>p(x.key,S.name)}),data:{getValue:Q=>d(Q)?m.current[C][Q]??"":t.data.getValue(Q??""),watcher:Q=>h(T=>[...T,(B,w)=>{B===x.key&&S.name&&Q(w,x.key)}])}}),"renderItem"),O=Vr(()=>s.map(({_bulkCheckbox:S,...x})=>x),"getSavedValue"),b=Vr(S=>({...uE.common,...uE.layoutOveride[n]??{},...t.strings??{}})[S]??S,"string"),y=Vr(()=>i&&wp.element.createElement("div",{className:"tf-repeater-actions"},wp.element.createElement(se,{type:"action",onPress:()=>c({type:"add"}),isDisabled:l<=s.length},b("add")),wp.element.createElement(ws,{title:"Confirmation",label:"Remove all",isDisabled:s.length<=0,onValidate:()=>c({type:"clear"})},"Are you sure you want to clear all item(s)?")),"renderFooterActions"),$=Vr((S,x,C)=>{const Q=typeof t.parts.actions[S]=="string"?Hr.get(t.parts.actions[S],"element"):t.parts.actions[S];return wp.element.createElement(Q,{dispatch:c,item:x,items:s,...C})},"renderCustomComponent"),v=Vr((S,x,C={})=>{if(!i)return wp.element.createElement(wp.element.Fragment,null);if(t?.parts?.actions?.[S])return $(S,x,C);switch(S){case"delete":return wp.element.createElement(ws,{label:b("delete"),title:"Confirmation",onValidate:()=>c({type:"remove",item:x}),buttonProps:{type:"danger"},...C},"Are you sure you want to remove item ",x+1,"?");case"clone":return wp.element.createElement(se,{type:"action",isDisabled:l<=s.length,onPress:()=>c({type:"clone",item:s[x]}),...C},b("clone"))}},"renderAction");return wp.element.useEffect(()=>t.onChange&&t.onChange(O()),[s]),wp.element.createElement("div",{className:`tf-repeater tf-repeater-${n}`},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(O())}),t.label&&wp.element.createElement(Zd,{level:2,className:"tf-repeater-title"},t.label),wp.element.createElement("div",{className:`tf-repeater-container tf-repeater-${n}-container`},wp.element.createElement(r,{items:s,fields:e,dispatch:c,rowFields:a,headerFields:t.headerFields,renderItem:g,maxLength:i?l:void 0,title:t.sectionTitle??!1,useSwitch:t.useSwitch,useBulk:t.useBulk,afterRow:t.afterRow,beforeRow:t.beforeRow,name:t.name??"",renderFooterActions:y,renderAction:v,parent:t,string:b})))},"Repeater");var qL=Object.defineProperty,dE=u((t,e)=>qL(t,"name",{value:e,configurable:!0}),"o$c");const WL={_eq:"Is",_neq:"Is not",_lt:"Less than",_gt:"Greater than",_lte:"Less than or equal",_gte:"Greater than or equal",_in:"In array",_nin:"Not in array",_contains:"Contains",_ncontains:"Not contain",_re:"Regex"},fE=dE(t=>{const e=t.filter(n=>n.name==="operator")[0]??!1;return!e||typeof e.choices!="object"?"":Object.keys(e.choices)[0]??""},"getInitialOperator"),YL=dE(({dynamic:t,operators:e=void 0,fields:n=void 0})=>n&&n.length>0?n:[{label:"Text",type:"text",name:"left_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0},{label:"Operator",type:"select",name:"operator",choices:e??WL,labelVisuallyHidden:!0},{label:"Text",type:"text",name:"right_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0}],"getFields");var KL=Object.defineProperty,hE=u((t,e)=>KL(t,"name",{value:e,configurable:!0}),"e$2");const UL=hE(t=>wp.element.createElement("div",{className:"tf-conditional-panel-conditions"},wp.element.createElement(cE,{...t,type:"repeater",layout:"bare",afterRow:hE((e,n,r)=>wp.element.createElement("div",{className:"tf-conditional-panel-condition-actions"},wp.element.createElement(se,{type:"action",onPress:()=>r({type:"insert",position:n+1,data:{operator:fE(t.fields)}})},"And"),wp.element.createElement(se,{type:"danger",onPress:()=>r({type:"remove",item:n}),isDisabled:!t.canDelete,contentVisuallyHidden:!0},"Delete condition")),"afterRow"),repeatable:!1})),"ConditionGroup");var GL=Object.defineProperty,xs=u((t,e)=>GL(t,"name",{value:e,configurable:!0}),"i$i");const _L=xs(t=>{const e=wp.element.useMemo(()=>YL(t),[]),n=xs(()=>({key:fi(),data:[{key:fi(),operator:fE(e)}]}),"emptyRow"),r=xs(()=>On(t.value??"",[n()]),"initialValue"),[i,l]=wp.element.useState(r()),[a,o]=wp.element.useState(r());wp.element.useEffect(()=>{t.onChange&&t.onChange(t.useModal?i:a)},[t.useModal?i:a]),wp.element.useEffect(()=>{if(a.length===1)return;const h=a.filter(p=>p.data.length!==0);h.length!==a.length&&o([...h])},[a]);const s=xs(h=>o([...a.slice(0,h),n(),...a.slice(h)]),"insertGroup"),c=xs((h,p)=>{const m=a;m[p].data=h,o([...m])},"updateGroup"),d=t.useModal?ws:wp.element.Fragment,f=t.useModal?{title:"Conditional rules",label:"Open conditional panel",confirmText:"Save",onCancel:()=>{o([...u0(i)])},onValidate:()=>{l([...u0(a)])}}:{};return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(t.useModal?i:a)}),wp.element.createElement("div",{className:"tf-label"},t.label??""),wp.element.createElement(d,{...f},wp.element.createElement("div",{className:"tf-conditional-panel"},wp.element.createElement("div",{className:"tf-conditional-panel-container"},wp.element.createElement("div",{className:"tf-conditional-groups"},a.map((h,p)=>wp.element.createElement("div",{key:h.key,className:"tf-conditional-group"},wp.element.createElement(UL,{canDelete:a.length!==1||h.data.length!==1,value:h.data,onChange:m=>c(m,p),fields:e}),wp.element.createElement("div",{className:"tf-conditional-group-actions"},wp.element.createElement("strong",null,"Or"),wp.element.createElement(se,{type:"primary",onPress:()=>s(p+1)},"Add group")))))))))},"ConditionalPanel");var HL=Object.defineProperty,pE=u((t,e)=>HL(t,"name",{value:e,configurable:!0}),"t$a");const JL=pE(t=>{const[e,n]=wp.element.useState(On(t.value));wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=pE(l=>{n({...e,enabled:l===!0||l==="on"?"on":"off"})},"isEnabled"),i=t.useSwitch?wp.element.createElement("div",{onClick:l=>l.stopPropagation()},wp.element.createElement(Y1,{value:e.enabled??"off",onChange:r,label:"Toggle accordion",labelVisuallyHidden:!0})):null;return wp.element.createElement("div",{className:"tf-accordion"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(e)}),wp.element.createElement(G2,{title:t.title??!1,headerLeft:i,behavior:"show",isOpen:t.isOpen??!1},wp.element.createElement(W1,{...t,name:null,fields:t.fields,value:e,onChange:n})))},"Accordion");var ez=Object.defineProperty,tz=u((t,e)=>ez(t,"name",{value:e,configurable:!0}),"t$9");const mE=wp.element.createContext(null),gE=tz(t=>{const e=YP(t),{radioGroupProps:n,labelProps:r,descriptionProps:i}=L2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-radio-group"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("div",{className:"tf-radio-group-container",...n},wp.element.createElement(mE.Provider,{value:e},t.children)),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"RadioGroup");var nz=Object.defineProperty,rz=u((t,e)=>nz(t,"name",{value:e,configurable:!0}),"r$8");const OE=rz(t=>{const e=wp.element.useContext(mE),n=wp.element.useRef(null),{inputProps:r}=I2(t,e,n);return wp.element.createElement("label",{className:"tf-radio"},wp.element.createElement("input",{...r,ref:n}),t.children)},"Radio");var iz=Object.defineProperty,lz=u((t,e)=>iz(t,"name",{value:e,configurable:!0}),"i$g");const az=lz(t=>{const[e,n]=wp.element.useState(t.value??""),r=["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"];return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement("div",{className:"tf-alignment-matrix"},wp.element.createElement(gE,{...t,onChange:n},wp.element.createElement("div",{className:"tf-alignment-matrix-container"},r.map(i=>wp.element.createElement(OE,{key:i,id:i,value:i},wp.element.createElement(gn,null,i))))))},"AlignmentMatrix");var oz=Object.defineProperty,Ss=u((t,e)=>oz(t,"name",{value:e,configurable:!0}),"a$a");const bE=Ss(t=>{if(t.config===!1)return t.children;const{dynamics:e}=yr(),n=wp.element.useRef(),r=wp.element.useRef(),[i,l]=wp.element.useState(!1),[a,o]=wp.element.useState(!1),[s,c]=wp.element.useState({}),[d,f]=wp.element.useState(!1),h=pi({}),{triggerProps:p,overlayProps:m}=cs({type:"dialog"},h,n);wp.element.useEffect(()=>{t.isOpen?h.open():h.close()},[t.isOpen]),wp.element.useEffect(()=>{d!==!1&&(t?.onValueSelection(d),f(!1))},[d]);const g=Ss(T=>{if(!T)return;const B=e.values[T]?.fields;if(l(T),!Array.isArray(B)||B.length===0)return O(T);o(B)},"saveDynamicValue"),O=Ss(T=>{f(t.config.stringify(T,s??!1)),b()},"selectAndClose"),b=Ss(()=>{l(!1),o(!1),c(!1),h.close()},"resetAndClose"),y=wp.element.useMemo(()=>{const T=t.config.getTypes();return t.config.getCategories().map(B=>{const w=e.categories[B],M=Object.keys(e.values).filter(A=>w.values.includes(A)&&T.includes(e.values[A]?.type)).reduce((A,E)=>({...A,[E]:e.values[E].label??E}),{});return{name:w.label,choices:M}}).filter(B=>Object.keys(B.choices).length!==0)},[]),$=wp.element.useRef(s),v=Ss((T,B)=>{c($.current={...s,[T]:B})},"updateSettings"),S=t.buttonType??"outside",x=!(t.readOnly||t.inputMasking)&&(S==="outside"||!t.remove||t.remove.isDisabled),C=!(t.readOnly||t.inputMasking)&&(S==="outside"||t.remove&&t.remove.isDisabled===!1),Q=`tf-dynamic-wrapper tf-dynamic-wrapper-buttons-${S} ${t.className??""}`;return wp.element.createElement("div",{className:Q,"data-dynamic":"true"},t.children,x&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-insert",ref:n,contentVisuallyHidden:S==="inside",...p},"Insert"),C&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-clear",contentVisuallyHidden:S==="inside",...t.remove},"Clear"),h.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover",ref:r,...m},a?wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-form"},wp.element.createElement(Zd,{level:4},"Dynamic value settings"),e.values[i].description&&wp.element.createElement("i",null,e.values[i].description),a.map(T=>wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-field"},wp.element.createElement(pp,{...T,value:s[T.name]??"",onChange:B=>v(T.name,B),visibility:{condition:T.condition?.condition??!1,action:T.condition?.action??"show"},data:{getValue:B=>$.current[B]??""}}))),wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-buttons"},wp.element.createElement(se,{type:"action",onPress:()=>O(i)},"Add"),wp.element.createElement(se,{type:"action",onPress:b},"Close"))):wp.element.createElement(Sh,{choices:y,label:"Select dynamic value to insert",labelVisuallyHidden:!0,autoFocus:!0,showButton:!1,onChange:g,onFocusChange:T=>T?!h.isOpen&&h.open():h.close()}),wp.element.createElement(fs,{onDismiss:h.close})))},"BaseWrapper");var sz=Object.defineProperty,uz=u((t,e)=>sz(t,"name",{value:e,configurable:!0}),"u$b");const Cs=wp.element.forwardRef(({inputProps:t={},...e},n)=>{const[r,i]=wp.element.useState(e.dynamic?e.dynamic.hasValues():!1),l=uz(a=>{const o=e.dynamic.parse(a);return o&&o.type?e.dynamic.getLabel(o.type):""},"getLabel");return wp.element.createElement(bE,{className:"tf-dynamic-field-wrapper",config:e.dynamic??!1,onValueSelection:a=>{i(!0),e.onValueSelection(a)},remove:{isDisabled:r===!1,onPress:()=>{i(!1),e.onValueRemove&&e.onValueRemove()}},buttonType:e.buttonType??"outside",readOnly:e.readOnly??!1},r?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"text",className:"tf-dynamic-value-input",value:l(e.value),disabled:!0}),wp.element.createElement("input",{...t,name:e.name??"",value:e.value??"",type:"hidden",ref:n})):e.children)});let $0=[],yE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t<$0[r])n=r;else if(t>=yE[r])e=r+1;else return!0;if(e==n)return!1}}u(cz,"isExtendingChar");function vE(t){return t>=127462&&t<=127487}u(vE,"isRegionalIndicator");const $E=8205;function dz(t,e,n=!0,r=!0){return(n?wE:fz)(t,e,r)}u(dz,"findClusterBreak$1");function wE(t,e,n){if(e==t.length)return e;e&&xE(t.charCodeAt(e))&&SE(t.charCodeAt(e-1))&&e--;let r=w0(t,e);for(e+=CE(r);e=0&&vE(w0(t,a));)l++,a-=2;if(l%2==0)break;e+=2}else break}return e}u(wE,"nextClusterBreak");function fz(t,e,n){for(;e>0;){let r=wE(t,e-2,n);if(r=56320&&t<57344}u(xE,"surrogateLow$1");function SE(t){return t>=55296&&t<56320}u(SE,"surrogateHigh$1");function CE(t){return t<65536?1:2}u(CE,"codePointSize$1");const vp=class vp{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Qa(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),qd.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Qa(this,e,n);let r=[];return this.decompose(e,n,r,0),qd.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new ol(this),l=new ol(e);for(let a=n,o=n;;){if(i.next(a),l.next(a),a=0,i.lineBreak!=l.lineBreak||i.done!=l.done||i.value!=l.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new ol(this,e)}iterRange(e,n=this.length){return new Yd(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Kd(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?vp.empty:e.length<=32?new Kt(e):qd.from(Kt.split(e,[]))}};u(vp,"Text");let pe=vp;const Dn=class Dn extends pe{constructor(e,n=hz(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let l=0;;l++){let a=this.text[l],o=i+a.length;if((n?r:o)>=e)return new x0(i,o,r,a);i=o+1,r++}}decompose(e,n,r,i){let l=e<=0&&n>=this.length?this:new Dn(kE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=Wd(l.text,a.text.slice(),0,l.length);if(o.length<=32)r.push(new Dn(o,a.length+l.length));else{let s=o.length>>1;r.push(new Dn(o.slice(0,s)),new Dn(o.slice(s)))}}else r.push(l)}replace(e,n,r){if(!(r instanceof Dn))return super.replace(e,n,r);[e,n]=Qa(this,e,n);let i=Wd(this.text,Wd(r.text,kE(this.text,0,e)),n),l=this.length+r.length-(n-e);return i.length<=32?new Dn(i,l):qd.from(Dn.split(i,[]),l)}sliceString(e,n=this.length,r=` `){[e,n]=Qa(this,e,n);let i="";for(let l=0,a=0;l<=n&&ae&&a&&(i+=r),el&&(i+=o.slice(Math.max(0,e-l),n-l)),l=s+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let l of e)r.push(l),i+=l.length+1,r.length==32&&(n.push(new Dn(r,i)),r=[],i=-1);return i>-1&&n.push(new Dn(r,i)),n}};u(Dn,"TextLeaf");let Kt=Dn,qd=(pr=class extends pe{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let l=0;;l++){let a=this.children[l],o=i+a.length,s=r+a.lines-1;if((n?s:o)>=e)return a.lineInner(e,n,r,i);i=o+1,r=s+1}}decompose(e,n,r,i){for(let l=0,a=0;a<=n&&l=a){let c=i&((a<=e?1:0)|(s>=n?2:0));a>=e&&s<=n&&!c?r.push(o):o.decompose(e-a,n-a,r,c)}a=s+1}}replace(e,n,r){if([e,n]=Qa(this,e,n),r.lines=l&&n<=o){let s=a.replace(e-l,n-l,r),c=this.lines-a.lines+s.lines;if(s.lines>4&&s.lines>c>>6){let d=this.children.slice();return d[i]=s,new pr(d,this.length-(n-e)+r.length)}return super.replace(l,o,s)}l=o+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` `){[e,n]=Qa(this,e,n);let i="";for(let l=0,a=0;le&&l&&(i+=r),ea&&(i+=o.sliceString(e-a,n-a,r)),a=s+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof pr))return 0;let r=0,[i,l,a,o]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,l+=n){if(i==a||l==o)return r;let s=this.children[i],c=e.children[l];if(s!=c)return r+s.scanIdentical(c,n);r+=s.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let p of e)r+=p.lines;if(r<32){let p=[];for(let m of e)m.flatten(p);return new Kt(p,n)}let i=Math.max(32,r>>5),l=i<<1,a=i>>1,o=[],s=0,c=-1,d=[];function f(p){let m;if(p.lines>l&&p instanceof pr)for(let g of p.children)f(g);else p.lines>a&&(s>a||!s)?(h(),o.push(p)):p instanceof Kt&&s&&(m=d[d.length-1])instanceof Kt&&p.lines+m.lines<=32?(s+=p.lines,c+=p.length+1,d[d.length-1]=new Kt(m.text.concat(p.text),m.length+1+p.length)):(s+p.lines>i&&h(),s+=p.lines,c+=p.length+1,d.push(p))}u(f,"add");function h(){s!=0&&(o.push(d.length==1?d[0]:pr.from(d,c)),c=-1,s=d.length=0)}u(h,"flush");for(let p of e)f(p);return h(),o.length==1?o[0]:new pr(o,n)}},u(pr,"TextNode"),pr);pe.empty=new Kt([""],0);function hz(t){let e=-1;for(let n of t)e+=n.length+1;return e}u(hz,"textLength");function Wd(t,e,n=0,r=1e9){for(let i=0,l=0,a=!0;l=n&&(s>r&&(o=o.slice(0,r-i)),i0?1:(e instanceof Kt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],l=this.offsets[r],a=l>>1,o=i instanceof Kt?i.text.length:i.children.length;if(a==(n>0?o:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((l&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof Kt){let s=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,s.length>Math.max(0,e))return this.value=e==0?s:n>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{let s=i.children[a+(n<0?-1:0)];e>s.length?(e-=s.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(s),this.offsets.push(n>0?1:(s instanceof Kt?s.text.length:s.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}};u(xv,"RawTextCursor");let ol=xv;const Sv=class Sv{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new ol(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}};u(Sv,"PartialTextCursor");let Yd=Sv;const Cv=class Cv{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}};u(Cv,"LineCursor");let Kd=Cv;typeof Symbol<"u"&&(pe.prototype[Symbol.iterator]=function(){return this.iter()},ol.prototype[Symbol.iterator]=Yd.prototype[Symbol.iterator]=Kd.prototype[Symbol.iterator]=function(){return this});const kv=class kv{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};u(kv,"Line");let x0=kv;function Qa(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}u(Qa,"clip");function wt(t,e,n=!0,r=!0){return dz(t,e,n,r)}u(wt,"findClusterBreak");function pz(t){return t>=56320&&t<57344}u(pz,"surrogateLow");function mz(t){return t>=55296&&t<56320}u(mz,"surrogateHigh");function Ft(t,e){let n=t.charCodeAt(e);if(!mz(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return pz(r)?(n-55296<<10)+(r-56320)+65536:n}u(Ft,"codePointAt");function S0(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}u(S0,"fromCodePoint");function Kn(t){return t<65536?1:2}u(Kn,"codePointSize");const C0=/\r\n?|\n/;var ct=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(ct||(ct={}));const wo=class wo{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return l+(e-i);l+=o}else{if(r!=ct.Simple&&c>=e&&(r==ct.TrackDel&&ie||r==ct.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!o)return e==i||n<0?l:l+s;l+=s}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return l}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&o>=e)return in?"cover":!0;i=o}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new wo(e)}static create(e){return new wo(e)}};u(wo,"ChangeDesc");let gi=wo;const mr=class mr extends gi{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return k0(this,(n,r,i,l,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return D0(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,l=0;i=0){n[i]=o,n[i+1]=a;let s=i>>1;for(;r.length0&&Oi(r,n,l.text),l.forward(d),o+=d}let c=e[a++];for(;o>1].toJSON()))}return e}static of(e,n,r){let i=[],l=[],a=0,o=null;function s(d=!1){if(!d&&!i.length)return;ah||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let m=p?typeof p=="string"?pe.of(p.split(r||C0)):p:pe.empty,g=m.length;if(f==h&&g==0)return;fa&&dt(i,f-a,-1),dt(i,h-f,g),Oi(l,i,m),a=h}}return u(c,"process"),c(e),s(!o),o}static empty(e){return new mr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;io&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(l.length==1)n.push(l[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}u(dt,"addSection");function Oi(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)o=t.sections[a++],s=t.sections[a++];e(i,c,l,d,f),i=c,l=d}}}u(k0,"iterChanges");function D0(t,e,n,r=!1){let i=[],l=r?[]:null,a=new sl(t),o=new sl(e);for(let s=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let c=Math.min(a.len,o.len);dt(i,c,-1),a.forward(c),o.forward(c)}else if(o.ins>=0&&(a.ins<0||s==a.i||a.off==0&&(o.len=0&&s=0){let c=0,d=a.len;for(;d;)if(o.ins==-1){let f=Math.min(d,o.len);c+=f,d-=f,o.forward(f)}else if(o.ins==0&&o.lens||a.ins>=0&&a.len>s)&&(o||r.length>c),l.forward2(s),a.forward(s)}}}}u(DE,"composeSets");const Dv=class Dv{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?pe.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?pe.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}};u(Dv,"SectionIter");let sl=Dv,Ud=(zl=class{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new zl(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return X.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return X.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return X.range(e.anchor,e.head)}static create(e,n,r){return new zl(e,n,r)}},u(zl,"SelectionRange"),zl);const Qt=class Qt{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Qt.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Qt(e.ranges.map(n=>Ud.fromJSON(n)),e.main)}static single(e,n=e){return new Qt([Qt.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|l)}static normalized(e,n=0){let r=e[n];e.sort((i,l)=>i.from-l.from),n=e.indexOf(r);for(let i=1;il.head?Qt.range(s,o):Qt.range(o,s))}}return new Qt(e,n)}};u(Qt,"EditorSelection");let X=Qt;function PE(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}u(PE,"checkSelection");let P0=0;const $p=class $p{constructor(e,n,r,i,l){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=P0++,this.default=e([]),this.extensions=typeof l=="function"?l(this):l}get reader(){return this}static define(e={}){return new $p(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:E0),!!e.static,e.enables)}of(e){return new Ma([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ma(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ma(e,this,2,n)}from(e,n){return n||(n=u(r=>r,"get")),this.compute([e],r=>n(r.field(e)))}};u($p,"Facet");let _=$p;function E0(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}u(E0,"sameArray$1");const Pv=class Pv{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=P0++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,l=this.id,a=e[l]>>1,o=this.type==2,s=!1,c=!1,d=[];for(let f of this.dependencies)f=="doc"?s=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||d.push(e[f.id]);return{create(f){return f.values[a]=r(f),1},update(f,h){if(s&&h.docChanged||c&&(h.docChanged||h.selection)||T0(f,d)){let p=r(f);if(o?!EE(p,f.values[a],i):!i(p,f.values[a]))return f.values[a]=p,1}return 0},reconfigure:(f,h)=>{let p,m=h.config.address[l];if(m!=null){let g=Jd(h,m);if(this.dependencies.every(O=>O instanceof _?h.facet(O)===f.facet(O):O instanceof Gt?h.field(O,!1)==f.field(O,!1):!0)||(o?EE(p=r(f),g,i):i(p=r(f),g)))return f.values[a]=g,0}else p=r(f);return f.values[a]=p,1}}}};u(Pv,"FacetProvider");let Ma=Pv;function EE(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[s.id]),i=n.map(s=>s.type),l=r.filter(s=>!(s&1)),a=t[e.id]>>1;function o(s){let c=[];for(let d=0;dr===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Gd).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let l=r.values[n],a=this.updateF(l,i);return this.compareF(l,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let l=r.facet(Gd),a=i.facet(Gd),o;return(o=l.find(s=>s.field==this))&&o!=a.find(s=>s.field==this)?(r.values[n]=o.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Gd.of({field:this,create:e})]}get extension(){return this}};u(xp,"StateField");let Gt=xp;const ul={lowest:4,low:3,default:2,high:1,highest:0};function ks(t){return e=>new _d(e,t)}u(ks,"prec");const cl={highest:ks(ul.highest),high:ks(ul.high),default:ks(ul.default),low:ks(ul.low),lowest:ks(ul.lowest)},Ev=class Ev{constructor(e,n){this.inner=e,this.prec=n}};u(Ev,"PrecExtension");let _d=Ev;const Sp=class Sp{of(e){return new Ds(this,e)}reconfigure(e){return Sp.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}};u(Sp,"Compartment");let Hd=Sp;const Tv=class Tv{constructor(e,n){this.compartment=e,this.inner=n}};u(Tv,"CompartmentInstance");let Ds=Tv,TE=(xo=class{constructor(e,n,r,i,l,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=l,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],l=Object.create(null),a=new Map;for(let h of Oz(e,n,a))h instanceof Gt?i.push(h):(l[h.facet.id]||(l[h.facet.id]=[])).push(h);let o=Object.create(null),s=[],c=[];for(let h of i)o[h.id]=c.length<<1,c.push(p=>h.slot(p));let d=r?.config.facets;for(let h in l){let p=l[h],m=p[0].facet,g=d&&d[h]||[];if(p.every(O=>O.type==0))if(o[m.id]=s.length<<1|1,E0(g,p))s.push(r.facet(m));else{let O=m.combine(p.map(b=>b.value));s.push(r&&m.compare(O,r.facet(m))?r.facet(m):O)}else{for(let O of p)O.type==0?(o[O.id]=s.length<<1|1,s.push(O.value)):(o[O.id]=c.length<<1,c.push(b=>O.dynamicSlot(b)));o[m.id]=c.length<<1,c.push(O=>gz(O,m,p))}}let f=c.map(h=>h(o));return new xo(e,a,f,o,s,l)}},u(xo,"Configuration"),xo);function Oz(t,e,n){let r=[[],[],[],[],[]],i=new Map;function l(a,o){let s=i.get(a);if(s!=null){if(s<=o)return;let c=r[s].indexOf(a);c>-1&&r[s].splice(c,1),a instanceof Ds&&n.delete(a.compartment)}if(i.set(a,o),Array.isArray(a))for(let c of a)l(c,o);else if(a instanceof Ds){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(a.compartment)||a.inner;n.set(a.compartment,c),l(c,o)}else if(a instanceof _d)l(a.inner,a.prec);else if(a instanceof Gt)r[o].push(a),a.provides&&l(a.provides,o);else if(a instanceof Ma)r[o].push(a),a.facet.extensions&&l(a.facet.extensions,ul.default);else{let c=a.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);l(c,o)}}return u(l,"inner"),l(t,ul.default),r.reduce((a,o)=>a.concat(o))}u(Oz,"flatten");function Ps(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}u(Ps,"ensureAddr");function Jd(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}u(Jd,"getAddr");const AE=_.define(),A0=_.define({combine:t=>t.some(e=>e),static:!0}),QE=_.define({combine:t=>t.length?t[0]:void 0,static:!0}),ME=_.define(),BE=_.define(),RE=_.define(),VE=_.define({combine:t=>t.length?t[0]:!1}),Av=class Av{constructor(e,n){this.type=e,this.value=n}static define(){return new Q0}};u(Av,"Annotation");let Tn=Av;const Qv=class Qv{of(e){return new Tn(this,e)}};u(Qv,"AnnotationType");let Q0=Qv;const Mv=class Mv{constructor(e){this.map=e}of(e){return new Oe(this,e)}};u(Mv,"StateEffectType");let M0=Mv;const Cp=class Cp{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Cp(this.type,n)}is(e){return this.type==e}static define(e={}){return new M0(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let l=i.map(n);l&&r.push(l)}return r}};u(Cp,"StateEffect");let Oe=Cp;Oe.reconfigure=Oe.define(),Oe.appendConfig=Oe.define();let xt=(Jr=class{constructor(e,n,r,i,l,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=l,this.scrollIntoView=a,this._doc=null,this._state=null,r&&PE(r,n.newLength),l.some(o=>o.type==Jr.time)||(this.annotations=l.concat(Jr.time.of(Date.now())))}static create(e,n,r,i,l,a){return new Jr(e,n,r,i,l,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Jr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}},u(Jr,"Transaction"),Jr);xt.time=Tn.define(),xt.userEvent=Tn.define(),xt.addToHistory=Tn.define(),xt.remote=Tn.define();function bz(t,e){let n=[];for(let r=0,i=0;;){let l,a;if(r=t[r]))l=t[r++],a=t[r++];else if(i=0;i--){let l=r[i](t);l instanceof xt?t=l:Array.isArray(l)&&l.length==1&&l[0]instanceof xt?t=l[0]:t=FE(e,Ba(l),!1)}return t}u(yz,"filterTransaction");function vz(t){let e=t.startState,n=e.facet(RE),r=t;for(let i=n.length-1;i>=0;i--){let l=n[i](t);l&&Object.keys(l).length&&(r=NE(r,B0(e,l,t.changes.newLength),!0))}return r==t?t:xt.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}u(vz,"extendTransaction");const $z=[];function Ba(t){return t==null?$z:Array.isArray(t)?t:[t]}u(Ba,"asArray$1");var ft=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(ft||(ft={}));const wz=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let R0;try{R0=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function xz(t){if(R0)return R0.test(t);for(let e=0;e"\x80"&&(n.toUpperCase()!=n.toLowerCase()||wz.test(n)))return!0}return!1}u(xz,"hasWordChar");function Sz(t){return e=>{if(!/\S/.test(e))return ft.Space;if(xz(e))return ft.Word;for(let n=0;n-1)return ft.Word;return ft.Other}}u(Sz,"makeCategorizer");let Xe=(Mt=class{constructor(e,n,r,i,l,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=l,a&&(a._state=this);for(let o=0;oi.set(c,s)),n=null),i.set(o.value.compartment,o.value.extension)):o.is(Oe.reconfigure)?(n=null,r=o.value):o.is(Oe.appendConfig)&&(n=null,r=Ba(r).concat(o.value));let l;n?l=e.startState.values.slice():(n=TE.resolve(r,i,this),l=new Mt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(s,c)=>c.reconfigure(s,this),null).values);let a=e.startState.facet(A0)?e.newSelection:e.newSelection.asSingle();new Mt(n,e.newDoc,a,l,(o,s)=>s.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:X.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),l=[r.range],a=Ba(r.effects);for(let o=1;oa.spec.fromJSON(o,s)))}}return Mt.create({doc:e.doc,selection:X.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=TE.resolve(e.extensions||[],new Map),r=e.doc instanceof pe?e.doc:pe.of((e.doc||"").split(n.staticFacet(Mt.lineSeparator)||C0)),i=e.selection?e.selection instanceof X?e.selection:X.single(e.selection.anchor,e.selection.head):X.single(0);return PE(i,r.length),n.staticFacet(A0)||(i=i.asSingle()),new Mt(n,r,i,n.dynamicSlots.map(()=>null),(l,a)=>a.create(l),null)}get tabSize(){return this.facet(Mt.tabSize)}get lineBreak(){return this.facet(Mt.lineSeparator)||` @@ -19,7 +19,7 @@ var Nne=Object.defineProperty;var u=(om,Ic)=>Nne(om,"name",{value:Ic,configurabl `,i=t.state.doc.line(i.number+(n?1:-1)),l=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(s){if(!s(d))return o}else{if(!r)return c;s=r(d)}o=c}}u(L6,"moveByChar");function sZ(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return l=>{let a=r(l);return i==ft.Space&&(i=a),i==a}}u(sZ,"byGroup");function uZ(t,e,n,r){let i=e.head,l=n?1:-1;if(i==(n?t.state.doc.length:0))return X.cursor(i,e.assoc);let a=e.goalColumn,o,s=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),d=t.documentTop;if(c)a==null&&(a=c.left-s.left),o=l<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(s.right-s.left,t.defaultCharacterWidth*(i-p.from))),o=(l<0?p.top:p.bottom)+d}let f=s.left+a,h=r??t.viewState.heightOracle.textHeight>>1;for(let p=0;;p+=10){let m=o+(h+p)*l,g=N6(t,{x:f,y:m},!1,l);if(ms.bottom||(l<0?gi)){let O=t.docView.coordsForChar(g),b=!O||m{if(e>l&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:X.cursor(r,rl)&&!dZ(a,n)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let l=-1,a=1,o;if(this.lineSeparator?(l=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(o=i.exec(n))&&(l=o.index,a=o[0].length),this.append(n.slice(r,l<0?n.length:l)),l<0)break;if(this.lineBreak(),a>1)for(let s of this.points)s.node==e&&s.pos>this.text.length&&(s.pos-=a-1);r=l+a}}readNode(e){if(e.cmIgnore)return;let n=Se.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(cZ(e,r.node,r.offset)?n:0))}};u(Wv,"DOMReader");let mO=Wv;function cZ(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:l,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let o=l||a?[]:hZ(e),s=new mO(o,e.state);s.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=s.text,this.newSel=pZ(o,this.bounds.from)}else{let o=e.observer.selectionRange,s=l&&l.node==o.focusNode&&l.offset==o.focusOffset||!_0(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),c=a&&a.node==o.anchorNode&&a.offset==o.anchorOffset||!_0(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),d=e.viewport;if((U.ios||U.chrome)&&e.state.selection.main.empty&&s!=c&&(d.from>0||d.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:o}=e.bounds,s=i.from,c=null;(l===8||U.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:U.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` `&&t.lineWrapping&&(r&&(r=X.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:pe.of([" "])}),n)return OO(t,n,r,l);if(r&&!r.main.eq(i)){let a=!1,o="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),o=t.inputState.lastSelectionOrigin,o=="select.pointer"&&(r=z6(t.state.facet(Zs).map(s=>s(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:o}),!0}else return!1}u(Z6,"applyDOMChange");function OO(t,e,n,r=-1){if(U.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(U.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Na(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&Na(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Na(t.contentDOM,"Delete",46)))return!0;let l=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,o=u(()=>a||(a=fZ(t,e,n)),"defaultInsert");return t.state.facet(w6).some(s=>s(t,e.from,e.to,l,o))||t.dispatch(o()),!0}u(OO,"applyDOMChangeInner");function fZ(t,e,n){let r,i=t.state,l=i.selection.main,a=-1;if(e.from==e.to&&e.froml.to){let s=e.fromf(t)),c,s);e.from==d&&(a=d)}if(a>-1)r={changes:e,selection:X.cursor(e.from+e.insert.length,-1)};else if(e.from>=l.from&&e.to<=l.to&&e.to-e.from>=(l.to-l.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let s=l.frome.to?i.sliceDoc(e.to,l.to):"";r=i.replaceSelection(t.state.toText(s+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let s=i.changes(e),c=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=l.to&&e.to>=l.to-10){let d=t.state.sliceDoc(e.from,e.to),f,h=n&&M6(t,n.main.head);if(h){let g=e.insert.length-(e.to-e.from);f={from:h.from,to:h.to-g}}else f=t.state.doc.lineAt(l.head);let p=l.to-e.to,m=l.to-l.from;r=i.changeByRange(g=>{if(g.from==l.from&&g.to==l.to)return{changes:s,range:c||g.map(s)};let O=g.to-p,b=O-d.length;if(g.to-g.from!=m||t.state.sliceDoc(b,O)!=d||g.to>=f.from&&g.from<=f.to)return{range:g};let y=i.changes({from:b,to:O,insert:e.insert}),$=g.to-l.to;return{changes:y,range:c?X.range(Math.max(0,c.anchor+$),Math.max(0,c.head+$)):g.map(y)}})}else r={changes:s,selection:c&&i.selection.replaceRange(c)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}u(fZ,"applyDefaultInsert");function X6(t,e,n,r){let i=Math.min(t.length,e.length),l=0;for(;l0&&o>0&&t.charCodeAt(a-1)==e.charCodeAt(o-1);)a--,o--;if(r=="end"){let s=Math.max(0,l-Math.min(a,o));n-=a+s-l}if(a=a?l-n:0;l-=s,o=l+(o-a),a=l}else if(o=o?l-n:0;l-=s,a=l+(a-o),o=l}return{from:l,toA:a,toB:o}}u(X6,"findDiff$1");function hZ(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:l}=t.observer.selectionRange;return n&&(e.push(new mf(n,r)),(i!=n||l!=r)&&e.push(new mf(i,l))),e}u(hZ,"selectionPoints");function pZ(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?X.single(n+e,r+e):null}u(pZ,"selectionFromPoints");let mZ=(cc=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,U.safari&&e.contentDOM.addEventListener("input",()=>null),U.gecko&&TZ(e.contentDOM.ownerDocument)}handleEvent(e){!wZ(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=gZ(e),r=this.handlers,i=this.view.contentDOM;for(let l in n)if(l!="scroll"){let a=!n[l].handlers.length,o=r[l];o&&a!=!o.handlers.length&&(i.removeEventListener(l,this.handleEvent),o=null),o||i.addEventListener(l,this.handleEvent,{passive:a})}for(let l in r)l!="scroll"&&!n[l]&&i.removeEventListener(l,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&W6.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),U.android&&U.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return U.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=q6.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||OZ.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:U.safari&&!U.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}},u(cc,"InputState"),cc);function j6(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Ht(n.state,i)}}}u(j6,"bindHandler");function gZ(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}u(n,"record");for(let r of t){let i=r.spec,l=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(l)for(let o in l){let s=l[o];s&&n(o).handlers.push(j6(r.value,s))}if(a)for(let o in a){let s=a[o];s&&n(o).observers.push(j6(r.value,s))}}for(let r in An)n(r).handlers.push(An[r]);for(let r in bn)n(r).observers.push(bn[r]);return e}u(gZ,"computeHandlers");const q6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],OZ="dthko",W6=[16,17,18,20,91,92,224,225],gf=6;function Of(t){return Math.max(0,t)*.7+8}u(Of,"dragScrollSpeed");function bZ(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}u(bZ,"dist");const Uv=class Uv{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Tz(e.contentDOM),this.atoms=e.state.facet(Zs).map(a=>a(e));let l=e.contentDOM.ownerDocument;l.addEventListener("mousemove",this.move=this.move.bind(this)),l.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Xe.allowMultipleSelections)&&yZ(e,n),this.dragging=$Z(e,n)&&tT(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&bZ(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,l=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:l,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=cO(this.view);e.clientX-s.left<=i+gf?n=-Of(i-e.clientX):e.clientX+s.right>=a-gf&&(n=Of(e.clientX-a)),e.clientY-s.top<=l+gf?r=-Of(l-e.clientY):e.clientY+s.bottom>=o-gf&&(r=Of(e.clientY-o)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=z6(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};u(Uv,"MouseSelection");let bO=Uv;function yZ(t,e){let n=t.state.facet(b6);return n.length?n[0](e):U.mac?e.metaKey:e.ctrlKey}u(yZ,"addsSelectionRange");function vZ(t,e){let n=t.state.facet(y6);return n.length?n[0](e):U.mac?!e.altKey:!e.ctrlKey}u(vZ,"dragMovesSelection");function $Z(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=As(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let l=0;l=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}u($Z,"isInPrimarySelection");function wZ(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Se.get(n))&&r.ignoreEvent(e))return!1;return!0}u(wZ,"eventBelongsToEditor");const An=Object.create(null),bn=Object.create(null),Y6=U.ie&&U.ie_version<15||U.ios&&U.webkit_version<604;function xZ(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),K6(t,n.value)},50)}u(xZ,"capturePaste$1");function bf(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}u(bf,"textFilter");function K6(t,e){e=bf(t.state,oO,e);let{state:n}=t,r,i=1,l=n.toText(e),a=l.lines==n.selection.ranges.length;if(yO!=null&&n.selection.ranges.every(s=>s.empty)&&yO==l.toString()){let s=-1;r=n.changeByRange(c=>{let d=n.doc.lineAt(c.from);if(d.from==s)return{range:c};s=d.from;let f=n.toText((a?l.line(i++).text:e)+n.lineBreak);return{changes:{from:d.from,insert:f},range:X.cursor(c.from+f.length)}})}else a?r=n.changeByRange(s=>{let c=l.line(i++);return{changes:{from:s.from,to:s.to,insert:c.text},range:X.cursor(s.from+c.length)}}):r=n.replaceSelection(l);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}u(K6,"doPaste$1"),bn.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},An.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),bn.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},bn.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},An.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(v6))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=kZ(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new bO(t,e,n,r)),r&&t.observer.ignore(()=>{JE(t.contentDOM);let l=t.root.activeElement;l&&!l.contains(t.contentDOM)&&l.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function U6(t,e,n,r){if(r==1)return X.cursor(e,n);if(r==2)return nZ(t.state,e,n);{let i=rt.find(t.docView,e),l=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:l.from,o=i?i.posAtEnd:l.to;return oe>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right,"inside");function SZ(t,e,n,r){let i=rt.find(t.docView,e);if(!i)return 1;let l=e-i.posAtStart;if(l==0)return 1;if(l==i.length)return-1;let a=i.coordsAt(l,-1);if(a&&G6(n,r,a))return-1;let o=i.coordsAt(l,1);return o&&G6(n,r,o)?1:a&&a.bottom>=r?-1:1}u(SZ,"findPositionSide");function _6(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:SZ(t,n,e.clientX,e.clientY)}}u(_6,"queryPos");const CZ=U.ie&&U.ie_version<=11;let H6=null,J6=0,eT=0;function tT(t){if(!CZ)return t.detail;let e=H6,n=eT;return H6=t,eT=Date.now(),J6=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(J6+1)%3:1}u(tT,"getClickType");function kZ(t,e){let n=_6(t,e),r=tT(e),i=t.state.selection;return{update(l){l.docChanged&&(n.pos=l.changes.mapPos(n.pos),i=i.map(l.changes))},get(l,a,o){let s=_6(t,l),c,d=U6(t,s.pos,s.bias,r);if(n.pos!=s.pos&&!a){let f=U6(t,n.pos,n.bias,r),h=Math.min(f.from,d.from),p=Math.max(f.to,d.to);d=h1&&(c=DZ(i,s.pos))?c:o?i.addRange(d):X.create([d])}}}u(kZ,"basicMouseSelection");function DZ(t,e){for(let n=0;n=e)return X.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}u(DZ,"removeRangeAround"),An.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let l=i.posAtStart,a=l+i.length;(l>=n.to||a<=n.from)&&(n=X.range(l,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",bf(t.state,sO,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1},An.dragend=t=>(t.inputState.draggedContent=null,!1);function nT(t,e,n,r){if(n=bf(t.state,oO,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:l}=t.inputState,a=r&&l&&vZ(t,e)?{from:l.from,to:l.to}:null,o={from:i,insert:n},s=t.state.changes(a?[a,o]:o);t.focus(),t.dispatch({changes:s,selection:{anchor:s.mapPos(i,-1),head:s.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}u(nT,"dropText"),An.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,l=u(()=>{++i==n.length&&nT(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)},"finishFile");for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(r[a]=o.result),l()},o.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return nT(t,e,r,!0),!0}return!1},An.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Y6?null:e.clipboardData;return n?(K6(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(xZ(t),!1)};function PZ(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}u(PZ,"captureCopy$1");function EZ(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:l}of t.selection.ranges){let a=t.doc.lineAt(l);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:bf(t,sO,e.join(t.lineBreak)),ranges:n,linewise:r}}u(EZ,"copiedRange");let yO=null;An.copy=An.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=EZ(t.state);if(!n&&!i)return!1;yO=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let l=Y6?null:e.clipboardData;return l?(l.clearData(),l.setData("text/plain",n),!0):(PZ(t,n),!1)};const rT=Tn.define();function iT(t,e){let n=[];for(let r of t.facet(x6)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:rT.of(!0)}):null}u(iT,"focusChangeTransaction");function lT(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=iT(t.state,e);n?t.dispatch(n):t.update([])}},10)}u(lT,"updateForFocusChange"),bn.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),lT(t)},bn.blur=t=>{t.observer.clearSelectionRange(),lT(t)},bn.compositionstart=bn.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},bn.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,U.chrome&&U.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},bn.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},An.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let l=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(l&&a.length){let o=a[0],s=t.posAtDOM(o.startContainer,o.startOffset),c=t.posAtDOM(o.endContainer,o.endOffset);return OO(t,{from:s,to:c,insert:t.state.toText(l)},null),!0}}let i;if(U.chrome&&U.android&&(i=q6.find(l=>l.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let l=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>l+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return U.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),U.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>bn.compositionend(t,e),20),!1};const aT=new Set;function TZ(t){aT.has(t)||(aT.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}u(TZ,"firefoxCopyCutHack");const oT=["pre-wrap","normal","pre-line","break-spaces"];let Ia=!1;function sT(){Ia=!1}u(sT,"clearHeightChangeFlag");const Gv=class Gv{constructor(e){this.lineWrapping=e,this.doc=pe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return oT.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=l,s){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>yf&&(Ia=!0),this.height=e)}replace(e,n,r){return Do.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let l=this,a=r.doc;for(let o=i.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:d,toB:f}=i[o],h=l.lineAt(s,Qe.ByPosNoHeight,r.setDoc(n),0,0),p=h.to>=c?h:l.lineAt(c,Qe.ByPosNoHeight,r,0,0);for(f+=p.to-c,c=p.to;o>0&&h.from<=i[o-1].toA;)s=i[o-1].fromA,d=i[o-1].fromB,o--,sl*2){let o=e[n-1];o.break?e.splice(--n,1,o.left,null,o.right):e.splice(--n,1,o.left,o.right),r+=1+o.break,i-=o.size}else if(l>i*2){let o=e[r];o.break?e.splice(r,1,o.left,null,o.right):e.splice(r,1,o.left,o.right),r+=2+o.break,l-=o.size}else break;else if(i=l&&a(this.blockAt(0,r,i,l))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}};u(Hv,"HeightMapBlock");let $f=Hv;const dc=class dc extends $f{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new nr(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof dc||i instanceof wi&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof wi?i=new dc(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Jt.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}};u(dc,"HeightMapText");let yn=dc;const on=class on extends Jt{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,l=i-r+1,a,o=0;if(e.lineWrapping){let s=Math.min(this.height,e.lineHeight*l);a=s/l,this.length>l+1&&(o=(this.height-s)/(this.length-l-1))}else a=this.height/l;return{firstLine:r,lastLine:i,perLine:a,perChar:o}}blockAt(e,n,r,i){let{firstLine:l,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let l=r[r.length-1];l instanceof on?r[r.length-1]=new on(l.length+i):r.push(null,new on(i-1))}if(e>0){let l=r[0];l instanceof on?r[0]=new on(e+l.length):r.unshift(new on(e-1),null)}return Jt.of(r)}decomposeLeft(e,n){n.push(new on(e-1),null)}decomposeRight(e,n){n.push(null,new on(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let l=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&a.push(new on(i.from-n-1).updateHeight(e,n));o<=l&&i.more;){let d=e.doc.lineAt(o).length;a.length&&a.push(null);let f=i.heights[i.index++];s==-1?s=f:Math.abs(f-s)>=yf&&(s=-2);let h=new yn(d,f);h.outdated=!1,a.push(h),o+=d+1}o<=l&&a.push(null,new on(l-o).updateHeight(e,o));let c=Jt.of(a);return(s<0||Math.abs(c.height-this.height)>=yf||Math.abs(s-this.heightMetrics(e,n).perLine)>=yf)&&(Ia=!0),vf(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}};u(on,"HeightMapGap");let wi=on;const Jv=class Jv extends Jt{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let l=r+this.left.height;return eo))return c;let d=n==Qe.ByPosNoHeight?Qe.ByPosNoHeight:Qe.ByPos;return s?c.join(this.right.lineAt(o,d,r,a,o)):this.left.lineAt(o,d,r,i,l).join(c)}forEachLine(e,n,r,i,l,a){let o=i+this.left.height,s=l+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,n,r,o,s,a);else{let c=this.lineAt(s,Qe.ByPos,r,i,l);e=e&&c.from<=n&&a(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,o,s,a)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let l=[];e>0&&this.decomposeLeft(e,l);let a=l.length;for(let o of r)l.push(o);if(e>0&&uT(l,a-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?Jt.of(this.break?[e,null,n]:[e,n]):(this.left=vf(this.left,e),this.right=vf(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:l,right:a}=this,o=n+l.length+this.break,s=null;return i&&i.from<=n+l.length&&i.more?s=l=l.updateHeight(e,n,r,i):l.updateHeight(e,n,r),i&&i.from<=o+a.length&&i.more?s=a=a.updateHeight(e,o,r,i):a.updateHeight(e,o,r),s?this.balanced(l,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};u(Jv,"HeightMapBranch");let wO=Jv;function uT(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof wi&&(r=t[e+1])instanceof wi&&t.splice(e-1,3,new wi(n.length+1+r.length))}u(uT,"mergeGaps");const AZ=5,Rp=class Rp{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof yn?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new yn(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=AZ)&&this.addLineDeco(i,l,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new yn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new wi(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof yn)return e;let n=new yn(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof yn)&&!this.isCovered?this.nodes.push(new yn(0,-1)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();l=Math.max(l,h.left),a=Math.min(a,h.right),o=Math.max(o,h.top),s=Math.min(c==t.parentNode?i.innerHeight:s,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:l-n.left,right:Math.max(l,a)-n.left,top:o-(n.top+e),bottom:Math.max(o,s)-(n.top+e)}}u(MZ,"visiblePixelRange");function BZ(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}u(BZ,"inWindow");function RZ(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}u(RZ,"fullPixelRange");const t4=class t4{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new vO(n),this.stateDeco=e.facet(zs).filter(r=>typeof r!="function"),this.heightMap=Jt.empty().applyChanges(this.stateDeco,pe.empty,this.heightOracle.setDoc(e.doc),[new tr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=re.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:l,to:a})=>i>=l&&i<=a)){let{from:l,to:a}=this.lineBlockAt(i);e.push(new La(l,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?cT:new kO(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ys(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(zs).filter(d=>typeof d!="function");let i=e.changedRanges,l=tr.extendWithRanges(i,QZ(r,this.stateDeco,e?e.changes:Ut.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);sT(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),l),(this.heightMap.height!=a||Ia)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=l.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,n));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(C6)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,l=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Ve.RTL:Ve.LTR;let a=this.heightOracle.mustRefreshForWrapping(l),o=n.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,d=0;if(o.width&&o.height){let{scaleX:v,scaleY:S}=HE(n,o);(v>.005&&Math.abs(this.scaleX-v)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=v,this.scaleY=S,c|=16,a=s=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,h=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=n6(e.scrollDOM);let m=(this.printing?RZ:MZ)(n,this.paddingTop),g=m.top-this.pixelViewport.top,O=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(s=!0)),!this.inView&&!this.scrollTarget&&!BZ(e.dom))return 0;let y=o.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let v=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(v)&&(a=!0),a||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:x,textHeight:C}=e.docView.measureTextSize();a=S>0&&i.refresh(l,S,x,C,Math.max(5,y/x),v),a&&(e.docView.minWidth=0,c|=16)}g>0&&O>0?d=Math.max(g,O):g<0&&O<0&&(d=Math.min(g,O)),sT();for(let S of this.viewports){let x=S.from==this.viewport.from?v:e.docView.measureVisibleLineHeights(S);this.heightMap=(a?Jt.empty().applyChanges(this.stateDeco,pe.empty,this.heightOracle,[new tr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new $O(S.from,x))}Ia&&(c|=2)}let $=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return $&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),c|=this.updateForViewport()),(c&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,l=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new La(i.lineAt(a-r*1e3,Qe.ByHeight,l,0,0).from,i.lineAt(o+(1-r)*1e3,Qe.ByHeight,l,0,0).to);if(n){let{head:c}=n.range;if(cs.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Qe.ByPos,l,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&c=o+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&l>1,a=i<<1;if(this.defaultTextDirection!=Ve.LTR&&!r)return[];let o=[],s=u((d,f,h,p)=>{if(f-dd&&bb.from>=h.from&&b.to<=h.to&&Math.abs(b.from-d)b.fromy));if(!O){if(f$.from<=f&&$.to>=f)){let $=n.moveToLineBoundary(X.cursor(f),!1,!0).head;$>d&&(f=$)}let b=this.gapSize(h,d,f,p),y=r||b<2e6?b:2e6;O=new Ws(d,f,b,y)}o.push(O)},"addGap"),c=u(d=>{if(d.length2e6)for(let x of e)x.from>=d.from&&x.fromd.from&&s(d.from,p,d,f),mn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Te.spans(n,this.viewport.from,this.viewport.to,{span(l,a){r.push({from:l,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let l=0;l=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Ys(this.heightMap.lineAt(e,Qe.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Ys(this.heightMap.lineAt(this.scaler.fromDOM(e),Qe.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Ys(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}};u(r4,"ViewState");let wf=r4;const i4=class i4{constructor(e,n){this.from=e,this.to=n}};u(i4,"Viewport");let La=i4;function VZ(t,e,n){let r=[],i=t,l=0;return Te.spans(n,t,e,{span(){},point(a,o){a>i&&(r.push({from:i,to:a}),l+=a-i),i=o}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:l,to:a}=e[i],o=a-l;if(r<=o)return l+r;r-=o}}u(xf,"findPosition");function Sf(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}u(Sf,"findFraction");function NZ(t,e){for(let n of t)if(e(n))return n}u(NZ,"find");const cT={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}},Vp=class Vp{constructor(e,n,r){let i=0,l=0,a=0;this.viewports=r.map(({from:o,to:s})=>{let c=n.lineAt(o,Qe.ByPos,e,0,0).top,d=n.lineAt(s,Qe.ByPos,e,0,0).bottom;return i+=d-c,{from:o,to:s,top:c,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let o of this.viewports)o.domTop=a+(o.top-l)*this.scale,a=o.domBottom=o.domTop+(o.bottom-o.top),l=o.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let l=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}};u(Vp,"BigScaler");let kO=Vp;function Ys(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new nr(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Ys(i,e)):t._content)}u(Ys,"scaleBlock");const Cf=_.define({combine:t=>t.join(" ")}),DO=_.define({combine:t=>t.indexOf(!0)>-1}),PO=Un.newName(),dT=Un.newName(),fT=Un.newName(),hT={"&light":"."+dT,"&dark":"."+fT};function EO(t,e,n){return new Un(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}u(EO,"buildTheme");const FZ=EO("."+PO,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},hT),IZ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},TO=U.ie&&U.ie_version<=11;let LZ=(fc=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new H0,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(U.ie&&U.ie_version<=11||U.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&U.android&&e.constructor.EDIT_CONTEXT!==!1&&!(U.chrome&&U.chrome_version<126)&&(this.editContext=new AO(e),e.state.facet(Ir)&&(e.contentDOM.editContext=this.editContext.editContext)),TO&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ir)?r.root.activeElement!=this.dom:!lf(this.dom,i))return;let l=i.anchorNode&&r.docView.nearest(i.anchorNode);if(l&&l.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(U.ie&&U.ie_version<=11||U.android&&U.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Qs(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=As(e.root);if(!n)return!1;let r=U.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&zZ(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=lf(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let l=this.delayedAndroidKey;l&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=l.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&l.force&&Na(this.dom,l.key,l.keyCode))},"flush");this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let l of e){let a=this.readMutation(l);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&lf(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let l=new gO(this.view,e,n,r);return this.view.docView.domChanged={newSel:l.newSel?l.newSel.main:null},l}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=Z6(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=pT(n,e.previousSibling||e.target.previousSibling,-1),i=pT(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ir)!=e.state.facet(Ir)&&(e.view.contentDOM.editContext=e.state.facet(Ir)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}},u(fc,"DOMObserver"),fc);function pT(t,e,n){for(;e;){let r=Se.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}u(pT,"findChild");function mT(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,l=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return Qs(a.node,a.offset,i,l)&&([n,r,i,l]=[i,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:l}}u(mT,"buildSelectionRangeFromRange");function zZ(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return mT(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return u(r,"read"),t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?mT(t,n):null}u(zZ,"safariSelectionRangeHack");const l4=class l4{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:l,head:a}=i,o=this.toEditorPos(r.updateRangeStart),s=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>r.text.length;o==this.from&&lthis.to&&(s=l);let d=X6(e.state.sliceDoc(o,s),r.text,(c?i.from:i.to)-o,c?"end":null);if(!d){let h=X.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));h.main.eq(i)||e.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+o,to:d.toA+o,insert:pe.of(r.text.slice(d.from,d.toB).split(` `))};if((U.mac||U.android)&&f.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:o,to:s,insert:pe.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);OO(e,f,X.single(this.toEditorPos(r.selectionStart,h),this.toEditorPos(r.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],l=null;for(let a=this.toEditorPos(r.rangeStart),o=this.toEditorPos(r.rangeEnd);a{let i=[];for(let l of r.getTextFormats()){let a=l.underlineStyle,o=l.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(o)){let s=this.toEditorPos(l.rangeStart),c=this.toEditorPos(l.rangeEnd);if(s{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=As(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((l,a,o,s,c)=>{if(r)return;let d=c.length-(a-l);if(i&&a>=i.to)if(i.from==l&&i.to==a&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=d,this.to+=d;return}else i=null,this.revertPending(e.state);if(l+=n,a+=n,a<=this.from)this.from+=d,this.to+=d;else if(lthis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(l),this.toContextPos(a),c.toString()),this.to+=d}n+=d}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}};u(l4,"EditContextManager");let AO=l4,J=(jl=class{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(l=>r(l,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Az(e.parent)||document,this.viewState=new wf(e.state||Xe.create(e)),e.scrollTo&&e.scrollTo.is(ff)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Fa).map(i=>new Ls(i));for(let i of this.plugins)i.update(this);this.observer=new LZ(this),this.inputState=new mZ(this),this.inputState.ensureHandlers(this.plugins),this.docView=new pf(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof xt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,l=this.state;for(let h of e){if(h.startState!=l)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");l=h.state}if(this.destroyed){this.viewState.state=l;return}let a=this.hasFocus,o=0,s=null;e.some(h=>h.annotation(rT))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=iT(l,a),s||(o=1));let c=this.observer.delayedAndroidKey,d=null;if(c?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(l.doc)||!this.state.selection.eq(l.selection))&&(d=null)):this.observer.clear(),l.facet(Xe.phrases)!=this.state.facet(Xe.phrases))return this.setState(l);i=hf.create(this,l,e),i.flags|=o;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of e){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:p}=h.state.selection;f=new Is(p.empty?p:X.cursor(p.head,p.head>p.anchor?-1:1))}for(let p of h.effects)p.is(ff)&&(f=p.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=kf.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Xs)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Cf)!=i.state.facet(Cf)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let h of this.state.facet(aO))try{h(i)}catch(p){Ht(this.state,p,"update listener")}(s||d)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),d&&!Z6(this,d)&&c.force&&Na(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new wf(e),this.plugins=e.facet(Fa).map(r=>new Ls(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new pf(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Fa),r=e.state.facet(Fa);if(n!=r){let i=[];for(let l of r){let a=n.indexOf(l);if(a<0)i.push(new Ls(l));else{let o=this.plugins[a];o.mustUpdate=e,i.push(o)}}for(let l of this.plugins)l.mustUpdate!=e&&l.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:l,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(a<0)if(n6(r))l=-1,a=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);l=p.from,a=p.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];s&4||([this.measureRequests,c]=[c,this.measureRequests]);let d=c.map(p=>{try{return p.read(this)}catch(m){return Ht(this.state,m),gT}}),f=hf.create(this,this.state,[]),h=!1;f.flags|=s,n?n.flags|=s:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let p=0;p1||m<-1){i=i+m,r.scrollTop=i/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let o of this.state.facet(aO))o(n)}get themeClasses(){return PO+" "+(this.state.facet(DO)?fT:dT)+" "+this.state.facet(Cf)}updateAttrs(){let e=OT(this,P6,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ir)?"true":"false",class:"cm-content",style:`${U.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),OT(this,uO,n);let r=this.observer.ignore(()=>{let i=tO(this.contentDOM,this.contentAttrs,n),l=tO(this.dom,this.editorAttrs,e);return i||l});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(jl.announce)){n&&(this.announceDOM.textContent=""),n=!1;let l=this.announceDOM.appendChild(document.createElement("div"));l.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Xs);let e=this.state.facet(jl.cspNonce);Un.mount(this.root,this.styleModules.concat(FZ).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return pO(this,e,L6(this,e,n,r))}moveByGroup(e,n){return pO(this,e,L6(this,e,n,r=>sZ(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),l=r[n?r.length-1:0];return X.cursor(l.side(n,i)+e.from,l.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return oZ(this,e,n,r)}moveVertically(e,n,r){return pO(this,e,uZ(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),N6(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),l=this.bidiSpans(i),a=l[er.find(l,e-i.from,-1,n)];return Ms(r,a.dir==Ve.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(S6)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ZZ)return g6(e.length);let n=this.textDirectionAt(e.from),r;for(let l of this.bidiCache)if(l.from==e.from&&l.dir==n&&(l.fresh||m6(l.isolates,r=A6(this,e))))return l.order;r||(r=A6(this,e));let i=qz(e.text,n,r);return this.bidiCache.push(new kf(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||U.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{JE(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return ff.of(new Is(typeof e=="number"?X.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return ff.of(new Is(X.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return it.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return it.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Un.newName(),i=[Cf.of(r),Xs.of(EO(`.${r}`,e))];return n&&n.dark&&i.push(DO.of(!0)),i}static baseTheme(e){return cl.lowest(Xs.of(EO("."+PO,e,hT)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Se.get(r)||Se.get(e);return((n=i?.rootView)===null||n===void 0?void 0:n.view)||null}},u(jl,"EditorView"),jl);J.styleModule=Xs,J.inputHandler=w6,J.clipboardInputFilter=oO,J.clipboardOutputFilter=sO,J.scrollHandler=k6,J.focusChangeEffect=x6,J.perLineTextDirection=S6,J.exceptionSink=$6,J.updateListener=aO,J.editable=Ir,J.mouseSelectionStyle=v6,J.dragMovesSelection=y6,J.clickAddsSelectionRange=b6,J.decorations=zs,J.outerDecorations=E6,J.atomicRanges=Zs,J.bidiIsolatedRanges=T6,J.scrollMargins=Q6,J.darkTheme=DO,J.cspNonce=_.define({combine:t=>t.length?t[0]:""}),J.contentAttributes=uO,J.editorAttributes=P6,J.lineWrapping=J.contentAttributes.of({class:"cm-lineWrapping"}),J.announce=Oe.define();const ZZ=4096,gT={},Np=class Np{constructor(e,n,r,i,l,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=l,this.order=a}static update(e,n){if(n.empty&&!e.some(l=>l.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Ve.LTR;for(let l=Math.max(0,e.length-10);l=0;i--){let l=r[i],a=typeof l=="function"?l(t):l;a&&eO(a,n)}return n}u(OT,"attrsFromFacet");const XZ=U.mac?"mac":U.windows?"win":U.linux?"linux":"key";function jZ(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,l,a,o;for(let s=0;sr.concat(i),[]))),n}u(WZ,"getKeymap");let xi=null;const YZ=4e3;function KZ(t,e=XZ){let n=Object.create(null),r=Object.create(null),i=u((a,o)=>{let s=r[a];if(s==null)r[a]=o;else if(s!=o)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},"checkPrefix"),l=u((a,o,s,c,d)=>{var f,h;let p=n[a]||(n[a]=Object.create(null)),m=o.split(/ (?!$)/).map(b=>jZ(b,e));for(let b=1;b{let v=xi={view:$,prefix:y,scope:a};return setTimeout(()=>{xi==v&&(xi=null)},YZ),!0}]})}let g=m.join(" ");i(g,!1);let O=p[g]||(p[g]={preventDefault:!1,stopPropagation:!1,run:((h=(f=p._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});s&&O.run.push(s),c&&(O.preventDefault=!0),d&&(O.stopPropagation=!0)},"add");for(let a of t){let o=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let c of o){let d=n[c]||(n[c]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=a;for(let h in d)d[h].run.push(p=>f(p,QO))}let s=a[e]||a.key;if(s)for(let c of o)l(c,s,a.run,a.preventDefault,a.stopPropagation),a.shift&&l(c,"Shift-"+s,a.shift,a.preventDefault,a.stopPropagation)}return n}u(KZ,"buildKeymap$1");let QO=null;function UZ(t,e,n,r){QO=e;let i=qE(e),l=Ft(i,0),a=Kn(l)==i.length&&i!=" ",o="",s=!1,c=!1,d=!1;xi&&xi.view==n&&xi.scope==r&&(o=xi.prefix+" ",W6.indexOf(e.keyCode)<0&&(c=!0,xi=null));let f=new Set,h=u(O=>{if(O){for(let b of O.run)if(!f.has(b)&&(f.add(b),b(n)))return O.stopPropagation&&(d=!0),!0;O.preventDefault&&(O.stopPropagation&&(d=!0),c=!0)}return!1},"runFor"),p=t[r],m,g;return p&&(h(p[o+Df(i,e,!a)])?s=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(U.windows&&e.ctrlKey&&e.altKey)&&!(U.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=Fr[e.keyCode])&&m!=i?(h(p[o+Df(m,e,!0)])||e.shiftKey&&(g=Ts[e.keyCode])!=i&&g!=m&&h(p[o+Df(g,e,!1)]))&&(s=!0):a&&e.shiftKey&&h(p[o+Df(i,e,!0)])&&(s=!0),!s&&h(p._any)&&(s=!0)),c&&(s=!0),s&&d&&e.stopPropagation(),QO=null,s}u(UZ,"runHandlers");const Fp=class Fp{constructor(e,n,r,i,l){this.className=e,this.left=n,this.top=r,this.width=i,this.height=l}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let l=yT(e);return[new Fp(n,i.left-l.left,i.top-l.top,null,i.bottom-i.top)]}else return GZ(e,n,r)}};u(Fp,"RectangleMarker");let Ks=Fp;function yT(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Ve.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}u(yT,"getBase");function vT(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let l=t.dom.getBoundingClientRect(),a=(i.top+i.bottom)/2,o=t.posAtCoords({x:l.left+1,y:a}),s=t.posAtCoords({x:l.right-1,y:a});return o==null||s==null?r:{from:Math.max(r.from,Math.min(o,s)),to:Math.min(r.to,Math.max(o,s))}}u(vT,"wrappedLine");function GZ(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),l=t.textDirection==Ve.LTR,a=t.contentDOM,o=a.getBoundingClientRect(),s=yT(t),c=a.querySelector(".cm-line"),d=c&&window.getComputedStyle(c),f=o.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=o.right-(d?parseInt(d.paddingRight):0),p=hO(t,r,1),m=hO(t,i,-1),g=p.type==kt.Text?p:null,O=m.type==kt.Text?m:null;if(g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=vT(t,r,1,g)),O&&(t.lineWrapping||m.widgetLineBreaks)&&(O=vT(t,i,-1,O)),g&&O&&g.from==O.from&&g.to==O.to)return y($(n.from,n.to,g));{let S=g?$(n.from,null,g):v(p,!1),x=O?$(null,n.to,O):v(m,!0),C=[];return(g||p).to<(O||m).from-(g&&O?1:0)||p.widgetLineBreaks>1&&S.bottom+t.defaultLineHeight/2M&&E.from=D)break;k>I&&w(Math.max(L,I),S==null&&L<=M,Math.min(k,D),x==null&&k>=A,R.dir)}if(I=P.to+1,I>=D)break}return B.length==0&&w(M,S==null,A,x==null,t.textDirection),{top:Q,bottom:T,horizontal:B}}u($,"drawForLine");function v(S,x){let C=o.top+(x?S.top:S.bottom);return{top:C,bottom:C,horizontal:[]}}u(v,"drawForWidget")}u(GZ,"rectanglesForRange");function _Z(t,e){return t.constructor==e.constructor&&t.eq(e)}u(_Z,"sameMarker");const a4=class a4{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Ef)!=e.state.facet(Ef)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Ef);for(;n!_Z(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e,U.safari&&U.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}};u(a4,"LayerView");let MO=a4;const Ef=_.define();function $T(t){return[it.define(e=>new MO(e,t)),Ef.of(t)]}u($T,"layer");const Us=_.define({combine(t){return bi(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function HZ(t={}){return[Us.of(t),JZ,eX,tX,C6.of(!0)]}u(HZ,"drawSelection");function wT(t){return t.startState.facet(Us)!=t.state.facet(Us)}u(wT,"configChanged");const JZ=$T({above:!0,markers(t){let{state:e}=t,n=e.facet(Us),r=[];for(let i of e.selection.ranges){let l=i==e.selection.main;if(i.empty||n.drawRangeCursor){let a=l?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:X.cursor(i.head,i.head>i.anchor?-1:1);for(let s of Ks.forRange(t,a,o))r.push(s)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=wT(t);return n&&xT(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){xT(e.state,t)},class:"cm-cursorLayer"});function xT(t,e){e.style.animationDuration=t.facet(Us).cursorBlinkRate+"ms"}u(xT,"setBlinkRate");const eX=$T({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Ks.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||wT(t)},class:"cm-selectionLayer"}),tX=cl.highest(J.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function ST(t,e,n,r,i){e.lastIndex=0;for(let l=t.iterRange(n,r),a=n,o;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;o=e.exec(l.value);)i(a+o.index,o)}u(ST,"iterMatches");function nX(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:l}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),l=Math.min(t.state.doc.lineAt(l).to,l+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=l:r.push({from:i,to:l});return r}u(nX,"matchRanges");const o4=class o4{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:l,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(o,s,c,d)=>i(d,c,c+o[0].length,o,s);else if(typeof r=="function")this.addMatch=(o,s,c,d)=>{let f=r(o,s,c);f&&d(c,c+o[0].length,f)};else if(r)this.addMatch=(o,s,c,d)=>d(c,c+o[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=l,this.maxLength=a}createDeco(e){let n=new dl,r=n.add.bind(n);for(let{from:i,to:l}of nX(e,this.maxLength))ST(e.state.doc,this.regexp,i,l,(a,o)=>this.addMatch(o,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((l,a,o,s)=>{s>=e.view.viewport.from&&o<=e.view.viewport.to&&(r=Math.min(o,r),i=Math.max(s,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let l of e.visibleRanges){let a=Math.max(l.from,r),o=Math.min(l.to,i);if(o>=a){let s=e.state.doc.lineAt(a),c=s.tos.from;a--)if(this.boundary.test(s.text[a-1-s.from])){d=a;break}for(;oh.push(b.range(g,O)),"add");if(s==c)for(this.regexp.lastIndex=d-s.from;(p=this.regexp.exec(s.text))&&p.indexthis.addMatch(O,e,g,m));n=n.update({filterFrom:d,filterTo:f,filter:(g,O)=>gf,add:h})}}return n}};u(o4,"MatchDecorator");let Tf=o4;const BO=/x/.unicode!=null?"gu":"g",rX=new RegExp(`[\0-\b --\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,BO),iX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let RO=null;function lX(){var t;if(RO==null&&typeof document<"u"&&document.body){let e=document.body.style;RO=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return RO||!1}u(lX,"supportsTabSize");const Af=_.define({combine(t){let e=bi(t,{render:null,specialChars:rX,addSpecialChars:null});return(e.replaceTabs=!lX())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,BO)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,BO)),e}});function aX(t={}){return[Af.of(t),oX()]}u(aX,"highlightSpecialChars");let CT=null;function oX(){return CT||(CT=it.fromClass(class{constructor(t){this.view=t,this.decorations=re.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Af)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Tf({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,l=Ft(e[0],0);if(l==9){let a=i.lineAt(r),o=n.state.tabSize,s=Ra(a.text,o,r-a.from);return re.replace({widget:new NO((o-s%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[l]||(this.decorationCache[l]=re.replace({widget:new VO(t,l)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Af);t.startState.facet(Af)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}u(oX,"specialCharPlugin");const sX="\u2022";function uX(t){return t>=32?sX:t==10?"\u2424":String.fromCharCode(9216+t)}u(uX,"placeholder$1");const s4=class s4 extends Hn{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=uX(this.code),r=e.state.phrase("Control character")+" "+(iX[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let l=document.createElement("span");return l.textContent=n,l.title=r,l.setAttribute("aria-label",r),l.className="cm-specialChar",l}ignoreEvent(){return!1}};u(s4,"SpecialCharWidget");let VO=s4;const u4=class u4 extends Hn{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};u(u4,"TabWidget");let NO=u4;function cX(){return fX}u(cX,"highlightActiveLine");const dX=re.line({class:"cm-activeLine"}),fX=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(dX.range(i.from)),e=i.from)}return re.set(n)}},{decorations:t=>t.decorations}),c4=class c4 extends Hn{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Va(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Ms(n[0],r.direction!="rtl"),l=parseInt(r.lineHeight);return i.bottom-i.top>l*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+l}:i}ignoreEvent(){return!1}};u(c4,"Placeholder");let FO=c4;function hX(t){let e=it.fromClass(class{constructor(n){this.view=n,this.placeholder=t?re.set([re.widget({widget:new FO(t),side:1}).range(0)]):re.none}get decorations(){return this.view.state.doc.length?re.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,J.contentAttributes.of({"aria-placeholder":t})]:e}u(hX,"placeholder");const IO=2e3;function pX(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),l=[];if(e.off>IO||n.off>IO||e.col<0||n.col<0){let a=Math.min(e.off,n.off),o=Math.max(e.off,n.off);for(let s=r;s<=i;s++){let c=t.doc.line(s);c.length<=o&&l.push(X.range(c.from+a,c.to+o))}}else{let a=Math.min(e.col,n.col),o=Math.max(e.col,n.col);for(let s=r;s<=i;s++){let c=t.doc.line(s),d=z0(c.text,a,t.tabSize,!0);if(d<0)l.push(X.cursor(c.to));else{let f=z0(c.text,o,t.tabSize);l.push(X.range(c.from+d,c.from+f))}}}return l}u(pX,"rectangleFor");function mX(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}u(mX,"absoluteColumn");function kT(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,l=i>IO?-1:i==r.length?mX(t,e.clientX):Ra(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:l,off:i}}u(kT,"getPos");function gX(t,e){let n=kT(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let l=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(l);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get(i,l,a){let o=kT(t,i);if(!o)return r;let s=pX(t.state,n,o);return s.length?a?X.create(s.concat(r.ranges)):X.create(s):r}}:null}u(gX,"rectangleSelectionStyle");function OX(t){let e=t?.eventFilter||(n=>n.altKey&&n.button==0);return J.mouseSelectionStyle.of((n,r)=>e(r)?gX(n,r):null)}u(OX,"rectangularSelection");const bX={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},yX={style:"cursor: crosshair"};function vX(t={}){let[e,n]=bX[t.key||"Alt"],r=it.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,J.contentAttributes.of(i=>{var l;return!((l=i.plugin(r))===null||l===void 0)&&l.isDown?yX:null})]}u(vX,"crosshairCursor");const Gs="-10000px",d4=class d4{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let l=null;this.tooltipViews=this.tooltips.map(a=>l=r(a,l))}update(e,n){var r;let i=e.state.facet(this.facet),l=i.filter(s=>s);if(i===this.input){for(let s of this.tooltipViews)s.update&&s.update(e);return!1}let a=[],o=n?[]:null;for(let s=0;sn[c]=s),n.length=o.length),this.input=i,this.tooltips=l,this.tooltipViews=a,!0}};u(d4,"TooltipViewManager");let LO=d4;function $X(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}u($X,"windowSpace");const zO=_.define({combine:t=>{var e,n,r;return{position:U.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||$X}}}),DT=new WeakMap,PT=it.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(zO);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new LO(t,TT,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(zO);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Gs,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:l}=this.manager.tooltipViews[0];if(U.gecko)n=l.offsetParent!=this.container.ownerDocument.body;else if(l.style.top==Gs&&l.style.left=="0px"){let a=l.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}}if(n||this.position=="absolute")if(this.parent){let l=this.parent.getBoundingClientRect();l.width&&l.height&&(t=l.width/this.parent.offsetWidth,e=l.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=cO(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((l,a)=>{let o=this.manager.tooltipViews[a];return o.getCoords?o.getCoords(l.pos):this.view.coordsAtPos(l.pos)}),size:this.manager.tooltipViews.map(({dom:l})=>l.getBoundingClientRect()),space:this.view.state.facet(zO).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:l}=t,a=[];for(let o=0;o=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){d.style.top=Gs;continue}let p=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=p?7:0,g=h.right-h.left,O=(e=DT.get(c))!==null&&e!==void 0?e:h.bottom-h.top,b=c.offset||xX,y=this.view.textDirection==Ve.LTR,$=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(f.left-(p?14:0)+b.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(p?14:0)-b.x),r.right-g),v=this.above[o];!s.strictSide&&(v?f.top-O-m-b.yr.bottom)&&v==r.bottom-f.bottom>f.top-r.top&&(v=this.above[o]=!v);let S=(v?f.top-r.top:r.bottom-f.bottom)-m;if(S$&&Q.topx&&(x=v?Q.top-O-2-m:Q.bottom+m+2);if(this.position=="absolute"?(d.style.top=(x-t.parent.top)/l+"px",ET(d,($-t.parent.left)/i)):(d.style.top=x/l+"px",ET(d,$/i)),p){let Q=f.left+(y?b.x:-b.x)-($+14-7);p.style.left=Q/i+"px"}c.overlap!==!0&&a.push({left:$,top:x,right:C,bottom:x+O}),d.classList.toggle("cm-tooltip-above",v),d.classList.toggle("cm-tooltip-below",!v),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Gs}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ET(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}u(ET,"setLeftStyle");const wX=J.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),xX={x:0,y:0},TT=_.define({enables:[PT,wX]});function AT(t,e){let n=t.plugin(PT);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}u(AT,"getTooltip");const f4=class f4 extends Nr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};u(f4,"GutterMarker");let Qn=f4;Qn.prototype.elementClass="",Qn.prototype.toDOM=void 0,Qn.prototype.mapMode=ct.TrackBefore,Qn.prototype.startSide=Qn.prototype.endSide=-1,Qn.prototype.point=!0;const Qf=_.define(),SX=_.define(),CX={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Te.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},_s=_.define();function kX(t){return[QT(),_s.of({...CX,...t})]}u(kX,"gutter");const ZO=_.define({combine:t=>t.some(e=>e)});function QT(t){let e=[DX];return t&&t.fixed===!1&&e.push(ZO.of(!0)),e}u(QT,"gutters");const DX=it.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(_s).map(e=>new Mf(t,e)),this.fixed=!t.state.facet(ZO);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(ZO)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Te.iter(this.view.state.facet(Qf),this.view.viewport.from),r=[],i=this.gutters.map(l=>new jO(l,this.view.viewport,-this.view.documentPadding.top));for(let l of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(l.type)){let a=!0;for(let o of l.type)if(o.type==kt.Text&&a){XO(n,r,o.from);for(let s of i)s.line(this.view,o,r);a=!1}else if(o.widget)for(let s of i)s.widget(this.view,o)}else if(l.type==kt.Text){XO(n,r,l.from);for(let a of i)a.line(this.view,l,r)}else if(l.widget)for(let a of i)a.widget(this.view,l);for(let l of i)l.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(_s),n=t.state.facet(_s),r=t.docChanged||t.heightChanged||t.viewportChanged||!Te.eq(t.startState.facet(Qf),t.state.facet(Qf),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let l of n){let a=e.indexOf(l);a<0?i.push(new Mf(this.view,l)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let l of this.gutters)l.dom.remove(),i.indexOf(l)<0&&l.destroy();for(let l of i)l.config.side=="after"?this.getDOMAfter().appendChild(l.dom):this.dom.appendChild(l.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>J.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ve.LTR?{left:r,right:i}:{right:r,left:i}})});function MT(t){return Array.isArray(t)?t:[t]}u(MT,"asArray");function XO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}u(XO,"advanceCursor");const h4=class h4{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Te.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,l=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let o=new Bf(e,a,l,r);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,a,l,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];XO(this.cursor,i,n.from),r.length&&(i=i.concat(r));let l=this.gutter.config.lineMarker(e,n,i);l&&i.unshift(l);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let l of e.state.facet(SX)){let a=l(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}};u(h4,"UpdateContext");let jO=h4;const p4=class p4{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let l=i.target,a;if(l!=this.dom&&this.dom.contains(l)){for(;l.parentNode!=this.dom;)l=l.parentNode;let s=l.getBoundingClientRect();a=(s.top+s.bottom)/2}else a=i.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,o,i)&&i.preventDefault()});this.markers=MT(n.markers(e)),n.initialSpacer&&(this.spacer=new Bf(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=MT(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Te.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}};u(p4,"SingleGutterView");let Mf=p4;const m4=class m4{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),PX(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let l=0,a=0;;){let o=a,s=ll(o,s,c)||a(o,s,c):a}return r}})}}),g4=class g4 extends Qn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};u(g4,"NumberMarker");let Hs=g4;function qO(t,e){return t.state.facet(za).formatNumber(e,t.state)}u(qO,"formatNumber");const AX=_s.compute([za],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(EX)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Hs(qO(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(TX)){let l=i(e,n,r);if(l)return l}return null},lineMarkerChange:e=>e.startState.facet(za)!=e.state.facet(za),initialSpacer(e){return new Hs(qO(e,BT(e.state.doc.lines)))},updateSpacer(e,n){let r=qO(n.view,BT(n.view.state.doc.lines));return r==e.number?e:new Hs(r)},domEventHandlers:t.facet(za).domEventHandlers,side:"before"}));function QX(t={}){return[za.of(t),QT(),AX]}u(QX,"lineNumbers");function BT(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(MX.range(i)))}return Te.of(e)});function RX(){return BX}u(RX,"highlightActiveLineGutter");var VX=Object.defineProperty,Js=u((t,e)=>VX(t,"name",{value:e,configurable:!0}),"d$b");const RT=Js((t,e="",n=!1,r=[],i=(o,s)=>s[o]??o,l={},a="")=>new J({doc:e,parent:t,extensions:[hX(a),it.fromClass(class{constructor(o){this.items=FX(r),this.placeholders=this.matchResults(this.items).createDeco(o)}update(o){this.placeholders=this.matchResults(this.items).updateDeco(o,this.placeholders)}matchResults(o){return new Tf({regexp:X2,decoration:(s,c,d)=>re.replace({widget:new IX(s[1],i(s[1],o),()=>c.dispatch({changes:{from:d,to:d+s[1].length+4}}),l)})})}},{decorations:o=>o.placeholders,provide:o=>J.atomicRanges.of(s=>s.plugin(o)?.placeholders||re.none)}),J.updateListener.of(o=>{if(l.inputMask){if(o.focusChanged)o.state.doc.toString().includes("_")?o.view.dispatch({changes:{from:0,to:o.state.doc.length,insert:""}}):o.state.doc.toString().length===0&&o.view.hasFocus&&VT(o,l.inputMask);else if(o.docChanged&&o.view.hasFocus&&VT(o,l.inputMask))return}o.docChanged&&n&&n(o.state.doc.toString())}),J.theme({".cm-scroller":{fontFamily:"inherit",alignItems:"center !important"},"&.cm-editor.cm-focused":{outline:"none"}}),Xe.readOnly.of(l.readOnly??!1),J.contentAttributes.of({contenteditable:!(l.readOnly??!1)})]}),"createInput");var WO=!1;const VT=Js((t,e)=>{if(t.state.doc.toString().length===0){let n="";for(const r of e)n+=r==="a"||r==="9"||r==="*"?"_":r;t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n}})}else{if(t.startState.doc.toString()===""||WO)return WO=!1,!1;const n=t.startState.doc.toString().split("");let r;return t.changes.iterChanges((i,l,a,o)=>{const s=t.state.doc.sliceString(a,o).split("");let c=Math.min(Math.max(l,o),n.length),d=Math.min(i,a);r=s.length>0?c:d;let f=0,h=!1;for(;d!==c;){let p=e[d],m=s[f];switch(p){case"a":m&&m.match(/[a-zA-Z]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"9":m&&m.match(/[0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"*":m&&m.match(/[a-zA-Z0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;default:n[d]=p;break}d+=1}}),WO=!0,t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n.join("")},selection:{anchor:r,head:r}}),!0}},"handleMasking"),NX=Js((t,e)=>{if(t.length!==e.length)return!1;for(let n=0;nArray.isArray(t)?t.reduce((e,n)=>({...e,...n.choices??{}}),{}):t,"getItemsObject"),NT=(hc=class extends Hn{constructor(e,n,r,i){super(e),this.value=e,this.label=n,this.onRemove=r,this.config=i}toDOM(){const e=document.createElement("span");if(e.setAttribute("class","tf-dynamic-text-item"),e.setAttribute("data-id",this.value),e.textContent=this.label,this.config?.readOnly===!0)return e;const n=document.createElement("span");return n.setAttribute("class","tf-dynamic-text-item-delete"),n.addEventListener("click",this.onRemove),e.appendChild(n),e}},u(hc,"k"),hc);Js(NT,"DynamicString");let IX=NT;var LX=Object.defineProperty,FT=u((t,e)=>LX(t,"name",{value:e,configurable:!0}),"x$7");const zX=wp.element.forwardRef(({inputProps:t,...e},n)=>{const r=wp.element.useRef();let i=e.value??"";if((e.prefix||e.suffix)&&(e.prefix&&!i.startsWith(e.prefix)&&(i=e.prefix+i),e.suffix&&!i.endsWith(e.suffix)&&(i=i+e.suffix)),e.inputMask){const c=e.prefix?e.prefix.length:0,d=e.suffix?i.length-e.suffix.length:i.length;i=NX(i.slice(c,d),e.inputMask)?i:""}const[l,a]=wp.element.useState(i);wp.element.useEffect(()=>{let c=l;e.prefix&&(c=c.slice(e.prefix.length)),e.suffix&&(c=c.slice(0,c.length-e.suffix.length)),r.current=r.current??RT(n.current,c,d=>{a(`${e.prefix??""}${d}${e.suffix??""}`)},e.choices,o,{readOnly:e.readOnly??!1,inputMask:e.inputMask&&e.inputMask!==""?e.inputMask:null},e.placeholder??"")},[n.current]),wp.element.useEffect(()=>{if(e.suffix){const c=document.createElement("span");c.textContent=e.suffix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--suffix"),n.current.appendChild(c)}if(e.prefix){const c=document.createElement("span");c.textContent=e.prefix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--prefix"),n.current.insertBefore(c,n.current.children[0])}},[]);const o=FT(c=>{const d=e.dynamic.parse(c);return d&&d.type?e.dynamic.getLabel(d.type):c},"getDynamicValueLabel");wp.element.useEffect(()=>e.onChange&&e.onChange(l),[l]);const s=FT(c=>{r.current.dispatch({changes:{from:r.current.state.doc.length,insert:`${c}`}})},"insertDynamicValue");return!e.inputMask&&e.dynamic&&e.dynamic.getMode()==="replace"?wp.element.createElement(Cs,{...e,config:e.dynamic??"",value:l,onValueSelection:a,onValueRemove:()=>{r.current=null,a("")},inputProps:t,readOnly:e.readOnly??!1,buttonType:"inside"},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`})):wp.element.createElement(bE,{config:e.dynamic??"",onValueSelection:s,buttonType:"inside",readOnly:e.readOnly??!1,inputMasking:e.inputMask},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`}))});var ZX=Object.defineProperty,XX=u((t,e)=>ZX(t,"name",{value:e,configurable:!0}),"l$a");const Rf=XX(t=>{const{locale:e}=Re(),[n,r]=wp.element.useState(t.value??""),i=pN({...t,locale:e}),l=wp.element.useRef(),{labelProps:a,descriptionProps:o,groupProps:s,inputProps:c,incrementButtonProps:d,decrementButtonProps:f}=kN(t,i,l);wp.element.useEffect(()=>t.onChange&&t.onChange(n),[n]);const h=t.hasButtons??!0,p=t.readOnly??!1;return wp.element.createElement("div",{className:"tf-number","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:a,parent:t},t.label),wp.element.createElement("div",{className:"tf-number-field",...s},wp.element.createElement(Cs,{...t,value:n,onValueSelection:r,ref:l,inputProps:c},wp.element.createElement("input",{...c,value:Number.isInteger(i.numberValue)?i.numberValue:0,ref:l,name:t.name??"",disabled:p}),h&&wp.element.createElement("div",{className:"tf-number-button-group"},wp.element.createElement(se,{type:"number",...d,isDisabled:p},"+"),wp.element.createElement(se,{type:"number",...f,isDisabled:p},"-")))),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"NumberComponent");var jX=Object.defineProperty,qX=u((t,e)=>jX(t,"name",{value:e,configurable:!0}),"r$6");const eu=qX(t=>{const e=HI(t),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),{labelProps:l,descriptionProps:a,triggerProps:o,valueProps:s,menuProps:c}=GF(t,e,n);return wp.element.createElement("div",{className:"tf-select",ref:i},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(HF,{state:e,triggerRef:n,label:t.label,name:t.name}),wp.element.createElement(se,{type:"select",...o,ref:n,onKeyDown:d=>d.code==="Space"?e.toggle():o.onKeyDown(d)},wp.element.createElement("span",{...s,className:"tf-select__value"},e.selectedItem?e.selectedItem.rendered:t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:n,placement:"bottom start",style:{width:i?.current?.offsetWidth}},wp.element.createElement(Nd,{...c,listBoxRef:r,state:e,items:t.items})),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Select");var WX=Object.defineProperty,tu=u((t,e)=>WX(t,"name",{value:e,configurable:!0}),"n$g");const IT=tu(t=>{const e=t.units??["px"],n=t.linked==="toggle"||t.linked===void 0,{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]),wp.element.useEffect(()=>{a.isLinked&&c(a.top)},[a.isLinked]);const s=tu((p,m)=>{o({...a,[m]:p})},"setAttribute"),c=tu(p=>{o({...a,top:p,left:p,right:p,bottom:p})},"setLinkedPosition"),d=tu(p=>{o({...a,isLinked:p})},"setIsLinked"),f=tu(()=>n?a.isLinked??!1:t.linked,"isLinked");let h="tf-dimensions-number-groups";return f()&&(h+=" tf-dimensions-number-groups-linked"),wp.element.createElement("div",{className:"tf-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-dimensions-container"},wp.element.createElement("div",{className:h},["top","left","right","bottom"].map(p=>wp.element.createElement(Rf,{key:p,value:a[p]??0,name:p,description:!1,label:`Value for ${p} position`,labelVisuallyHidden:!0,onChange:m=>f()?c(m):s(m,p)}))),wp.element.createElement(eu,{label:"Dimensions unit",labelVisuallyHidden:!0,description:!1,selectedKey:a.unit??"px",onSelectionChange:p=>s(p,"unit"),placeholder:"unit"},e.map(p=>wp.element.createElement(Qr,{key:p},p))),n&&wp.element.createElement(se,{type:"action",onPress:()=>d(!a.isLinked)},wp.element.createElement("span",{className:"dashicons dashicons-admin-links"}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Dimensions");var YX=Object.defineProperty,LT=u((t,e)=>YX(t,"name",{value:e,configurable:!0}),"a$9");const KX=LT(t=>{const e=t.units??["px"],n=t.format??"hex",{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{dimensions:{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1},color:"rgba(0,0,0,1)"}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]);const s=LT(c=>{o(typeof c=="string"?d=>({...d,color:c}):d=>({...d,dimensions:{...d.dimensions,...c}}))},"handleData");return wp.element.createElement("div",{className:"tf-border"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-border-container"},wp.element.createElement("div",{className:"tf-border-dimensions-container"},wp.element.createElement(IT,{label:"Border dimensions",labelVisuallyHidden:!0,onChange:s,linked:t.linked,units:e,value:a.dimensions})),wp.element.createElement("div",{className:"tf-border-color-picker-container"},wp.element.createElement(XQ,{label:"Border Color",labelVisuallyHidden:!0,onChange:s,value:a.color,format:n,hasAlpha:t.hasAlpha??!0}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Border");var UX=Object.defineProperty,GX=u((t,e)=>UX(t,"name",{value:e,configurable:!0}),"n$f");const _X=GX(t=>{const e=wp.element.useContext(t.context),n=wp.element.useRef(null),{inputProps:r}=I2(t,e,n);let i="tf-button-group-option";return e.selectedValue===t.value&&(i+=" tf-button-group-option-selected"),wp.element.createElement("label",{className:i},wp.element.createElement(gn,null,wp.element.createElement("input",{...r,ref:n})),t.children)},"ButtonOption");var HX=Object.defineProperty,JX=u((t,e)=>HX(t,"name",{value:e,configurable:!0}),"n$e");const zT=wp.element.createContext(null),ej=JX(t=>{const e=YP(t),n=rl(t.choices??{}),{radioGroupProps:r,labelProps:i,descriptionProps:l}=L2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-button-group"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-button-group-container",...r},wp.element.createElement(zT.Provider,{value:e},n.map(a=>wp.element.createElement(_X,{key:a.value,context:zT,...a},t.use_dashicon?wp.element.createElement("span",{className:`dashicons dashicons-${a.label}`}):a.label)))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"ButtonGroup");var tj=Object.defineProperty,nj=u((t,e)=>tj(t,"name",{value:e,configurable:!0}),"i$d");const nu=nj(t=>{const e=Cx(t),n=wp.element.useRef(),{inputProps:r}=UV({...t,children:t.label??!1},e,n),{labelProps:i,descriptionProps:l}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value==="1"&&e.setSelected(!0),typeof t.value=="boolean"&&t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]);const a=t?.labelVisuallyHidden?gn:wp.element.Fragment;return wp.element.createElement("div",{className:"tf-checkbox"},wp.element.createElement(xe,{labelProps:i,parent:{...t,labelVisuallyHidden:!1}},wp.element.createElement("input",{...r,ref:n,id:t.name??""}),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:e.isSelected?"1":"0"}),wp.element.createElement(a,null,t.label??"")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Checkbox"),ZT=1024;let rj=0;const O4=class O4{constructor(e,n){this.from=e,this.to=n}};u(O4,"Range");let It=O4;const b4=class b4{constructor(e={}){this.id=rj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=en.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}};u(b4,"NodeProp");let ue=b4;ue.closedBy=new ue({deserialize:t=>t.split(" ")}),ue.openedBy=new ue({deserialize:t=>t.split(" ")}),ue.group=new ue({deserialize:t=>t.split(" ")}),ue.isolate=new ue({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),ue.contextHash=new ue({perNode:!0}),ue.lookAhead=new ue({perNode:!0}),ue.mounted=new ue({perNode:!0});const y4=class y4{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[ue.mounted.id]}};u(y4,"MountedTree");let bl=y4;const ij=Object.create(null);let en=(Po=class{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):ij,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Po(e.name||"",n,e.id,r);if(e.props){for(let l of e.props)if(Array.isArray(l)||(l=l(i)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[l[0].id]=l[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(ue.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(ue.group),l=-1;l<(i?i.length:0);l++){let a=n[l<0?r.name:i[l]];if(a)return a}}}},u(Po,"NodeType"),Po);en.none=new en("",Object.create(null),0,8);const Ip=class Ip{constructor(e){this.types=e;for(let n=0;n0;for(let s=this.cursor(a|Ae.IncludeAnonymous);;){let c=!1;if(s.from<=l&&s.to>=i&&(!o&&s.type.isAnonymous||n(s)!==!1)){if(s.firstChild())continue;c=!0}for(;c&&r&&(o||!s.type.isAnonymous)&&r(s),!s.nextSibling();){if(!s.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:JO(en.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new pc(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new pc(en.none,n,r,i)))}static build(e){return aj(e)}};u(pc,"Tree");let Le=pc;Le.empty=new Le(en.none,[],[],0);const Lp=class Lp{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Lp(this.buffer,this.index)}};u(Lp,"FlatBufferCursor");let KO=Lp;const zp=class zp{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return en.none}toString(){let e=[];for(let n=0;n0));s=a[s+3]);return o}slice(e,n,r){let i=this.buffer,l=new Uint16Array(n-e),a=0;for(let o=e,s=0;o=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}u(jT,"checkSide");function ru(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?o.length:-1;e!=c;e+=n){let d=o[e],f=s[e]+a.from;if(jT(i,r,f,f+d.length)){if(d instanceof Si){if(l&Ae.ExcludeBuffers)continue;let h=d.findChild(0,d.buffer.length,n,r-f,i);if(h>-1)return new yl(new GO(a,d,e,f),null,h)}else if(l&Ae.IncludeAnonymous||!d.type.isAnonymous||HO(d)){let h;if(!(l&Ae.IgnoreMounts)&&(h=bl.get(d))&&!h.overlay)return new Eo(h.tree,f,e,a);let p=new Eo(d,f,e,a);return l&Ae.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?d.children.length-1:0,n,r,i)}}}if(l&Ae.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Ae.IgnoreOverlays)&&(i=bl.get(this._tree))&&i.overlay){let l=e-this.from;for(let{from:a,to:o}of i.overlay)if((n>0?a<=l:a=l:o>l))return new Eo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};u(Eo,"TreeNode");let Lt=Eo;function qT(t,e,n,r){let i=t.cursor(),l=[];if(!i.firstChild())return l;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return l}for(;;){if(r!=null&&i.type.is(r))return l;if(i.type.is(e)&&l.push(i.node),!i.nextSibling())return r==null?l:[]}}u(qT,"getChildren");function UO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}u(UO,"matchNodeContext");const $4=class $4{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}};u($4,"BufferContext");let GO=$4;const ql=class ql extends Nf{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return l<0?null:new ql(this.context,this,l)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Ae.ExcludeBuffers)return null;let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return l<0?null:new ql(this.context,this,l)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ql(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ql(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,l=r.buffer[this.index+3];if(l>i){let a=r.buffer[this.index+1];e.push(r.slice(i,l,a)),n.push(0)}return new Le(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};u(ql,"BufferNode");let yl=ql;function WT(t){if(!t.length)return null;let e=0,n=t[0];for(let l=1;ln.from||a.to=e){let o=new Lt(a.tree,a.overlay[0].from+l.from,-1,l);(i||(i=[r])).push(ru(o,e,n,!1))}}return i?WT(i):r}u(lj,"stackIterator");const x4=class x4{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Lt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Lt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return l<0?!1:(this.stack.push(this.index),this.yieldBuf(l))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Ae.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ae.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ae.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let l=n+e,a=e<0?-1:r._tree.children.length;l!=a;l+=e){let o=r._tree.children[l];if(this.mode&Ae.IncludeAnonymous||o instanceof Si||!o.type.isAnonymous||HO(o))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=l+1;break e}i=this.stack[--l]}for(let i=r;i=0;l--){if(l<0)return UO(this._tree,e,i);let a=r[n.buffer[this.stack[l]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}};u(x4,"TreeCursor");let Za=x4;function HO(t){return t.children.some(e=>e instanceof Si||!e.type.isAnonymous||HO(e))}u(HO,"hasChild");function aj(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=ZT,reused:l=[],minRepeatType:a=r.types.length}=t,o=Array.isArray(n)?new KO(n,n.length):n,s=r.types,c=0,d=0;function f(S,x,C,Q,T,B){let{id:w,start:M,end:A,size:E}=o,I=d,D=c;for(;E<0;)if(o.next(),E==-1){let F=l[w];C.push(F),Q.push(M-S);return}else if(E==-3){c=w;return}else if(E==-4){d=w;return}else throw new RangeError(`Unrecognized record size: ${E}`);let P=s[w],R,L,k=M-S;if(A-M<=i&&(L=O(o.pos-x,T))){let F=new Uint16Array(L.size-L.skip),N=o.pos-L.size,z=F.length;for(;o.pos>N;)z=b(L.start,F,z);R=new Si(F,A-L.start,r),k=L.start-S}else{let F=o.pos-E;o.next();let N=[],z=[],G=w>=a?w:-1,le=0,ie=A;for(;o.pos>F;)G>=0&&o.id==G&&o.size>=0?(o.end<=ie-i&&(m(N,z,M,le,o.end,ie,G,I,D),le=N.length,ie=o.end),o.next()):B>2500?h(M,F,N,z):f(M,F,N,z,G,B+1);if(G>=0&&le>0&&le-1&&le>0){let me=p(P,D);R=JO(P,N,z,0,N.length,0,A-M,me,me)}else R=g(P,N,z,A-M,I-A,D)}C.push(R),Q.push(k)}u(f,"takeNode");function h(S,x,C,Q){let T=[],B=0,w=-1;for(;o.pos>x;){let{id:M,start:A,end:E,size:I}=o;if(I>4)o.next();else{if(w>-1&&A=0;E-=3)M[I++]=T[E],M[I++]=T[E+1]-A,M[I++]=T[E+2]-A,M[I++]=I;C.push(new Si(M,T[2]-A,r)),Q.push(A-S)}}u(h,"takeFlatNode");function p(S,x){return(C,Q,T)=>{let B=0,w=C.length-1,M,A;if(w>=0&&(M=C[w])instanceof Le){if(!w&&M.type==S&&M.length==T)return M;(A=M.prop(ue.lookAhead))&&(B=Q[w]+M.length+A)}return g(S,C,Q,T,B,x)}}u(p,"makeBalanced");function m(S,x,C,Q,T,B,w,M,A){let E=[],I=[];for(;S.length>Q;)E.push(S.pop()),I.push(x.pop()+C-T);S.push(g(r.types[w],E,I,B-T,M-B,A)),x.push(T-C)}u(m,"makeRepeatLeaf");function g(S,x,C,Q,T,B,w){if(B){let M=[ue.contextHash,B];w=w?[M].concat(w):[M]}if(T>25){let M=[ue.lookAhead,T];w=w?[M].concat(w):[M]}return new Le(S,x,C,Q,w)}u(g,"makeTree");function O(S,x){let C=o.fork(),Q=0,T=0,B=0,w=C.end-i,M={size:0,start:0,skip:0};e:for(let A=C.pos-S;C.pos>A;){let E=C.size;if(C.id==x&&E>=0){M.size=Q,M.start=T,M.skip=B,B+=4,Q+=4,C.next();continue}let I=C.pos-E;if(E<0||I=a?4:0,P=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3)D+=4;else break e;else C.id>=a&&(D+=4);C.next()}T=P,Q+=E,B+=D}return(x<0||Q==S)&&(M.size=Q,M.start=T,M.skip=B),M.size>4?M:void 0}u(O,"findBufferSize");function b(S,x,C){let{id:Q,start:T,end:B,size:w}=o;if(o.next(),w>=0&&Q4){let A=o.pos-(w-4);for(;o.pos>A;)C=b(S,x,C)}x[--C]=M,x[--C]=B-S,x[--C]=T-S,x[--C]=Q}else w==-3?c=Q:w==-4&&(d=Q);return C}u(b,"copyToBuffer");let y=[],$=[];for(;o.pos>0;)f(t.start||0,t.bufferStart||0,y,$,-1,0);let v=(e=t.length)!==null&&e!==void 0?e:y.length?$[0]+y[0].length:0;return new Le(s[t.topID],y.reverse(),$.reverse(),v)}u(aj,"buildTree$1");const YT=new WeakMap;function Ff(t,e){if(!t.isAnonymous||e instanceof Si||e.type!=t)return 1;let n=YT.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Le)){n=1;break}n+=Ff(t,r)}YT.set(e,n)}return n}u(Ff,"nodeSize$1");function JO(t,e,n,r,i,l,a,o,s){let c=0;for(let m=r;m=d)break;x+=C}if($==v+1){if(x>d){let C=m[v];p(C.children,C.positions,0,C.children.length,g[v]+y);continue}f.push(m[v])}else{let C=g[$-1]+m[$-1].length-S;f.push(JO(t,m,g,v,$,S,C,null,s))}h.push(S+y-l)}}return u(p,"divide"),p(e,n,r,i,0),(o||s)(f,h,a)}u(JO,"balanceRange");const S4=class S4{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof yl?this.setBuffer(e.context.buffer,e.index,n):e instanceof Lt&&this.map.set(e.tree,n)}get(e){return e instanceof yl?this.getBuffer(e.context.buffer,e.index):e instanceof Lt?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}};u(S4,"NodeWeakMap");let If=S4;const mc=class mc{constructor(e,n,r,i,l=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(l?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new mc(0,e.length,e,0,!1,r)];for(let l of n)l.to>e.length&&i.push(l);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],l=1,a=e.length?e[0]:null;for(let o=0,s=0,c=0;;o++){let d=o=r)for(;a&&a.from=h.from||f<=h.to||c){let p=Math.max(h.from,s)-c,m=Math.min(h.to,f)-c;h=p>=m?null:new mc(p,m,h.tree,h.offset+c,o>0,!!d)}if(h&&i.push(h),a.to>f)break;a=lnew It(i.from,i.to)):[new It(0,0)]:[new It(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let l=i.advance();if(l)return l}}};u(C4,"Parser");let Lf=C4;const k4=class k4{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}};u(k4,"StringInput");let eb=k4;function oj(t){return(e,n,r,i)=>new rb(e,t,n,r,i)}u(oj,"parseMixed");const D4=class D4{constructor(e,n,r,i,l){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.from=l}};u(D4,"InnerParse");let zf=D4;function KT(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}u(KT,"checkRanges");const P4=class P4{constructor(e,n,r,i,l,a,o){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=l,this.target=a,this.prev=o,this.depth=0,this.ranges=[]}};u(P4,"ActiveOverlay");let tb=P4;const nb=new ue({perNode:!0}),E4=class E4{constructor(e,n,r,i,l){this.nest=n,this.input=r,this.fragments=i,this.ranges=l,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Le(r.type,r.children,r.positions,r.length,r.propValues.concat([[nb,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[ue.mounted.id]=new bl(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(d=>d.frag.from<=i.from&&d.frag.to>=i.to&&d.mount.overlay);if(c)for(let d of c.mount.overlay){let f=d.from+c.pos,h=d.to+c.pos;f>=i.from&&h<=i.to&&!n.ranges.some(p=>p.fromf)&&n.ranges.push({from:f,to:h})}}o=!1}else if(r&&(a=sj(r.ranges,i.from,i.to)))o=a!=2;else if(!i.type.isAnonymous&&(l=this.nest(i,this.input))&&(i.fromnew It(f.from-i.from,f.to-i.from)):null,i.tree,d.length?d[0].from:i.from)),l.overlay?d.length&&(r={ranges:d,depth:0,prev:r}):o=!1}}else if(n&&(s=n.predicate(i))&&(s===!0&&(s=new It(i.from,i.to)),s.from=0&&n.ranges[c].to==s.from?n.ranges[c]={from:n.ranges[c].from,to:s.to}:n.ranges.push(s)}if(o&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=GT(this.ranges,n.ranges);c.length&&(KT(c),this.inner.splice(n.index,0,new zf(n.parser,n.parser.startParse(this.input,_T(n.mounts,c),c),n.ranges.map(d=>new It(d.from-n.start,d.to-n.start)),n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}};u(E4,"MixedParse");let rb=E4;function sj(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}u(sj,"checkCover");function UT(t,e,n,r,i,l){if(e=e&&n.enter(r,1,Ae.IgnoreOverlays|Ae.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Le)n=n.children[0];else break}return!1}};u(T4,"StructureCursor");let Zf=T4,cj=(gc=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(nb))!==null&&n!==void 0?n:r.to,this.inner=new Zf(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(nb))!==null&&e!==void 0?e:n.to,this.inner=new Zf(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let l=this.inner.cursor.node;l;l=l.parent){let a=(r=l.tree)===null||r===void 0?void 0:r.prop(ue.mounted);if(a&&a.parser==n)for(let o=this.fragI;o=l.to)break;s.tree==this.curFrag.tree&&i.push({frag:s,pos:l.from-s.offset,mount:a})}}}return i}},u(gc,"FragmentCursor"),gc);function GT(t,e){let n=null,r=e;for(let i=1,l=0;i=o)break;s.to<=a||(n||(r=n=e.slice()),s.fromo&&n.splice(l+1,0,new It(o,s.to))):s.to>o?n[l--]=new It(o,s.to):n.splice(l--,1))}}return r}u(GT,"punchRanges");function dj(t,e,n,r){let i=0,l=0,a=!1,o=!1,s=-1e9,c=[];for(;;){let d=i==t.length?1e9:a?t[i].to:t[i].from,f=l==e.length?1e9:o?e[l].to:e[l].from;if(a!=o){let h=Math.max(s,n),p=Math.min(d,f,r);hnew It(h.from+r,h.to+r)),f=dj(e,d,s,c);for(let h=0,p=s;;h++){let m=h==f.length,g=m?c:f[h].from;if(g>p&&n.push(new Ci(p,g,i.tree,-a,l.from>=p||l.openStart,l.to<=g||l.openEnd)),m)break;p=f[h].to}}else n.push(new Ci(s,c,i.tree,-a,l.from>=a||l.openStart,l.to<=o||l.openEnd))}return n}u(_T,"enterFragments");let fj=0;const Oc=class Oc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=fj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Oc&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new Oc(r,[],null,[]);if(i.set.push(i),n)for(let l of n.set)i.set.push(l);return i}static defineModifier(e){let n=new Xf(e);return r=>r.modified.indexOf(n)>-1?r:Xf.get(r.base||r,r.modified.concat(n).sort((i,l)=>i.id-l.id))}};u(Oc,"Tag");let Mn=Oc,hj=0;const Zp=class Zp{constructor(e){this.name=e,this.instances=[],this.id=hj++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(o=>o.base==e&&pj(n,o.modified));if(r)return r;let i=[],l=new Mn(e.name,i,e,n);for(let o of n)o.instances.push(l);let a=mj(n);for(let o of e.set)if(!o.modified.length)for(let s of a)i.push(Zp.get(o,s));return l}};u(Zp,"Modifier");let Xf=Zp;function pj(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}u(pj,"sameArray");function mj(t){let e=[[]];for(let n=0;nr.length-n.length)}u(mj,"powerSet");function jf(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let l=[],a=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!h)throw new RangeError("Invalid path: "+i);if(l.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let p=i[f++];if(f==i.length&&p=="!"){a=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let s=l.length-1,c=l[s];if(!c)throw new RangeError("Invalid path: "+i);let d=new Xa(r,a,s>0?l.slice(0,s):null);e[c]=d.sort(e[c])}}return HT.add(e)}u(jf,"styleTags");const HT=new ue,A4=class A4{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=i;for(let o of l)for(let s of o.set){let c=n[s.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}u(JT,"tagHighlighter");function gj(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}u(gj,"highlightTags");function Oj(t,e,n,r=0,i=t.length){let l=new ib(r,Array.isArray(e)?e:[e],n);l.highlightRange(t.cursor(),r,i,"",l.highlighters),l.flush(i)}u(Oj,"highlightTree");const Q4=class Q4{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,l){let{type:a,from:o,to:s}=e;if(o>=r||s<=n)return;a.isTop&&(l=this.highlighters.filter(p=>!p.scope||p.scope(a)));let c=i,d=bj(e)||Xa.empty,f=gj(l,d.tags);if(f&&(c&&(c+=" "),c+=f,d.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,o),c),d.opaque)return;let h=e.tree&&e.tree.prop(ue.mounted);if(h&&h.overlay){let p=e.node.enter(h.overlay[0].from+o,1),m=this.highlighters.filter(O=>!O.scope||O.scope(h.tree.type)),g=e.firstChild();for(let O=0,b=o;;O++){let y=O=$||!e.nextSibling())););if(!y||$>r)break;b=y.to+o,b>n&&(this.highlightRange(p.cursor(),Math.max(n,y.from+o),Math.min(r,b),"",m),this.startSpan(Math.min(r,b),c))}g&&e.parent()}else if(e.firstChild()){h&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,l),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}};u(Q4,"HighlightBuilder");let ib=Q4;function bj(t){let e=t.type.prop(HT);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}u(bj,"getStyleTags");const Y=Mn.define,qf=Y(),ki=Y(),e7=Y(ki),t7=Y(ki),Di=Y(),Wf=Y(Di),lb=Y(Di),rr=Y(),vl=Y(rr),ir=Y(),lr=Y(),ab=Y(),iu=Y(ab),Yf=Y(),V={comment:qf,lineComment:Y(qf),blockComment:Y(qf),docComment:Y(qf),name:ki,variableName:Y(ki),typeName:e7,tagName:Y(e7),propertyName:t7,attributeName:Y(t7),className:Y(ki),labelName:Y(ki),namespace:Y(ki),macroName:Y(ki),literal:Di,string:Wf,docString:Y(Wf),character:Y(Wf),attributeValue:Y(Wf),number:lb,integer:Y(lb),float:Y(lb),bool:Y(Di),regexp:Y(Di),escape:Y(Di),color:Y(Di),url:Y(Di),keyword:ir,self:Y(ir),null:Y(ir),atom:Y(ir),unit:Y(ir),modifier:Y(ir),operatorKeyword:Y(ir),controlKeyword:Y(ir),definitionKeyword:Y(ir),moduleKeyword:Y(ir),operator:lr,derefOperator:Y(lr),arithmeticOperator:Y(lr),logicOperator:Y(lr),bitwiseOperator:Y(lr),compareOperator:Y(lr),updateOperator:Y(lr),definitionOperator:Y(lr),typeOperator:Y(lr),controlOperator:Y(lr),punctuation:ab,separator:Y(ab),bracket:iu,angleBracket:Y(iu),squareBracket:Y(iu),paren:Y(iu),brace:Y(iu),content:rr,heading:vl,heading1:Y(vl),heading2:Y(vl),heading3:Y(vl),heading4:Y(vl),heading5:Y(vl),heading6:Y(vl),contentSeparator:Y(rr),list:Y(rr),quote:Y(rr),emphasis:Y(rr),strong:Y(rr),link:Y(rr),monospace:Y(rr),strikethrough:Y(rr),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Yf,documentMeta:Y(Yf),annotation:Y(Yf),processingInstruction:Y(Yf),definition:Mn.defineModifier("definition"),constant:Mn.defineModifier("constant"),function:Mn.defineModifier("function"),standard:Mn.defineModifier("standard"),local:Mn.defineModifier("local"),special:Mn.defineModifier("special")};for(let t in V){let e=V[t];e instanceof Mn&&(e.name=t)}JT([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var ob;const ja=new ue;function n7(t){return _.define({combine:t?e=>e.concat(t):void 0})}u(n7,"defineLanguageFacet");const sb=new ue,M4=class M4{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Xe.prototype.hasOwnProperty("tree")||Object.defineProperty(Xe.prototype,"tree",{get(){return ze(this)}}),this.parser=n,this.extension=[Pi.of(this),Xe.languageData.of((l,a,o)=>{let s=r7(l,a,o),c=s.type.prop(ja);if(!c)return[];let d=l.facet(c),f=s.type.prop(sb);if(f){let h=s.resolve(a-s.from,o);for(let p of f)if(p.test(h,l)){let m=l.facet(p.facet);return p.type=="replace"?m:m.concat(d)}}return d})].concat(r)}isActiveAt(e,n,r=-1){return r7(e,n,r).type.prop(ja)==this.data}findRegions(e){let n=e.facet(Pi);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=u((l,a)=>{if(l.prop(ja)==this.data){r.push({from:a,to:a+l.length});return}let o=l.prop(ue.mounted);if(o){if(o.tree.prop(ja)==this.data){if(o.overlay)for(let s of o.overlay)r.push({from:s.from+a,to:s.to+a});else r.push({from:a,to:a+l.length});return}else if(o.overlay){let s=r.length;if(i(o.tree,o.overlay[0].from+a),r.length>s)return}}for(let s=0;sr.isTop?n:void 0)]}),e.name)}configure(e,n){return new bc(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};u(bc,"LRLanguage");let lu=bc;function ze(t){let e=t.field(tn.state,!1);return e?e.tree:Le.empty}u(ze,"syntaxTree");const B4=class B4{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}};u(B4,"DocInput");let ub=B4,au=null,yj=(Wl=class{constructor(e,n,r=[],i,l,a,o,s){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=l,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Wl(e,n,[],Le.empty,0,r,[],null)}startParse(){return this.parser.startParse(new ub(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Le.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=u(()=>Date.now()>i,"until")}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ci.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=au;au=this;try{return e()}finally{au=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=i7(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:l,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let s=[];if(e.iterChangedRanges((c,d,f,h)=>s.push({fromA:c,toA:d,fromB:f,toB:h})),r=Ci.applyChanges(r,s),i=Le.empty,l=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);de.from&&(this.fragments=i7(this.fragments,i,l),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Lf{createParse(n,r,i){let l=i[0].from,a=i[i.length-1].to;return{parsedPos:l,advance(){let s=au;if(s){for(let c of i)s.tempSkipped.push(c);e&&(s.scheduleOn=s.scheduleOn?Promise.all([s.scheduleOn,e]):e)}return this.parsedPos=a,new Le(en.none,[],[],a-l)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return au}},u(Wl,"ParseContext"),Wl);function i7(t,e,n){return Ci.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}u(i7,"cutFragments");const yc=class yc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new yc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=yj.create(e.facet(Pi).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new yc(r)}};u(yc,"LanguageState");let ou=yc;tn.state=Gt.define({create:ou.init,update(t,e){for(let n of e.effects)if(n.is(tn.setState))return n.value;return e.startState.facet(Pi)!=e.state.facet(Pi)?ou.init(e.state):t.apply(e)}});let l7=u(t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)},"requestIdle");typeof requestIdleCallback<"u"&&(l7=u(t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)},"requestIdle"));const cb=typeof navigator<"u"&&(!((ob=navigator.scheduling)===null||ob===void 0)&&ob.isInputPending)?()=>navigator.scheduling.isInputPending():null,vj=it.fromClass((vc=class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(tn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(tn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=l7(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,s=l.context.work(()=>cb&&cb()||Date.now()>a,i+(o?0:1e5));this.chunkBudget-=Date.now()-n,(s||this.chunkBudget<=0)&&(l.context.takeTree(),this.view.dispatch({effects:tn.setState.of(new ou(l.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(l.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ht(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},u(vc,"ParseWorker"),vc),{eventHandlers:{focus(){this.scheduleWork()}}}),Pi=_.define({combine(t){return t.length?t[0]:null},enables:t=>[tn.state,vj,J.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),R4=class R4{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};u(R4,"LanguageSupport");let su=R4;const $j=_.define(),uu=_.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Kf(t){let e=t.facet(uu);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}u(Kf,"getIndentUnit");function cu(t,e){let n="",r=t.tabSize,i=t.facet(uu)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let l=0;l=e?wj(t,n,e):null}u(db,"getIndentation");const V4=class V4{constructor(e,n={}){this.state=e,this.options=n,this.unit=Kf(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:l}=this.options;return i!=null&&i>=r.from&&i<=r.to?l&&i==e?{text:"",from:e}:(n<0?i-1&&(l+=a-this.countColumn(r,r.search(/\S|$/))),l}countColumn(e,n=e.length){return Ra(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),l=this.options.overrideIndentation;if(l){let a=l(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}};u(V4,"IndentContext");let qa=V4;const Uf=new ue;function wj(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let l=[];for(let a=i;a&&!(a.fromr.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)l.push(a);for(let a=l.length-1;a>=0;a--)r={node:l[a],next:r}}return a7(r,t,n)}u(wj,"syntaxIndentation");function a7(t,e,n){for(let r=t;r;r=r.next){let i=Sj(r.node);if(i)return i(fb.create(e,n,r))}return 0}u(a7,"indentFor");function xj(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}u(xj,"ignoreClosed");function Sj(t){let e=t.type.prop(Uf);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(ue.closedBy))){let i=t.lastChild,l=i&&r.indexOf(i.name)>-1;return a=>o7(a,!0,1,void 0,l&&!xj(a)?i.from:void 0)}return t.parent==null?Cj:null}u(Sj,"indentStrategy");function Cj(){return 0}u(Cj,"topIndent");const Xp=class Xp extends qa{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Xp(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(kj(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return a7(this.context.next,this.base,this.pos)}};u(Xp,"TreeIndentContext");let fb=Xp;function kj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}u(kj,"isParent");function Dj(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,l=t.state.doc.lineAt(n.from),a=i==null||i<=l.from?l.to:Math.min(l.to,i);for(let o=n.to;;){let s=e.childAfter(o);if(!s||s==r)return null;if(!s.type.isSkipped){if(s.from>=a)return null;let c=/^ */.exec(l.text.slice(n.to-l.from))[0].length;return{from:n.from,to:n.to+c}}o=s.to}}u(Dj,"bracketedAligned");function Pj({closing:t,align:e=!0,units:n=1}){return r=>o7(r,e,n,t)}u(Pj,"delimitedIndent");function o7(t,e,n,r,i){let l=t.textAfter,a=l.match(/^\s*/)[0].length,o=r&&l.slice(a,a+r.length)==r||i==t.pos+a,s=e?Dj(t):null;return s?o?t.column(s.from):t.column(s.to):t.baseIndent+(o?0:t.unit*n)}u(o7,"delimitedStrategy");const Ej=u(t=>t.baseIndent,"flatIndent");function Gf({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}u(Gf,"continuedIndent");const Tj=200;function Aj(){return Xe.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+Tj)return t;let l=n.sliceString(i.from,r);if(!e.some(c=>c.test(l)))return t;let{state:a}=t,o=-1,s=[];for(let{head:c}of a.selection.ranges){let d=a.doc.lineAt(c);if(d.from==o)continue;o=d.from;let f=db(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],p=cu(a,f);h!=p&&s.push({from:d.from,to:d.from+h.length,insert:p})}return s.length?[t,{changes:s,sequential:!0}]:t})}u(Aj,"indentOnInput");const Qj=_.define(),_f=new ue;function s7(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(l&&o.from=e&&c.to>n&&(l=c)}}return l}u(Mj,"syntaxFolding");function Bj(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}u(Bj,"isUnfinished");function Hf(t,e,n){for(let r of t.facet(Qj)){let i=r(t,e,n);if(i)return i}return Mj(t,e,n)}u(Hf,"foldable");function u7(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}u(u7,"mapRange");const Jf=Oe.define({map:u7}),du=Oe.define({map:u7});function c7(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}u(c7,"selectedLines");const $l=Gt.define({create(){return re.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=d7(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Jf)&&!Rj(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(hb),i=r?re.replace({widget:new pb(r(e.state,n.value))}):g7;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(du)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=d7(t,e.selection.main.head)),t},provide:t=>J.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{ie&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,l)=>i>=n||l<=e}):t}u(d7,"clearTouchedFolds");function eh(t,e,n){var r;let i=null;return(r=t.field($l,!1))===null||r===void 0||r.between(e,n,(l,a)=>{(!i||i.from>l)&&(i={from:l,to:a})}),i}u(eh,"findFold");function Rj(t,e,n){let r=!1;return t.between(e,e,(i,l)=>{i==e&&l==n&&(r=!0)}),r}u(Rj,"foldExists");function f7(t,e){return t.field($l,!1)?e:e.concat(Oe.appendConfig.of(p7()))}u(f7,"maybeEnable");const Vj=u(t=>{for(let e of c7(t)){let n=Hf(t.state,e.from,e.to);if(n)return t.dispatch({effects:f7(t.state,[Jf.of(n),h7(t,n)])}),!0}return!1},"foldCode"),Nj=u(t=>{if(!t.state.field($l,!1))return!1;let e=[];for(let n of c7(t)){let r=eh(t.state,n.from,n.to);r&&e.push(du.of(r),h7(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0},"unfoldCode");function h7(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return J.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}u(h7,"announceFold");const Fj=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Vj},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Nj},{key:"Ctrl-Alt-[",run:u(t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field($l,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(du.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},"unfoldAll")}],Ij={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},hb=_.define({combine(t){return bi(t,Ij)}});function p7(t){let e=[$l,Zj];return t&&e.push(hb.of(t)),e}u(p7,"codeFolding");function m7(t,e){let{state:n}=t,r=n.facet(hb),i=u(a=>{let o=t.lineBlockAt(t.posAtDOM(a.target)),s=eh(t.state,o.from,o.to);s&&t.dispatch({effects:du.of(s)}),a.preventDefault()},"onclick");if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let l=document.createElement("span");return l.textContent=r.placeholderText,l.setAttribute("aria-label",n.phrase("folded code")),l.title=n.phrase("unfold"),l.className="cm-foldPlaceholder",l.onclick=i,l}u(m7,"widgetToDOM");const g7=re.replace({widget:new class extends Hn{toDOM(t){return m7(t,null)}}}),N4=class N4 extends Hn{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return m7(e,this.value)}};u(N4,"PreparedFoldWidget");let pb=N4;const Lj={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},F4=class F4 extends Qn{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}};u(F4,"FoldMarker");let fu=F4;function zj(t={}){let e={...Lj,...t},n=new fu(e,!0),r=new fu(e,!1),i=it.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(Pi)!=a.state.facet(Pi)||a.startState.field($l,!1)!=a.state.field($l,!1)||ze(a.startState)!=ze(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let o=new dl;for(let s of a.viewportLineBlocks){let c=eh(a.state,s.from,s.to)?r:Hf(a.state,s.from,s.to)?n:null;c&&o.add(s.from,s.from,c)}return o.finish()}}),{domEventHandlers:l}=e;return[i,kX({class:"cm-foldGutter",markers(a){var o;return((o=a.plugin(i))===null||o===void 0?void 0:o.markers)||Te.empty},initialSpacer(){return new fu(e,!1)},domEventHandlers:{...l,click:(a,o,s)=>{if(l.click&&l.click(a,o,s))return!0;let c=eh(a.state,o.from,o.to);if(c)return a.dispatch({effects:du.of(c)}),!0;let d=Hf(a.state,o.from,o.to);return d?(a.dispatch({effects:Jf.of(d)}),!0):!1}}}),p7()]}u(zj,"foldGutter");const Zj=J.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),jp=class jp{constructor(e,n){this.specs=e;let r;function i(o){let s=Un.newName();return(r||(r=Object.create(null)))["."+s]=o,s}u(i,"def");const l=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof tn?o=>o.prop(ja)==a.data:a?o=>o==a:void 0,this.style=JT(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:l}).style,this.module=r?new Un(r):null,this.themeType=n.themeType}static define(e,n){return new jp(e,n||{})}};u(jp,"HighlightStyle");let th=jp;const mb=_.define(),O7=_.define({combine(t){return t.length?[t[0]]:null}});function gb(t){let e=t.facet(mb);return e.length?e:t.facet(O7)}u(gb,"getHighlighters");function Xj(t,e){let n=[jj],r;return t instanceof th&&(t.module&&n.push(J.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(O7.of(t)):r?n.push(mb.computeN([J.darkTheme],i=>i.facet(J.darkTheme)==(r=="dark")?[t]:[])):n.push(mb.of(t)),n}u(Xj,"syntaxHighlighting");const I4=class I4{constructor(e){this.markCache=Object.create(null),this.tree=ze(e.state),this.decorations=this.buildDeco(e,gb(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ze(e.state),r=gb(e.state),i=r!=gb(e.startState),{viewport:l}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=l.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=l.to)}buildDeco(e,n){if(!n||!this.tree.length)return re.none;let r=new dl;for(let{from:i,to:l}of e.visibleRanges)Oj(this.tree,n,(a,o,s)=>{r.add(a,o,this.markCache[s]||(this.markCache[s]=re.mark({class:s})))},i,l);return r.finish()}};u(I4,"TreeHighlighter");let Ob=I4;const jj=cl.high(it.fromClass(Ob,{decorations:t=>t.decorations})),qj=th.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),Wj=J.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),b7=1e4,y7="()[]{}",v7=_.define({combine(t){return bi(t,{afterCursor:!0,brackets:y7,maxScanDistance:b7,renderMatch:Uj})}}),Yj=re.mark({class:"cm-matchingBracket"}),Kj=re.mark({class:"cm-nonmatchingBracket"});function Uj(t){let e=[],n=t.matched?Yj:Kj;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}u(Uj,"defaultRenderMatch");const Gj=[Gt.define({create(){return re.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(v7);for(let i of e.state.selection.ranges){if(!i.empty)continue;let l=ar(e.state,i.head,-1,r)||i.head>0&&ar(e.state,i.head-1,1,r)||r.afterCursor&&(ar(e.state,i.head,1,r)||i.headJ.decorations.from(t)}),Wj];function _j(t={}){return[v7.of(t),Gj]}u(_j,"bracketMatching");const $7=new ue;function bb(t,e,n){let r=t.prop(e<0?ue.openedBy:ue.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}u(bb,"matchingNodes");function yb(t){let e=t.type.prop($7);return e?e(t.node):t}u(yb,"findHandle");function ar(t,e,n,r={}){let i=r.maxScanDistance||b7,l=r.brackets||y7,a=ze(t),o=a.resolveInner(e,n);for(let s=o;s;s=s.parent){let c=bb(s.type,n,l);if(c&&s.from0?e>=d.from&&ed.from&&e<=d.to))return Hj(t,e,n,s,d,c,l)}}return Jj(t,e,n,a,o.type,i,l)}u(ar,"matchBrackets");function Hj(t,e,n,r,i,l,a){let o=r.parent,s={from:i.from,to:i.to},c=0,d=o?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(c==0&&l.indexOf(d.type.name)>-1&&d.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=l;){let p=d.value;n<0&&(h+=p.length);let m=e+h*n;for(let g=n>0?0:p.length-1,O=n>0?p.length:-1;g!=O;g+=n){let b=a.indexOf(p[g]);if(!(b<0||r.resolveInner(m+g,1).type!=i))if(b%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:m+g,to:m+g+1},matched:b>>1==s>>1};f--}}n>0&&(h+=p.length)}return d.done?{start:c,matched:!1}:null}u(Jj,"matchPlainBrackets");const eq=Object.create(null),w7=[en.none],x7=[],S7=Object.create(null),tq=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])tq[t]=nq(eq,e);function vb(t,e){x7.indexOf(t)>-1||(x7.push(t),console.warn(e))}u(vb,"warnForPart");function nq(t,e){let n=[];for(let o of e.split(" ")){let s=[];for(let c of o.split(".")){let d=t[c]||V[c];d?typeof d=="function"?s.length?s=s.map(d):vb(c,`Modifier ${c} used at start of tag`):s.length?vb(c,`Tag ${c} used as modifier`):s=Array.isArray(d)?d:[d]:vb(c,`Unknown highlighting tag ${c}`)}for(let c of s)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(o=>o.id),l=S7[i];if(l)return l.id;let a=S7[i]=en.define({id:w7.length,name:r,props:[jf({[r]:n})]});return w7.push(a),a.id}u(nq,"createTokenType"),Ve.RTL,Ve.LTR;const rq=u(t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=wb(t.state,n.from);return r.line?iq(t):r.block?aq(t):!1},"toggleComment");function $b(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}u($b,"command");const iq=$b(uq,0),lq=$b(C7,0),aq=$b((t,e)=>C7(t,e,sq(e)),0);function wb(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}u(wb,"getConfig");const hu=50;function oq(t,{open:e,close:n},r,i){let l=t.sliceDoc(r-hu,r),a=t.sliceDoc(i,i+hu),o=/\s*$/.exec(l)[0].length,s=/^\s*/.exec(a)[0].length,c=l.length-o;if(l.slice(c-e.length,c)==e&&a.slice(s,s+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:i+s,margin:s&&1}};let d,f;i-r<=2*hu?d=f=t.sliceDoc(r,i):(d=t.sliceDoc(r,r+hu),f=t.sliceDoc(i-hu,i));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-n.length;return d.slice(h,h+e.length)==e&&f.slice(m,m+n.length)==n?{open:{pos:r+h+e.length,margin:/\s/.test(d.charAt(h+e.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}u(oq,"findBlockComment");function sq(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let l=e.length-1;l>=0&&e[l].to>r.from?e[l].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}u(sq,"selectedLineRanges");function C7(t,e,n=e.selection.ranges){let r=n.map(l=>wb(e,l.from).block);if(!r.every(l=>l))return null;let i=n.map((l,a)=>oq(e,r[a],l.from,l.to));if(t!=2&&!i.every(l=>l))return{changes:e.changes(n.map((l,a)=>i[a]?[]:[{from:l.from,insert:r[a].open+" "},{from:l.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(l=>l)){let l=[];for(let a=0,o;ai&&(l==a||a>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+c.length)==c?h:-1;hl.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:o,token:s,indent:c,empty:d,single:f}of r)(f||!d)&&l.push({from:o.from+c,insert:s+" "});let a=e.changes(l);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(l=>l.comment>=0)){let l=[];for(let{line:a,comment:o,token:s}of r)if(o>=0){let c=a.from+o,d=c+s.length;a.text[d-a.from]==" "&&d++,l.push({from:c,to:d})}return{changes:l}}return null}u(uq,"changeLineComment");const xb=Tn.define(),cq=Tn.define(),dq=_.define(),k7=_.define({combine(t){return bi(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),D7=Gt.define({create(){return pu.empty},update(t,e){let n=e.state.facet(k7),r=e.annotation(xb);if(r){let s=Bn.fromTransaction(e,r.selection),c=r.side,d=c==0?t.undone:t.done;return s?d=rh(d,d.length,n.minDepth,s):d=T7(d,e.startState.selection),new pu(c==0?r.rest:d,c==0?d:r.rest)}let i=e.annotation(cq);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(xt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let l=Bn.fromTransaction(e),a=e.annotation(xt.time),o=e.annotation(xt.userEvent);return l?t=t.addChanges(l,a,o,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,o,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new pu(t.done.map(Bn.fromJSON),t.undone.map(Bn.fromJSON))}});function fq(t={}){return[D7,k7.of(t),J.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?P7:e.inputType=="historyRedo"?Sb:null;return r?(e.preventDefault(),r(n)):!1}})]}u(fq,"history$1");function nh(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(D7,!1);if(!i)return!1;let l=i.pop(t,n,e);return l?(r(l),!0):!1}}u(nh,"cmd");const P7=nh(0,!1),Sb=nh(1,!1),hq=nh(0,!0),pq=nh(1,!0),Yl=class Yl{constructor(e,n,r,i,l){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=l}setSelAfter(e){return new Yl(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Yl(e.changes&&Ut.fromJSON(e.changes),[],e.mapped&&gi.fromJSON(e.mapped),e.startSelection&&X.fromJSON(e.startSelection),e.selectionsAfter.map(X.fromJSON))}static fromTransaction(e,n){let r=vn;for(let i of e.startState.facet(dq)){let l=i(e);l.length&&(r=r.concat(l))}return!r.length&&e.changes.empty?null:new Yl(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,vn)}static selection(e){return new Yl(void 0,vn,void 0,void 0,e)}};u(Yl,"HistEvent");let Bn=Yl;function rh(t,e,n,r){let i=e+1>n+20?e-n-1:0,l=t.slice(i,e);return l.push(r),l}u(rh,"updateBranch");function mq(t,e){let n=[],r=!1;return t.iterChangedRanges((i,l)=>n.push(i,l)),e.iterChangedRanges((i,l,a,o)=>{for(let s=0;s=c&&a<=d&&(r=!0)}}),r}u(mq,"isAdjacent");function gq(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}u(gq,"eqSelectionShape");function E7(t,e){return t.length?e.length?t.concat(e):t:e}u(E7,"conc");const vn=[],Oq=200;function T7(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Oq));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),rh(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Bn.selection([e])]}u(T7,"addSelection");function bq(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}u(bq,"popSelection");function Cb(t,e){if(!t.length)return t;let n=t.length,r=vn;for(;n;){let i=yq(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let l=t.slice(0,n);return l[n-1]=i,l}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Bn.selection(r)]:vn}u(Cb,"addMappingToBranch");function yq(t,e,n){let r=E7(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):vn,n);if(!t.changes)return Bn.selection(r);let i=t.changes.map(e),l=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(l):l;return new Bn(i,Oe.mapEffects(t.effects,e),a,t.startSelection.map(l),r)}u(yq,"mapEvent");const vq=/^(input\.type|delete)($|\.)/;let pu=(ei=class{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new ei(this.done,this.undone):this}addChanges(e,n,r,i,l){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||vq.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):ih(n,e))}u(A7,"cursorByChar");function ht(t){return t.textDirectionAt(t.state.selection.main.head)==Ve.LTR}u(ht,"ltrAtCursor");const Q7=u(t=>A7(t,!ht(t)),"cursorCharLeft"),M7=u(t=>A7(t,ht(t)),"cursorCharRight");function B7(t,e){return Vn(t,n=>n.empty?t.moveByGroup(n,e):ih(n,e))}u(B7,"cursorByGroup");const wq=u(t=>B7(t,!ht(t)),"cursorGroupLeft"),xq=u(t=>B7(t,ht(t)),"cursorGroupRight");function Sq(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}u(Sq,"interestingNode");function lh(t,e,n){let r=ze(t).resolveInner(e.head),i=n?ue.closedBy:ue.openedBy;for(let s=e.head;;){let c=n?r.childAfter(s):r.childBefore(s);if(!c)break;Sq(t,c,i)?r=c:s=n?c.to:c.from}let l=r.type.prop(i),a,o;return l&&(a=n?ar(t,r.from,1):ar(t,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,X.cursor(o,n?-1:1)}u(lh,"moveBySyntax");const Cq=u(t=>Vn(t,e=>lh(t.state,e,!ht(t))),"cursorSyntaxLeft"),kq=u(t=>Vn(t,e=>lh(t.state,e,ht(t))),"cursorSyntaxRight");function R7(t,e){return Vn(t,n=>{if(!n.empty)return ih(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}u(R7,"cursorByLine");const V7=u(t=>R7(t,!1),"cursorLineUp"),N7=u(t=>R7(t,!0),"cursorLineDown");function F7(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):ih(a,e));if(i.eq(r.selection))return!1;let l;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;a&&a.top>s&&a.bottomI7(t,!1),"cursorPageUp"),kb=u(t=>I7(t,!0),"cursorPageDown");function Ei(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let l=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;l&&e.head!=r.from+l&&(i=X.cursor(r.from+l))}return i}u(Ei,"moveByLineBoundary");const Dq=u(t=>Vn(t,e=>Ei(t,e,!0)),"cursorLineBoundaryForward"),Pq=u(t=>Vn(t,e=>Ei(t,e,!1)),"cursorLineBoundaryBackward"),Eq=u(t=>Vn(t,e=>Ei(t,e,!ht(t))),"cursorLineBoundaryLeft"),Tq=u(t=>Vn(t,e=>Ei(t,e,ht(t))),"cursorLineBoundaryRight"),Aq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).from,1)),"cursorLineStart"),Qq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).to,-1)),"cursorLineEnd");function Mq(t,e,n){let r=!1,i=Wa(t.selection,l=>{let a=ar(t,l.head,-1)||ar(t,l.head,1)||l.head>0&&ar(t,l.head-1,1)||l.headMq(t,e,!1),"cursorMatchingBracket");function $n(t,e){let n=Wa(t.state.selection,r=>{let i=e(r);return X.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Rn(t.state,n)),!0)}u($n,"extendSel");function z7(t,e){return $n(t,n=>t.moveByChar(n,e))}u(z7,"selectByChar");const Z7=u(t=>z7(t,!ht(t)),"selectCharLeft"),X7=u(t=>z7(t,ht(t)),"selectCharRight");function j7(t,e){return $n(t,n=>t.moveByGroup(n,e))}u(j7,"selectByGroup");const Rq=u(t=>j7(t,!ht(t)),"selectGroupLeft"),Vq=u(t=>j7(t,ht(t)),"selectGroupRight"),Nq=u(t=>$n(t,e=>lh(t.state,e,!ht(t))),"selectSyntaxLeft"),Fq=u(t=>$n(t,e=>lh(t.state,e,ht(t))),"selectSyntaxRight");function q7(t,e){return $n(t,n=>t.moveVertically(n,e))}u(q7,"selectByLine");const W7=u(t=>q7(t,!1),"selectLineUp"),Y7=u(t=>q7(t,!0),"selectLineDown");function K7(t,e){return $n(t,n=>t.moveVertically(n,e,F7(t).height))}u(K7,"selectByPage");const U7=u(t=>K7(t,!1),"selectPageUp"),G7=u(t=>K7(t,!0),"selectPageDown"),Iq=u(t=>$n(t,e=>Ei(t,e,!0)),"selectLineBoundaryForward"),Lq=u(t=>$n(t,e=>Ei(t,e,!1)),"selectLineBoundaryBackward"),zq=u(t=>$n(t,e=>Ei(t,e,!ht(t))),"selectLineBoundaryLeft"),Zq=u(t=>$n(t,e=>Ei(t,e,ht(t))),"selectLineBoundaryRight"),Xq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).from)),"selectLineStart"),jq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).to)),"selectLineEnd"),_7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:0})),!0),"cursorDocStart"),H7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.doc.length})),!0),"cursorDocEnd"),J7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:0})),!0),"selectDocStart"),eA=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),"selectDocEnd"),qq=u(({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),"selectAll$1"),Wq=u(({state:t,dispatch:e})=>{let n=oh(t).map(({from:r,to:i})=>X.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:X.create(n),userEvent:"select"})),!0},"selectLine"),Yq=u(({state:t,dispatch:e})=>{let n=Wa(t.selection,r=>{let i=ze(t),l=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=l.node.from&&a.node.to<=l.node.to&&(l=a)}for(let a=l;a;a=a.next){let{node:o}=a;if((o.from=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return X.range(o.to,o.from)}return r});return n.eq(t.selection)?!1:(e(Rn(t,n)),!0)},"selectParentSyntax");function tA(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let l of n.selection.ranges){let a=n.doc.lineAt(l.head);if(e?a.to0)for(let o=l;;){let s=t.moveVertically(o,e);if(s.heada.to){i.some(c=>c.head==s.head)||i.push(s);break}else{if(s.head==o.head)break;o=s}}}return i.length==r.ranges.length?!1:(t.dispatch(Rn(n,X.create(i,i.length-1))),!0)}u(tA,"addCursorVertically");const Kq=u(t=>tA(t,!1),"addCursorAbove"),Uq=u(t=>tA(t,!0),"addCursorBelow"),Gq=u(({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=X.create([n.main]):n.main.empty||(r=X.create([X.cursor(n.main.head)])),r?(e(Rn(t,r)),!0):!1},"simplifySelection");function mu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(l=>{let{from:a,to:o}=l;if(a==o){let s=e(l);sa&&(n="delete.forward",s=ah(t,s,!0)),a=Math.min(a,s),o=Math.max(o,s)}else a=ah(t,a,!1),o=ah(t,o,!0);return a==o?{range:l}:{changes:{from:a,to:o},range:X.cursor(a,ai(t)))r.between(e,e,(i,l)=>{ie&&(e=n?l:i)});return e}u(ah,"skipAtomic");const nA=u((t,e,n)=>mu(t,r=>{let i=r.from,{state:l}=t,a=l.doc.lineAt(i),o,s;if(n&&!e&&i>a.from&&inA(t,!1,!0),"deleteCharBackward"),rA=u(t=>nA(t,!0,!1),"deleteCharForward"),iA=u((t,e)=>mu(t,n=>{let r=n.head,{state:i}=t,l=i.doc.lineAt(r),a=i.charCategorizer(r);for(let o=null;;){if(r==(e?l.to:l.from)){r==n.head&&l.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let s=wt(l.text,r-l.from,e)+l.from,c=l.text.slice(Math.min(r,s)-l.from,Math.max(r,s)-l.from),d=a(c);if(o!=null&&d!=o)break;(c!=" "||r!=n.head)&&(o=d),r=s}return r}),"deleteByGroup"),lA=u(t=>iA(t,!1),"deleteGroupBackward"),_q=u(t=>iA(t,!0),"deleteGroupForward"),Hq=u(t=>mu(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headmu(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),"deleteLineBoundaryBackward"),eW=u(t=>mu(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:pe.of(["",""])},range:X.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},"splitLine"),nW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,l=t.doc.lineAt(i),a=i==l.from?i-1:wt(l.text,i-l.from,!1)+l.from,o=i==l.to?i+1:wt(l.text,i-l.from,!0)+l.from;return{changes:{from:a,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(a,i))},range:X.cursor(o)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)},"transposeChars");function oh(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),l=t.doc.lineAt(r.to);if(!r.empty&&r.to==l.from&&(l=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=l.to,a.ranges.push(r)}else e.push({from:i.from,to:l.to,ranges:[r]});n=l.number+1}return e}u(oh,"selectedLineBlocks");function aA(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let l of oh(t)){if(n?l.to==t.doc.length:l.from==0)continue;let a=t.doc.lineAt(n?l.to+1:l.from-1),o=a.length+1;if(n){r.push({from:l.to,to:a.to},{from:l.from,insert:a.text+t.lineBreak});for(let s of l.ranges)i.push(X.range(Math.min(t.doc.length,s.anchor+o),Math.min(t.doc.length,s.head+o)))}else{r.push({from:a.from,to:l.from},{from:l.to,insert:t.lineBreak+a.text});for(let s of l.ranges)i.push(X.range(s.anchor-o,s.head-o))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:X.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}u(aA,"moveLine");const rW=u(({state:t,dispatch:e})=>aA(t,e,!1),"moveLineUp"),iW=u(({state:t,dispatch:e})=>aA(t,e,!0),"moveLineDown");function oA(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of oh(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}u(oA,"copyLine");const lW=u(({state:t,dispatch:e})=>oA(t,e,!1),"copyLineUp"),aW=u(({state:t,dispatch:e})=>oA(t,e,!0),"copyLineDown"),oW=u(t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(oh(e).map(({from:i,to:l})=>(i>0?i--:l{let l;if(t.lineWrapping){let a=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(l=a.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,l)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},"deleteLine");function sW(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ze(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),l;return r&&i&&r.to<=e&&i.from>=e&&(l=r.type.prop(ue.closedBy))&&l.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}u(sW,"isBetweenBrackets");const sA=uA(!1),uW=uA(!0);function uA(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:l,to:a}=i,o=e.doc.lineAt(l),s=!t&&l==a&&sW(e,l);t&&(l=a=(a<=o.to?o:e.doc.lineAt(a)).to);let c=new qa(e,{simulateBreak:l,simulateDoubleBreak:!!s}),d=db(c,l);for(d==null&&(d=Ra(/^\s*/.exec(e.doc.lineAt(l).text)[0],e.tabSize));ao.from&&l{let i=[];for(let a=r.from;a<=r.to;){let o=t.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(e(o,i,r),n=o.number),a=o.to+1}let l=t.changes(i);return{changes:i,range:X.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}u(Pb,"changeBySelectedLine");const cW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new qa(t,{overrideIndentation:l=>{let a=n[l];return a??-1}}),i=Pb(t,(l,a,o)=>{let s=db(r,l.from);if(s==null)return;/\S/.test(l.text)||(s=0);let c=/^\s*/.exec(l.text)[0],d=cu(t,s);(c!=d||o.fromt.readOnly?!1:(e(t.update(Pb(t,(n,r)=>{r.push({from:n.from,insert:t.facet(uu)})}),{userEvent:"input.indent"})),!0),"indentMore"),dA=u(({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Pb(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let l=Ra(i,t.tabSize),a=0,o=cu(t,Math.max(0,l-Kf(t)));for(;a(t.setTabFocusMode(),!0),"toggleTabFocusMode"),fW=[{key:"Ctrl-b",run:Q7,shift:Z7,preventDefault:!0},{key:"Ctrl-f",run:M7,shift:X7},{key:"Ctrl-p",run:V7,shift:W7},{key:"Ctrl-n",run:N7,shift:Y7},{key:"Ctrl-a",run:Aq,shift:Xq},{key:"Ctrl-e",run:Qq,shift:jq},{key:"Ctrl-d",run:rA},{key:"Ctrl-h",run:Db},{key:"Ctrl-k",run:Hq},{key:"Ctrl-Alt-h",run:lA},{key:"Ctrl-o",run:tW},{key:"Ctrl-t",run:nW},{key:"Ctrl-v",run:kb}],hW=[{key:"ArrowLeft",run:Q7,shift:Z7,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:wq,shift:Rq,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Eq,shift:zq,preventDefault:!0},{key:"ArrowRight",run:M7,shift:X7,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xq,shift:Vq,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Tq,shift:Zq,preventDefault:!0},{key:"ArrowUp",run:V7,shift:W7,preventDefault:!0},{mac:"Cmd-ArrowUp",run:_7,shift:J7},{mac:"Ctrl-ArrowUp",run:L7,shift:U7},{key:"ArrowDown",run:N7,shift:Y7,preventDefault:!0},{mac:"Cmd-ArrowDown",run:H7,shift:eA},{mac:"Ctrl-ArrowDown",run:kb,shift:G7},{key:"PageUp",run:L7,shift:U7},{key:"PageDown",run:kb,shift:G7},{key:"Home",run:Pq,shift:Lq,preventDefault:!0},{key:"Mod-Home",run:_7,shift:J7},{key:"End",run:Dq,shift:Iq,preventDefault:!0},{key:"Mod-End",run:H7,shift:eA},{key:"Enter",run:sA,shift:sA},{key:"Mod-a",run:qq},{key:"Backspace",run:Db,shift:Db,preventDefault:!0},{key:"Delete",run:rA,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lA,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:_q,preventDefault:!0},{mac:"Mod-Backspace",run:Jq,preventDefault:!0},{mac:"Mod-Delete",run:eW,preventDefault:!0}].concat(fW.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),pW=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Cq,shift:Nq},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:kq,shift:Fq},{key:"Alt-ArrowUp",run:rW},{key:"Shift-Alt-ArrowUp",run:lW},{key:"Alt-ArrowDown",run:iW},{key:"Shift-Alt-ArrowDown",run:aW},{key:"Mod-Alt-ArrowUp",run:Kq},{key:"Mod-Alt-ArrowDown",run:Uq},{key:"Escape",run:Gq},{key:"Mod-Enter",run:uW},{key:"Alt-l",mac:"Ctrl-l",run:Wq},{key:"Mod-i",run:Yq,preventDefault:!0},{key:"Mod-[",run:dA},{key:"Mod-]",run:cA},{key:"Mod-Alt-\\",run:cW},{key:"Shift-Mod-k",run:oW},{key:"Shift-Mod-\\",run:Bq},{key:"Mod-/",run:rq},{key:"Alt-A",run:lq},{key:"Ctrl-m",mac:"Shift-Alt-m",run:dW}].concat(hW),mW={key:"Tab",run:cA,shift:dA},L4=class L4{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ze(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),l=i.search(pA(e,!1));return l<0?null:{from:r+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}};u(L4,"CompletionContext");let sh=L4;function fA(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}u(fA,"toSet");function gW(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:gW(e);return i=>{let l=i.matchBefore(r);return l||i.explicit?{from:l?l.from:i.pos,options:e,validFor:n}:null}}u(hA,"completeFromList");function OW(t,e){return n=>{for(let r=ze(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}u(OW,"ifNotIn");const z4=class z4{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}};u(z4,"Option");let uh=z4;function wl(t){return t.selection.main.from}u(wl,"cur");function pA(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",l=r[r.length-1]!="$";return!i&&!l?t:new RegExp(`${i?"^":""}(?:${r})${l?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}u(pA,"ensureAnchor");const Eb=Tn.define();function bW(t,e,n,r){let{main:i}=t.selection,l=n-i.from,a=r-i.from;return{...t.changeByRange(o=>{if(o!=i&&n!=r&&t.sliceDoc(o.from+l,o.from+a)!=t.sliceDoc(n,r))return{range:o};let s=t.toText(e);return{changes:{from:o.from+l,to:r==i.from?o.to:o.from+a,insert:s},range:X.cursor(o.from+l+s.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}u(bW,"insertCompletionText");const mA=new WeakMap;function yW(t){if(!Array.isArray(t))return t;let e=mA.get(t);return e||mA.set(t,e=hA(t)),e}u(yW,"asSource");const ch=Oe.define(),gu=Oe.define(),Z4=class Z4{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(x=S0(S))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!y||C==1&&O||v==0&&C!=0)&&(n[f]==S||r[f]==S&&(h=!0)?a[f++]=y:a.length&&(b=!1)),v=C,y+=Kn(S)}return f==s&&a[0]==0&&b?this.result(-100+(h?-200:0),a,e):p==s&&m==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):p==s?this.ret(-900-e.length,[m,g]):f==s?this.result(-100+(h?-200:0)+-700+(b?0:-1100),a,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],l=0;for(let a of n){let o=a+(this.astral?Kn(Ft(r,a)):1);l&&i[l-1]==a?i[l-1]=o:(i[l++]=a,i[l++]=o)}return this.ret(e-r.length,i)}};u(Z4,"FuzzyMatcher");let Tb=Z4;const X4=class X4{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:vW,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>gA(e(r),n(r)),optionClass:(e,n)=>r=>gA(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function gA(t,e){return t?e?t+" "+e:t:e}u(gA,"joinClass");function vW(t,e,n,r,i,l){let a=t.textDirection==Ve.RTL,o=a,s=!1,c="top",d,f,h=e.left-i.left,p=i.right-e.right,m=r.right-r.left,g=r.bottom-r.top;if(o&&h=g||y>e.top?d=n.bottom-e.top:(c="bottom",d=e.bottom-n.top)}let O=(e.bottom-e.top)/l.offsetHeight,b=(e.right-e.left)/l.offsetWidth;return{style:`${c}: ${d/O}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(s?a?"left-narrow":"right-narrow":o?"left":"right")}}u(vW,"defaultPositionInfo");function $W(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,l){let a=document.createElement("span");a.className="cm-completionLabel";let o=n.displayLabel||n.label,s=0;for(let c=0;cs&&a.appendChild(document.createTextNode(o.slice(s,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(o.slice(d,f))),h.className="cm-completionMatchedText",s=f}return sn.position-r.position).map(n=>n.render)}u($W,"optionContent");function Qb(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}u(Qb,"rangeAroundSelected");const j4=class j4{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:s=>this.placeInfo(s),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:l,selected:a}=i.open,o=e.state.facet(He);this.optionContent=$W(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Qb(l.length,a,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",s=>{let{options:c}=e.state.field(n).open;for(let d=s.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(He).closeOnBlur&&s.relatedTarget!=e.contentDOM&&e.dispatch({effects:gu.of(null)})}),this.showOptions(l,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:l,selected:a,disabled:o}=r.open;(!i.open||i.open.options!=l)&&(this.range=Qb(l.length,a,e.state.facet(He).maxRenderedOptions),this.showOptions(l,r.id)),this.updateSel(),o!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=Qb(n.options.length,n.selected,this.view.state.facet(He).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let l=typeof i=="string"?document.createTextNode(i):i(r);if(!l)return;"then"in l?l.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>Ht(this.view.state,a,"completion info")):this.addInfoPane(l,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:l}=e;r.appendChild(i),this.infoDestroy=l||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&xW(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),l=this.space;if(!l){let a=this.dom.ownerDocument.documentElement;l={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return i.top>Math.min(l.bottom,n.bottom)-10||i.bottom{a.target==i&&a.preventDefault()});let l=null;for(let a=r.from;ar.from||r.from==0))if(l=h,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=h}}const d=i.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(o);f&&(d.className=f);for(let h of this.optionContent){let p=h(o,this.view.state,this.view,s);p&&d.appendChild(p)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew Mb(n,t,e)}u(wW,"completionTooltip");function xW(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}u(xW,"scrollIntoView");function OA(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}u(OA,"score");function SW(t,e){let n=[],r=null,i=null,l=u(d=>{n.push(d);let{section:f}=d.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(p=>p.name==h)||r.push(typeof f=="string"?{name:h}:f)}},"addOption"),a=e.facet(He);for(let d of t)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)l(new uh(h,d.source,f?f(h):[],1e9-n.length));else{let h=e.sliceDoc(d.from,d.to),p,m=a.filterStrict?new Ab(h):new Tb(h);for(let g of d.result.options)if(p=m.match(g.label)){let O=g.displayLabel?f?f(g,p.matched):[]:p.matched,b=p.score+(g.boost||0);if(l(new uh(g,d.source,O,b)),typeof g.section=="object"&&g.section.rank==="dynamic"){let{name:y}=g.section;i||(i=Object.create(null)),i[y]=Math.max(b,i[y]||-1e9)}}}}if(r){let d=Object.create(null),f=0,h=u((p,m)=>(p.rank==="dynamic"&&m.rank==="dynamic"?i[m.name]-i[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(p.nameh.score-f.score||c(f.completion,h.completion))){let f=d.completion;!s||s.label!=f.label||s.detail!=f.detail||s.type!=null&&f.type!=null&&s.type!=f.type||s.apply!=f.apply||s.boost!=f.boost?o.push(d):OA(d.completion)>OA(s)&&(o[o.length-1]=d),s=d.completion}return o}u(SW,"sortOptions");const Kl=class Kl{constructor(e,n,r,i,l,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=l,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Kl(this.options,bA(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,l,a){if(i&&!a&&e.some(c=>c.isPending))return i.setDisabled();let o=SW(e,n);if(!o.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let s=n.facet(He).selectOnOpen?0:-1;if(i&&i.selected!=s&&i.selected!=-1){let c=i.options[i.selected].completion;for(let d=0;dd.hasResult()?Math.min(c,d.from):c,1e8),create:TW,above:l.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new Kl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Kl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}};u(Kl,"CompletionDialog");let Bb=Kl;const $c=class $c{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new $c(PW,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(He),l=(r.override||n.languageDataAt("autocomplete",wl(n)).map(yW)).map(s=>(this.active.find(d=>d.source==s)||new Lr(s,this.active.some(d=>d.state!=0)?1:0)).update(e,r));l.length==this.active.length&&l.every((s,c)=>s==this.active[c])&&(l=this.active);let a=this.open,o=e.effects.some(s=>s.is(Vb));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||l.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!CW(l,this.active)||o?a=Bb.build(l,n,this.id,a,r,o):a&&a.disabled&&!l.some(s=>s.isPending)&&(a=null),!a&&l.every(s=>!s.isPending)&&l.some(s=>s.hasResult())&&(l=l.map(s=>s.hasResult()?new Lr(s.source,0):s));for(let s of e.effects)s.is(vA)&&(a=a&&a.setSelected(s.value,this.id));return l==this.active&&a==this.open?this:new $c(l,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?kW:DW}};u($c,"CompletionState");let Rb=$c;function CW(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}u(bA,"makeAttrs");const PW=[];function yA(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Eb);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}u(yA,"getUpdateType");const Ul=class Ul{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=yA(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new Ul(i.source,0)),r&4&&i.state==0&&(i=new Ul(this.source,1)),i=i.updateFor(e,r);for(let l of e.effects)if(l.is(ch))i=new Ul(i.source,1,l.value);else if(l.is(gu))i=new Ul(i.source,0);else if(l.is(Vb))for(let a of l.value)a.source==i.source&&(i=a);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(wl(e.state))}};u(Ul,"ActiveSource");let Lr=Ul;const To=class To extends Lr{constructor(e,n,r,i,l,a){super(e,3,n),this.limit=r,this.result=i,this.from=l,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let l=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),o=wl(e.state);if(o>a||!i||n&2&&(wl(e.startState)==this.from||on.map(e))}}),vA=Oe.define(),zt=Gt.define({create(){return Rb.start()},update(t,e){return t.update(e)},provide:t=>[TT.from(t,e=>e.tooltip),J.contentAttributes.from(t,e=>e.attrs)]});function Nb(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(zt).active.find(i=>i.source==e.source);return r instanceof dh?(typeof n=="string"?t.dispatch({...bW(t.state,n,r.from,r.to),annotations:Eb.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}u(Nb,"applyCompletion");const TW=wW(zt,Nb);function fh(t,e="option"){return n=>{let r=n.state.field(zt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:a-1;return o<0?o=e=="page"?0:a-1:o>=a&&(o=e=="page"?a-1:0),n.dispatch({effects:vA.of(o)}),!0}}u(fh,"moveCompletionSelection");const AW=u(t=>{let e=t.state.field(zt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(zt,!1)?(t.dispatch({effects:ch.of(!0)}),!0):!1,"startCompletion"),QW=u(t=>{let e=t.state.field(zt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:gu.of(null)}),!0)},"closeCompletion"),q4=class q4{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}};u(q4,"RunningQuery");let Ib=q4;const MW=50,BW=1e3,RW=it.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(zt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(zt),n=t.state.facet(He);if(!t.selectionSet&&!t.docChanged&&t.startState.field(zt)==e)return;let r=t.transactions.some(l=>{let a=yA(l,n);return a&8||(l.selection||l.docChanged)&&!(a&3)});for(let l=0;lMW&&Date.now()-a.time>BW){for(let o of a.context.abortListeners)try{o()}catch(s){Ht(this.view.state,s)}a.context.abortListeners=null,this.running.splice(l--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(l=>l.effects.some(a=>a.is(ch)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(l=>l.isPending&&!this.running.some(a=>a.active.source==l.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let l of t.transactions)l.isUserEvent("input.type")?this.composing=2:this.composing==2&&l.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(zt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=wl(e),r=new sh(e,n,t.explicit,this.view),i=new Ib(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(l=>{i.context.aborted||(i.done=l||null,this.scheduleAccept())},l=>{this.view.dispatch({effects:gu.of(null)}),Ht(this.view.state,l)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(He),r=this.view.state.field(zt);for(let i=0;io.source==l.active.source);if(a&&a.isPending)if(l.done==null){let o=new Lr(l.active.source,0);for(let s of l.updates)o=o.update(s,n);o.isPending||e.push(o)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Vb.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(zt,!1);if(e&&e.tooltip&&this.view.state.facet(He).closeOnBlur){let n=e.open&&AT(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:gu.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ch.of(!1)}),20),this.composing=0}}}),VW=typeof navigator=="object"&&/Win/.test(navigator.platform),NW=cl.highest(J.domEventHandlers({keydown(t,e){let n=e.state.field(zt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(VW&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),l=r.completion.commitCharacters||i.result.commitCharacters;return l&&l.indexOf(t.key)>-1&&Nb(e,r),!1}})),$A=J.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),W4=class W4{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}};u(W4,"FieldPos");let Lb=W4;const qp=class qp{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,ct.TrackDel),r=e.mapPos(this.to,1,ct.TrackDel);return n==null||r==null?null:new qp(this.field,n,r)}};u(qp,"FieldRange");let zb=qp;const Wp=class Wp{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],l=e.doc.lineAt(n),a=/^\s*/.exec(l.text)[0];for(let s of this.lines){if(r.length){let c=a,d=/^\t*/.exec(s)[0].length;for(let f=0;fnew zb(s.field,i[s.line]+s.from,i[s.line]+s.to));return{text:r,ranges:o}}static parse(e){let n=[],r=[],i=[],l;for(let a of e.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=l[1]?+l[1]:null,s=l[2]||l[3]||"",c=-1,d=s.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&h.field++}for(let f of i)if(f.line==r.length&&f.from>l.index){let h=l[2]?3+(l[1]||"").length:2;f.from-=h,f.to-=h}i.push(new Lb(c,r.length,l.index,l.index+d.length)),a=a.slice(0,l.index)+s+a.slice(l.index+l[0].length)}a=a.replace(/\\([{}])/g,(o,s,c)=>{for(let d of i)d.line==r.length&&d.from>c&&(d.from--,d.to--);return s}),r.push(a)}return new Wp(r,i)}};u(Wp,"Snippet");let Zb=Wp,FW=re.widget({widget:new class extends Hn{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),IW=re.mark({class:"cm-snippetField"});const Yp=class Yp{constructor(e,n){this.ranges=e,this.active=n,this.deco=re.set(e.map(r=>(r.from==r.to?FW:IW).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Yp(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}};u(Yp,"ActiveSnippet");let Ya=Yp;const Ou=Oe.define({map(t,e){return t&&t.map(e)}}),LW=Oe.define(),bu=Gt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Ou))return n.value;if(n.is(LW)&&t)return new Ya(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>J.decorations.from(t,e=>e?e.deco:re.none)});function Xb(t,e){return X.create(t.filter(n=>n.field==e).map(n=>X.range(n.from,n.to)))}u(Xb,"fieldSelection");function zW(t){let e=Zb.parse(t);return(n,r,i,l)=>{let{text:a,ranges:o}=e.instantiate(n.state,i),{main:s}=n.state.selection,c={changes:{from:i,to:l==s.from?s.to:l,insert:pe.of(a)},scrollIntoView:!0,annotations:r?[Eb.of(r),xt.userEvent.of("input.complete")]:void 0};if(o.length&&(c.selection=Xb(o,0)),o.some(d=>d.field>0)){let d=new Ya(o,0),f=c.effects=[Ou.of(d)];n.state.field(bu,!1)===void 0&&f.push(Oe.appendConfig.of([bu,XW,jW,$A]))}n.dispatch(n.state.update(c))}}u(zW,"snippet");function wA(t){return({state:e,dispatch:n})=>{let r=e.field(bu,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,l=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:Xb(r.ranges,i),effects:Ou.of(l?null:new Ya(r.ranges,i)),scrollIntoView:!0})),!0}}u(wA,"moveField");const ZW=[{key:"Tab",run:wA(1),shift:wA(-1)},{key:"Escape",run:u(({state:t,dispatch:e})=>t.field(bu,!1)?(e(t.update({effects:Ou.of(null)})),!0):!1,"clearSnippet")}],xA=_.define({combine(t){return t.length?t[0]:ZW}}),XW=cl.highest(Pf.compute([xA],t=>t.facet(xA)));function Zt(t,e){return{...e,apply:zW(t)}}u(Zt,"snippetCompletion");const jW=J.domEventHandlers({mousedown(t,e){let n=e.state.field(bu,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(l=>l.from<=r&&l.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:Xb(n.ranges,i.field),effects:Ou.of(n.ranges.some(l=>l.field>i.field)?new Ya(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),yu={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},xl=Oe.define({map(t,e){let n=e.mapPos(t,-1,ct.TrackAfter);return n??void 0}}),jb=new class extends Nr{};jb.startSide=1,jb.endSide=-1;const SA=Gt.define({create(){return Te.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(xl)&&(t=t.update({add:[jb.range(n.value,n.value+1)]}));return t}});function qW(){return[YW,SA]}u(qW,"closeBrackets");const qb="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function CA(t){for(let e=0;e{if((WW?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Kn(Ft(r,0))==1||e!=i.from||n!=i.to)return!1;let l=UW(t.state,r);return l?(t.dispatch(l),!0):!1}),KW=[{key:"Backspace",run:u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=kA(t,t.selection.main.head).brackets||yu.brackets,i=null,l=t.changeByRange(a=>{if(a.empty){let o=GW(t.doc,a.head);for(let s of r)if(s==o&&hh(t.doc,a.head)==CA(Ft(s,0)))return{changes:{from:a.head-s.length,to:a.head+s.length},range:X.cursor(a.head-s.length)}}return{range:i=a}});return i||e(t.update(l,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},"deleteBracketPair")}];function UW(t,e){let n=kA(t,t.selection.main.head),r=n.brackets||yu.brackets;for(let i of r){let l=CA(Ft(i,0));if(e==i)return l==i?JW(t,i,r.indexOf(i+i+i)>-1,n):_W(t,i,l,n.before||yu.before);if(e==l&&DA(t,t.selection.main.from))return HW(t,i,l)}return null}u(UW,"insertBracket");function DA(t,e){let n=!1;return t.field(SA).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}u(DA,"closedBracketAt");function hh(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Kn(Ft(n,0)))}u(hh,"nextChar");function GW(t,e){let n=t.sliceString(e-2,e);return Kn(Ft(n,0))==n.length?n:n.slice(1)}u(GW,"prevChar");function _W(t,e,n,r){let i=null,l=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:xl.of(a.to+e.length),range:X.range(a.anchor+e.length,a.head+e.length)};let o=hh(t.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:e+n,from:a.head},effects:xl.of(a.head+e.length),range:X.cursor(a.head+e.length)}:{range:i=a}});return i?null:t.update(l,{scrollIntoView:!0,userEvent:"input.type"})}u(_W,"handleOpen");function HW(t,e,n){let r=null,i=t.changeByRange(l=>l.empty&&hh(t.doc,l.head)==n?{changes:{from:l.head,to:l.head+n.length,insert:n},range:X.cursor(l.head+n.length)}:r={range:l});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}u(HW,"handleClose");function JW(t,e,n,r){let i=r.stringPrefixes||yu.stringPrefixes,l=null,a=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:xl.of(o.to+e.length),range:X.range(o.anchor+e.length,o.head+e.length)};let s=o.head,c=hh(t.doc,s),d;if(c==e){if(PA(t,s))return{changes:{insert:e+e,from:s},effects:xl.of(s+e.length),range:X.cursor(s+e.length)};if(DA(t,s)){let h=n&&t.sliceDoc(s,s+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+h.length,insert:h},range:X.cursor(s+h.length)}}}else{if(n&&t.sliceDoc(s-2*e.length,s)==e+e&&(d=EA(t,s-2*e.length,i))>-1&&PA(t,d))return{changes:{insert:e+e+e+e,from:s},effects:xl.of(s+e.length),range:X.cursor(s+e.length)};if(t.charCategorizer(s)(c)!=ft.Word&&EA(t,s,i)>-1&&!eY(t,s,e,i))return{changes:{insert:e+e,from:s},effects:xl.of(s+e.length),range:X.cursor(s+e.length)}}return{range:l=o}});return l?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}u(JW,"handleSame");function PA(t,e){let n=ze(t).resolveInner(e+1);return n.parent&&n.from==e}u(PA,"nodeStart");function eY(t,e,n,r){let i=ze(t).resolveInner(e,-1),l=r.reduce((a,o)=>Math.max(a,o.length),0);for(let a=0;a<5;a++){let o=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+l)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+s;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}u(eY,"probablyInString");function EA(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=ft.Word)return e;for(let i of n){let l=e-i.length;if(t.sliceDoc(l,e)==i&&r(t.sliceDoc(l-1,l))!=ft.Word)return l}return-1}u(EA,"canStartStringAt");function tY(t={}){return[NW,zt,He.of(t),RW,nY,$A]}u(tY,"autocompletion");const TA=[{key:"Ctrl-Space",run:Fb},{mac:"Alt-`",run:Fb},{mac:"Alt-i",run:Fb},{key:"Escape",run:QW},{key:"ArrowDown",run:fh(!0)},{key:"ArrowUp",run:fh(!1)},{key:"PageDown",run:fh(!0,"page")},{key:"PageUp",run:fh(!1,"page")},{key:"Enter",run:AW}],nY=cl.highest(Pf.computeN([He],t=>t.facet(He).defaultKeymap?[TA]:[])),AA=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t,Y4=class Y4{constructor(e,n,r=0,i=e.length,l,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=l?o=>l(AA(o)):AA,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ft(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=S0(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Kn(e);let i=this.normalize(n);if(i.length)for(let l=0,a=r;;l++){let o=i.charCodeAt(l),s=this.match(o,a,this.bufferPos+this.bufferStart);if(l==i.length-1){if(s)return this.value=s,this;break}a==r&&le||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function iY(t){let e=[uY,sY];return t&&e.push(QA.of(t)),e}u(iY,"highlightSelectionMatches");const lY=re.mark({class:"cm-selectionMatch"}),aY=re.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function MA(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=ft.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=ft.Word)}u(MA,"insideWordBoundaries");function oY(t,e,n,r){return t(e.sliceDoc(n,n+1))==ft.Word&&t(e.sliceDoc(r-1,r))==ft.Word}u(oY,"insideWord");const sY=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(QA),{state:n}=t,r=n.selection;if(r.ranges.length>1)return re.none;let i=r.main,l,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return re.none;let s=n.wordAt(i.head);if(!s)return re.none;a=n.charCategorizer(i.head),l=n.sliceDoc(s.from,s.to)}else{let s=i.to-i.from;if(s200)return re.none;if(e.wholeWords){if(l=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(MA(a,n,i.from,i.to)&&oY(a,n,i.from,i.to)))return re.none}else if(l=n.sliceDoc(i.from,i.to),!l)return re.none}let o=[];for(let s of t.visibleRanges){let c=new ph(n.doc,l,s.from,s.to);for(;!c.next().done;){let{from:d,to:f}=c.value;if((!a||MA(a,n,d,f))&&(i.empty&&d<=i.from&&f>=i.to?o.push(aY.range(d,f)):(d>=i.to||f<=i.from)&&o.push(lY.range(d,f)),o.length>e.maxMatches))return re.none}}return re.set(o)}},{decorations:t=>t.decorations}),uY=J.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),wc=class wc{constructor(e,n,r,i,l,a,o,s,c,d=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=l,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new wc(e,[],n,r,r,0,[],0,i?new mh(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:l}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,l=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(n==r)return;if(a.buffer[o-2]>=n){a.buffer[o-2]=r;return}}}if(!l||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0){let o=!1;for(let s=a;s>0&&this.buffer[s-2]>r;s-=4)if(this.buffer[s-1]>=0){o=!0;break}if(o)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let l=e,{parser:a}=this.p;(i>this.pos||n<=a.maxNode)&&(this.pos=i,a.stateFlag(l,1)||(this.reducePos=i)),this.pushState(l,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new wc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Yb(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let l=0,a;ls&1&&o==a)||i.push(n[l],a)}n=i}let r=[];for(let i=0;i>19,i=n&65535,l=this.stack.length-r*3;if(l<0||e.getGoto(this.stack[l],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=u((i,l)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let o=(a>>19)-l;if(o>1){let s=a&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],s,!1)>=0)return o<<19|65536|s}}else{let o=r(a,l+1);if(o!=null)return o}})},"explore");return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};u(wc,"Stack");let Wb=wc;const K4=class K4{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}};u(K4,"StackContext");let mh=K4;const U4=class U4{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}};u(U4,"SimulatedStack");let Yb=U4;const xc=class xc{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new xc(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new xc(this.stack,this.pos,this.index)}};u(xc,"StackBufferCursor");let Kb=xc;function vu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&a--,a>=34&&a--;let s=a-32;if(s>=46&&(s-=46,o=!0),l+=s,o)break;l*=46}n?n[i++]=l:n=new e(l)}return n}u(vu,"decodeArray");const G4=class G4{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};u(G4,"CachedToken");let Ka=G4;const BA=new Ka,_4=class _4{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=BA,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,l=this.pos+e;for(;lr.to:l>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];l+=a.from-r.to,r=a}return l}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ro.to&&(this.chunk2=this.chunk2.slice(0,o.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=BA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}};u(_4,"InputStream");let Ub=_4;const H4=class H4{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;RA(this.data,e,n,this.id,r.data,r.tokenPrecTable)}};u(H4,"TokenGroup");let Ti=H4;Ti.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const J4=class J4{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?vu(e):e}token(e,n){let r=e.pos,i=0;for(;;){let l=e.next<0,a=e.resolveOffset(1,1);if(RA(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(l||i++,a==null)break;e.reset(a,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}};u(J4,"LocalTokenGroup");let Ua=J4;Ua.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const e$=class e${constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};u(e$,"ExternalTokenizer");let Dt=e$;function RA(t,e,n,r,i,l){let a=0,o=1<0){let m=t[p];if(s.allows(m)&&(e.token.value==-1||e.token.value==m||cY(m,e.token.value,i,l))){e.acceptToken(m);break}}let d=e.next,f=0,h=t[a+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){a=t[c+h*3-1];continue e}for(;f>1,m=c+p+(p<<1),g=t[m],O=t[m+1]||65536;if(d=O)f=p+1;else{a=t[m+2],e.advance();continue e}}break}}u(RA,"readToken");function VA(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}u(VA,"findOffset");function cY(t,e,n,r){let i=VA(n,r,e);return i<0||VA(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}u(NA,"cutAt");const t$=class t${constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?NA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?NA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(l instanceof Le){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(l),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+l.length}}};u(t$,"FragmentCursor");let _b=t$;const n$=class n${constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Ka)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:l}=i,a=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let c=0;cf.end+25&&(s=Math.max(f.lookAhead,s)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!d.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return s&&e.setLookAhead(s),!r&&e.pos==this.stream.end&&(r=new Ka,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Ka,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:l}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let l=0;le.bufferLength*4?new _b(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,l;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(o);else{if(this.advanceStack(o,r,e))continue;{i||(i=[],l=[]),i.push(o);let s=this.tokens.getMainToken(o);l.push(s.value,s.end)}}break}}if(!r.length){let a=i&&dY(i);if(a)return nn&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw nn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,l,r);if(a)return nn&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((o,s)=>s.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)r.splice(s--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,d=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?l.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(ue.contextHash)||0)==d))return e.useNode(f,h),nn&&console.log(a+this.stackID(e)+` (via reuse of ${l.getName(f.type.id)})`),!0;if(!(f instanceof Le)||f.children.length==0||f.positions[0]>0)break;let p=f.children[0];if(p instanceof Le&&f.positions[0]==0)f=p;else break}}let o=l.stateSlot(e.state,4);if(o>0)return e.reduce(o),nn&&console.log(a+this.stackID(e)+` (via always-reduce ${l.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let c=0;ci?n.push(m):r.push(m)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return FA(e,n),!0}}runRecovery(e,n,r){let i=null,l=!1;for(let a=0;a ":"";if(o.deadEnd&&(l||(l=!0,o.restart(),nn&&console.log(d+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let f=o.split(),h=d;for(let p=0;f.forceReduce()&&p<10&&(nn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));p++)nn&&(h=this.stackID(f)+" -> ");for(let p of o.recoverByInsert(s))nn&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,r);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),nn&&console.log(d+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),FA(o,r)):(!i||i.scoret,"id"),l$=class l${constructor(e){this.start=e.start,this.shift=e.shift||ty,this.reduce=e.reduce||ty,this.reuse=e.reuse||ty,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}};u(l$,"ContextTracker");let gh=l$;const Sc=class Sc extends Lf{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)l(d,s,o[c++]);else{let f=o[c+-d];for(let h=-d;h>0;h--)l(o[c++],s,f);c++}}}this.nodeSet=new YO(n.map((o,s)=>en.define({name:s>=this.minRepeatTerm?void 0:o,id:s,props:i[s],top:r.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ZT;let a=vu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Ti(a,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new Jb(this,e,n,r);for(let l of this.wrappers)i=l(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let l=i[n+1];;){let a=i[l++],o=a&1,s=i[l++];if(o&&r)return s;for(let c=l+(a>>1);l0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let l=this.stateSlot(e,1);i==null;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=zr(this.data,l+2);else break;i=n(zr(this.data,l+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=zr(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((l,a)=>a&1&&l==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Sc.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(l=>l.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let l=e.specializers.find(o=>o.from==r.external);if(!l)return r;let a=Object.assign(Object.assign({},r),{external:l.to});return n.specializers[i]=IA(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let l of e.split(" ")){let a=n.indexOf(l);a>=0&&(r[a]=!0)}let i=null;for(let l=0;lr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}u(IA,"getSpecializer");const fY=55,hY=1,pY=56,mY=2,gY=57,OY=3,LA=4,bY=5,ny=6,zA=7,ZA=8,XA=9,jA=10,yY=11,vY=12,$Y=13,ry=58,wY=14,xY=15,qA=59,WA=21,SY=23,YA=24,CY=25,iy=27,KA=28,kY=29,DY=32,PY=35,EY=37,TY=38,AY=0,QY=1,MY={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},BY={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},UA={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function RY(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}u(RY,"nameChar");let GA=null,_A=null,HA=0;function ly(t,e){let n=t.pos+e;if(HA==n&&_A==t)return GA;let r=t.peek(e),i="";for(;RY(r);)i+=String.fromCharCode(r),r=t.peek(++e);return _A=t,HA=n,GA=i?i.toLowerCase():r==VY||r==NY?void 0:null}u(ly,"tagNameAfter");const JA=60,Oh=62,ay=47,VY=63,NY=33,FY=45;function eQ(t,e){this.name=t,this.parent=e}u(eQ,"ElementContext");const IY=[ny,jA,zA,ZA,XA],LY=new gh({start:null,shift(t,e,n,r){return IY.indexOf(e)>-1?new eQ(ly(r,1)||"",t):t},reduce(t,e){return e==WA&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==ny||i==EY?new eQ(ly(r,1)||"",t):t},strict:!1}),zY=new Dt((t,e)=>{if(t.next!=JA){t.next<0&&e.context&&t.acceptToken(ry);return}t.advance();let n=t.next==ay;n&&t.advance();let r=ly(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?xY:wY);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(yY);if(i&&BY[i])return t.acceptToken(ry,-2);if(e.dialectEnabled(AY))return t.acceptToken(vY);for(let l=e.context;l;l=l.parent)if(l.name==r)return;t.acceptToken($Y)}else{if(r=="script")return t.acceptToken(zA);if(r=="style")return t.acceptToken(ZA);if(r=="textarea")return t.acceptToken(XA);if(MY.hasOwnProperty(r))return t.acceptToken(jA);i&&UA[i]&&UA[i][r]?t.acceptToken(ry,-1):t.acceptToken(ny)}},{contextual:!0}),ZY=new Dt(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(qA);break}if(t.next==FY)e++;else if(t.next==Oh&&e>=2){n>=3&&t.acceptToken(qA,-2);break}else e=0;t.advance()}});function XY(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}u(XY,"inForeignElement");const jY=new Dt((t,e)=>{if(t.next==ay&&t.peek(1)==Oh){let n=e.dialectEnabled(QY)||XY(e.context);t.acceptToken(n?bY:LA,2)}else t.next==Oh&&t.acceptToken(LA,1)});function oy(t,e,n){let r=2+t.length;return new Dt(i=>{for(let l=0,a=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(l==0&&i.next==JA||l==1&&i.next==ay||l>=2&&la?i.acceptToken(e,-a):i.acceptToken(n,-(a-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else l=a=0;i.advance()}})}u(oy,"contentTokenizer");const qY=oy("script",fY,hY),WY=oy("style",pY,mY),YY=oy("textarea",gY,OY),KY=jf({"Text RawText IncompleteTag IncompleteCloseTag":V.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":V.angleBracket,TagName:V.tagName,"MismatchedCloseTag/TagName":[V.tagName,V.invalid],AttributeName:V.attributeName,"AttributeValue UnquotedAttributeValue":V.attributeValue,Is:V.definitionOperator,"EntityReference CharacterReference":V.character,Comment:V.blockComment,ProcessingInst:V.processingInstruction,DoctypeDecl:V.documentMeta}),UY=$u.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:LY,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[KY],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=o.type.id;if(c==kY)return sy(o,s,n);if(c==DY)return sy(o,s,r);if(c==PY)return sy(o,s,i);if(c==WA&&l.length){let d=o.node,f=d.firstChild,h=f&&nQ(f,s),p;if(h){for(let m of l)if(m.tag==h&&(!m.attrs||m.attrs(p||(p=tQ(f,s))))){let g=d.lastChild,O=g.type.id==TY?g.from:d.to;if(O>f.to)return{parser:m.parser,overlay:[{from:f.to,to:O}]}}}}if(a&&c==YA){let d=o.node,f;if(f=d.firstChild){let h=a[s.read(f.from,f.to)];if(h)for(let p of h){if(p.tagName&&p.tagName!=nQ(d.parent,s))continue;let m=d.lastChild;if(m.type.id==iy){let g=m.from+1,O=m.lastChild,b=m.to-(O&&O.isError?0:1);if(b>g)return{parser:p.parser,overlay:[{from:g,to:b}]}}else if(m.type.id==KA)return{parser:p.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}u(rQ,"configureNesting");const GY=122,iQ=1,_Y=123,HY=124,lQ=2,JY=125,eK=3,tK=4,aQ=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],nK=58,rK=40,oQ=95,iK=91,bh=45,lK=46,aK=35,oK=37,sK=38,uK=92,cK=10,dK=42;function wu(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}u(wu,"isAlpha");function uy(t){return t>=48&&t<=57}u(uy,"isDigit");function sQ(t){return uy(t)||t>=97&&t<=102||t>=65&&t<=70}u(sQ,"isHex");const uQ=u((t,e,n)=>(r,i)=>{for(let l=!1,a=0,o=0;;o++){let{next:s}=r;if(wu(s)||s==bh||s==oQ||l&&uy(s))!l&&(s!=bh||o>0)&&(l=!0),a===o&&s==bh&&a++,r.advance();else if(s==uK&&r.peek(1)!=cK){if(r.advance(),sQ(r.next)){do r.advance();while(sQ(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();l=!0}else{l&&r.acceptToken(a==2&&i.canShift(lQ)?e:s==rK?n:t);break}}},"identifierTokens"),fK=new Dt(uQ(_Y,lQ,HY)),hK=new Dt(uQ(JY,eK,tK)),pK=new Dt(t=>{if(aQ.includes(t.peek(-1))){let{next:e}=t;(wu(e)||e==oQ||e==aK||e==lK||e==dK||e==iK||e==nK&&wu(t.peek(1))||e==bh||e==sK)&&t.acceptToken(GY)}}),mK=new Dt(t=>{if(!aQ.includes(t.peek(-1))){let{next:e}=t;if(e==oK&&(t.advance(),t.acceptToken(iQ)),wu(e)){do t.advance();while(wu(t.next)||uy(t.next));t.acceptToken(iQ)}}}),gK=jf({"AtKeyword import charset namespace keyframes media supports":V.definitionKeyword,"from to selector":V.keyword,NamespaceName:V.namespace,KeyframeName:V.labelName,KeyframeRangeName:V.operatorKeyword,TagName:V.tagName,ClassName:V.className,PseudoClassName:V.constant(V.className),IdName:V.labelName,"FeatureName PropertyName":V.propertyName,AttributeName:V.attributeName,NumberLiteral:V.number,KeywordQuery:V.keyword,UnaryQueryOp:V.operatorKeyword,"CallTag ValueName":V.atom,VariableName:V.variableName,Callee:V.operatorKeyword,Unit:V.unit,"UniversalSelector NestingSelector":V.definitionOperator,"MatchOp CompareOp":V.compareOperator,"ChildOp SiblingOp, LogicOp":V.logicOperator,BinOp:V.arithmeticOperator,Important:V.modifier,Comment:V.blockComment,ColorLiteral:V.color,"ParenthesizedContent StringLiteral":V.string,":":V.punctuation,"PseudoOp #":V.derefOperator,"; ,":V.separator,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace}),OK={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},bK={__proto__:null,or:98,and:98,not:106,only:106,layer:170},yK={__proto__:null,selector:112,layer:166},vK={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},$K={__proto__:null,to:207},wK=$u.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hOK[t]||-1},{term:125,get:t=>bK[t]||-1},{term:4,get:t=>yK[t]||-1},{term:25,get:t=>vK[t]||-1},{term:123,get:t=>$K[t]||-1}],tokenPrec:1963});let cy=null;function dy(){if(!cy&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));cy=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return cy||[]}u(dy,"properties");const cQ=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),dQ=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),xK=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),SK=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Zr=/^(\w[\w-]*|-\w[\w-]*|)$/,CK=/^-(-[\w-]*)?$/;function kK(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}u(kK,"isVarArg");const fQ=new If,DK=["Declaration"];function PK(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}u(PK,"astTop");function hQ(t,e,n){if(e.to-e.from>4096){let r=fQ.get(e);if(r)return r;let i=[],l=new Set,a=e.cursor(Ae.IncludeAnonymous);if(a.firstChild())do for(let o of hQ(t,a.node,n))l.has(o.label)||(l.add(o.label),i.push(o));while(a.nextSibling());return fQ.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(l=>{var a;if(n(l)&&l.matchContext(DK)&&((a=l.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let o=t.sliceString(l.from,l.to);i.has(o)||(i.add(o),r.push({label:o,type:"variable"}))}}),r}}u(hQ,"variableNames");const EK=u(t=>e=>{let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(l||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:dy(),validFor:Zr};if(i.name=="ValueName")return{from:i.from,options:dQ,validFor:Zr};if(i.name=="PseudoClassName")return{from:i.from,options:cQ,validFor:Zr};if(t(i)||(e.explicit||l)&&kK(i,n.doc))return{from:t(i)||l?i.from:r,options:hQ(n.doc,PK(i),t),validFor:CK};if(i.name=="TagName"){for(let{parent:s}=i;s;s=s.parent)if(s.name=="Block")return{from:i.from,options:dy(),validFor:Zr};return{from:i.from,options:xK,validFor:Zr}}if(i.name=="AtKeyword")return{from:i.from,options:SK,validFor:Zr};if(!e.explicit)return null;let a=i.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:cQ,validFor:Zr}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:dQ,validFor:Zr}:a.name=="Block"||a.name=="Styles"?{from:r,options:dy(),validFor:Zr}:null},"defineCSSCompletionSource")(t=>t.name=="VariableName"),yh=lu.define({name:"css",parser:wK.configure({props:[Uf.add({Declaration:Gf()}),_f.add({"Block KeyframeList":s7})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function TK(){return new su(yh,yh.data.of({autocomplete:EK}))}u(TK,"css");const AK=316,QK=317,pQ=1,MK=2,BK=3,RK=4,VK=318,NK=320,FK=321,IK=5,LK=6,zK=0,fy=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],mQ=125,ZK=59,hy=47,XK=42,jK=43,qK=45,WK=60,YK=44,KK=63,UK=46,GK=91,_K=new gh({start:!1,shift(t,e){return e==IK||e==LK||e==NK?t:e==FK},strict:!1}),HK=new Dt((t,e)=>{let{next:n}=t;(n==mQ||n==-1||e.context)&&t.acceptToken(VK)},{contextual:!0,fallback:!0}),JK=new Dt((t,e)=>{let{next:n}=t,r;fy.indexOf(n)>-1||n==hy&&((r=t.peek(1))==hy||r==XK)||n!=mQ&&n!=ZK&&n!=-1&&!e.context&&t.acceptToken(AK)},{contextual:!0}),eU=new Dt((t,e)=>{t.next==GK&&!e.context&&t.acceptToken(QK)},{contextual:!0}),tU=new Dt((t,e)=>{let{next:n}=t;if(n==jK||n==qK){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(pQ);t.acceptToken(r?pQ:MK)}}else n==KK&&t.peek(1)==UK&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(BK))},{contextual:!0});function py(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}u(py,"identifierChar");const nU=new Dt((t,e)=>{if(t.next!=WK||!e.dialectEnabled(zK)||(t.advance(),t.next==hy))return;let n=0;for(;fy.indexOf(t.next)>-1;)t.advance(),n++;if(py(t.next,!0)){for(t.advance(),n++;py(t.next,!1);)t.advance(),n++;for(;fy.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==YK)return;for(let r=0;;r++){if(r==7){if(!py(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(RK,-n)}),rU=jf({"get set async static":V.modifier,"for while do if else switch try catch finally return throw break continue default case defer":V.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":V.operatorKeyword,"let var const using function class extends":V.definitionKeyword,"import export from":V.moduleKeyword,"with debugger new":V.keyword,TemplateString:V.special(V.string),super:V.atom,BooleanLiteral:V.bool,this:V.self,null:V.null,Star:V.modifier,VariableName:V.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":V.function(V.variableName),VariableDefinition:V.definition(V.variableName),Label:V.labelName,PropertyName:V.propertyName,PrivatePropertyName:V.special(V.propertyName),"CallExpression/MemberExpression/PropertyName":V.function(V.propertyName),"FunctionDeclaration/VariableDefinition":V.function(V.definition(V.variableName)),"ClassDeclaration/VariableDefinition":V.definition(V.className),"NewExpression/VariableName":V.className,PropertyDefinition:V.definition(V.propertyName),PrivatePropertyDefinition:V.definition(V.special(V.propertyName)),UpdateOp:V.updateOperator,"LineComment Hashbang":V.lineComment,BlockComment:V.blockComment,Number:V.number,String:V.string,Escape:V.escape,ArithOp:V.arithmeticOperator,LogicOp:V.logicOperator,BitOp:V.bitwiseOperator,CompareOp:V.compareOperator,RegExp:V.regexp,Equals:V.definitionOperator,Arrow:V.function(V.punctuation),": Spread":V.punctuation,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace,"InterpolationStart InterpolationEnd":V.special(V.brace),".":V.derefOperator,", ;":V.separator,"@":V.meta,TypeName:V.typeName,TypeDefinition:V.definition(V.typeName),"type enum interface implements namespace module declare":V.definitionKeyword,"abstract global Privacy readonly override":V.modifier,"is keyof unique infer asserts":V.operatorKeyword,JSXAttributeValue:V.attributeValue,JSXText:V.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":V.angleBracket,"JSXIdentifier JSXNameSpacedName":V.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":V.attributeName,"JSXBuiltin/JSXIdentifier":V.standard(V.tagName)}),iU={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},lU={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},aU={__proto__:null,"<":193},oU=$u.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:_K,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[rU],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[JK,eU,tU,nU,2,3,4,5,6,7,8,9,10,11,12,13,14,HK,new Ua("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Ua("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>iU[t]||-1},{term:343,get:t=>lU[t]||-1},{term:95,get:t=>aU[t]||-1}],tokenPrec:15201}),gQ=[Zt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Zt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Zt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Zt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Zt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Zt(`try { +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,BO),iX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let RO=null;function lX(){var t;if(RO==null&&typeof document<"u"&&document.body){let e=document.body.style;RO=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return RO||!1}u(lX,"supportsTabSize");const Af=_.define({combine(t){let e=bi(t,{render:null,specialChars:rX,addSpecialChars:null});return(e.replaceTabs=!lX())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,BO)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,BO)),e}});function aX(t={}){return[Af.of(t),oX()]}u(aX,"highlightSpecialChars");let CT=null;function oX(){return CT||(CT=it.fromClass(class{constructor(t){this.view=t,this.decorations=re.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Af)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Tf({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,l=Ft(e[0],0);if(l==9){let a=i.lineAt(r),o=n.state.tabSize,s=Ra(a.text,o,r-a.from);return re.replace({widget:new NO((o-s%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[l]||(this.decorationCache[l]=re.replace({widget:new VO(t,l)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Af);t.startState.facet(Af)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}u(oX,"specialCharPlugin");const sX="\u2022";function uX(t){return t>=32?sX:t==10?"\u2424":String.fromCharCode(9216+t)}u(uX,"placeholder$1");const s4=class s4 extends Hn{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=uX(this.code),r=e.state.phrase("Control character")+" "+(iX[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let l=document.createElement("span");return l.textContent=n,l.title=r,l.setAttribute("aria-label",r),l.className="cm-specialChar",l}ignoreEvent(){return!1}};u(s4,"SpecialCharWidget");let VO=s4;const u4=class u4 extends Hn{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};u(u4,"TabWidget");let NO=u4;function cX(){return fX}u(cX,"highlightActiveLine");const dX=re.line({class:"cm-activeLine"}),fX=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(dX.range(i.from)),e=i.from)}return re.set(n)}},{decorations:t=>t.decorations}),c4=class c4 extends Hn{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Va(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Ms(n[0],r.direction!="rtl"),l=parseInt(r.lineHeight);return i.bottom-i.top>l*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+l}:i}ignoreEvent(){return!1}};u(c4,"Placeholder");let FO=c4;function hX(t){let e=it.fromClass(class{constructor(n){this.view=n,this.placeholder=t?re.set([re.widget({widget:new FO(t),side:1}).range(0)]):re.none}get decorations(){return this.view.state.doc.length?re.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,J.contentAttributes.of({"aria-placeholder":t})]:e}u(hX,"placeholder");const IO=2e3;function pX(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),l=[];if(e.off>IO||n.off>IO||e.col<0||n.col<0){let a=Math.min(e.off,n.off),o=Math.max(e.off,n.off);for(let s=r;s<=i;s++){let c=t.doc.line(s);c.length<=o&&l.push(X.range(c.from+a,c.to+o))}}else{let a=Math.min(e.col,n.col),o=Math.max(e.col,n.col);for(let s=r;s<=i;s++){let c=t.doc.line(s),d=z0(c.text,a,t.tabSize,!0);if(d<0)l.push(X.cursor(c.to));else{let f=z0(c.text,o,t.tabSize);l.push(X.range(c.from+d,c.from+f))}}}return l}u(pX,"rectangleFor");function mX(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}u(mX,"absoluteColumn");function kT(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,l=i>IO?-1:i==r.length?mX(t,e.clientX):Ra(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:l,off:i}}u(kT,"getPos");function gX(t,e){let n=kT(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let l=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(l);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get(i,l,a){let o=kT(t,i);if(!o)return r;let s=pX(t.state,n,o);return s.length?a?X.create(s.concat(r.ranges)):X.create(s):r}}:null}u(gX,"rectangleSelectionStyle");function OX(t){let e=t?.eventFilter||(n=>n.altKey&&n.button==0);return J.mouseSelectionStyle.of((n,r)=>e(r)?gX(n,r):null)}u(OX,"rectangularSelection");const bX={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},yX={style:"cursor: crosshair"};function vX(t={}){let[e,n]=bX[t.key||"Alt"],r=it.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,J.contentAttributes.of(i=>{var l;return!((l=i.plugin(r))===null||l===void 0)&&l.isDown?yX:null})]}u(vX,"crosshairCursor");const Gs="-10000px",d4=class d4{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let l=null;this.tooltipViews=this.tooltips.map(a=>l=r(a,l))}update(e,n){var r;let i=e.state.facet(this.facet),l=i.filter(s=>s);if(i===this.input){for(let s of this.tooltipViews)s.update&&s.update(e);return!1}let a=[],o=n?[]:null;for(let s=0;sn[c]=s),n.length=o.length),this.input=i,this.tooltips=l,this.tooltipViews=a,!0}};u(d4,"TooltipViewManager");let LO=d4;function $X(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}u($X,"windowSpace");const zO=_.define({combine:t=>{var e,n,r;return{position:U.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||$X}}}),DT=new WeakMap,PT=it.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(zO);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new LO(t,TT,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(zO);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Gs,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:l}=this.manager.tooltipViews[0];if(U.gecko)n=l.offsetParent!=this.container.ownerDocument.body;else if(l.style.top==Gs&&l.style.left=="0px"){let a=l.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}}if(n||this.position=="absolute")if(this.parent){let l=this.parent.getBoundingClientRect();l.width&&l.height&&(t=l.width/this.parent.offsetWidth,e=l.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=cO(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((l,a)=>{let o=this.manager.tooltipViews[a];return o.getCoords?o.getCoords(l.pos):this.view.coordsAtPos(l.pos)}),size:this.manager.tooltipViews.map(({dom:l})=>l.getBoundingClientRect()),space:this.view.state.facet(zO).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:l}=t,a=[];for(let o=0;o=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){d.style.top=Gs;continue}let p=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=p?7:0,g=h.right-h.left,O=(e=DT.get(c))!==null&&e!==void 0?e:h.bottom-h.top,b=c.offset||xX,y=this.view.textDirection==Ve.LTR,$=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(f.left-(p?14:0)+b.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(p?14:0)-b.x),r.right-g),v=this.above[o];!s.strictSide&&(v?f.top-O-m-b.yr.bottom)&&v==r.bottom-f.bottom>f.top-r.top&&(v=this.above[o]=!v);let S=(v?f.top-r.top:r.bottom-f.bottom)-m;if(S$&&Q.topx&&(x=v?Q.top-O-2-m:Q.bottom+m+2);if(this.position=="absolute"?(d.style.top=(x-t.parent.top)/l+"px",ET(d,($-t.parent.left)/i)):(d.style.top=x/l+"px",ET(d,$/i)),p){let Q=f.left+(y?b.x:-b.x)-($+14-7);p.style.left=Q/i+"px"}c.overlap!==!0&&a.push({left:$,top:x,right:C,bottom:x+O}),d.classList.toggle("cm-tooltip-above",v),d.classList.toggle("cm-tooltip-below",!v),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Gs}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ET(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}u(ET,"setLeftStyle");const wX=J.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),xX={x:0,y:0},TT=_.define({enables:[PT,wX]});function AT(t,e){let n=t.plugin(PT);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}u(AT,"getTooltip");const f4=class f4 extends Nr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};u(f4,"GutterMarker");let Qn=f4;Qn.prototype.elementClass="",Qn.prototype.toDOM=void 0,Qn.prototype.mapMode=ct.TrackBefore,Qn.prototype.startSide=Qn.prototype.endSide=-1,Qn.prototype.point=!0;const Qf=_.define(),SX=_.define(),CX={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Te.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},_s=_.define();function kX(t){return[QT(),_s.of({...CX,...t})]}u(kX,"gutter");const ZO=_.define({combine:t=>t.some(e=>e)});function QT(t){let e=[DX];return t&&t.fixed===!1&&e.push(ZO.of(!0)),e}u(QT,"gutters");const DX=it.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(_s).map(e=>new Mf(t,e)),this.fixed=!t.state.facet(ZO);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(ZO)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Te.iter(this.view.state.facet(Qf),this.view.viewport.from),r=[],i=this.gutters.map(l=>new jO(l,this.view.viewport,-this.view.documentPadding.top));for(let l of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(l.type)){let a=!0;for(let o of l.type)if(o.type==kt.Text&&a){XO(n,r,o.from);for(let s of i)s.line(this.view,o,r);a=!1}else if(o.widget)for(let s of i)s.widget(this.view,o)}else if(l.type==kt.Text){XO(n,r,l.from);for(let a of i)a.line(this.view,l,r)}else if(l.widget)for(let a of i)a.widget(this.view,l);for(let l of i)l.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(_s),n=t.state.facet(_s),r=t.docChanged||t.heightChanged||t.viewportChanged||!Te.eq(t.startState.facet(Qf),t.state.facet(Qf),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let l of n){let a=e.indexOf(l);a<0?i.push(new Mf(this.view,l)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let l of this.gutters)l.dom.remove(),i.indexOf(l)<0&&l.destroy();for(let l of i)l.config.side=="after"?this.getDOMAfter().appendChild(l.dom):this.dom.appendChild(l.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>J.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ve.LTR?{left:r,right:i}:{right:r,left:i}})});function MT(t){return Array.isArray(t)?t:[t]}u(MT,"asArray");function XO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}u(XO,"advanceCursor");const h4=class h4{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Te.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,l=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let o=new Bf(e,a,l,r);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,a,l,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];XO(this.cursor,i,n.from),r.length&&(i=i.concat(r));let l=this.gutter.config.lineMarker(e,n,i);l&&i.unshift(l);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let l of e.state.facet(SX)){let a=l(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}};u(h4,"UpdateContext");let jO=h4;const p4=class p4{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let l=i.target,a;if(l!=this.dom&&this.dom.contains(l)){for(;l.parentNode!=this.dom;)l=l.parentNode;let s=l.getBoundingClientRect();a=(s.top+s.bottom)/2}else a=i.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,o,i)&&i.preventDefault()});this.markers=MT(n.markers(e)),n.initialSpacer&&(this.spacer=new Bf(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=MT(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Te.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}};u(p4,"SingleGutterView");let Mf=p4;const m4=class m4{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),PX(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let l=0,a=0;;){let o=a,s=ll(o,s,c)||a(o,s,c):a}return r}})}}),g4=class g4 extends Qn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};u(g4,"NumberMarker");let Hs=g4;function qO(t,e){return t.state.facet(za).formatNumber(e,t.state)}u(qO,"formatNumber");const AX=_s.compute([za],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(EX)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Hs(qO(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(TX)){let l=i(e,n,r);if(l)return l}return null},lineMarkerChange:e=>e.startState.facet(za)!=e.state.facet(za),initialSpacer(e){return new Hs(qO(e,BT(e.state.doc.lines)))},updateSpacer(e,n){let r=qO(n.view,BT(n.view.state.doc.lines));return r==e.number?e:new Hs(r)},domEventHandlers:t.facet(za).domEventHandlers,side:"before"}));function QX(t={}){return[za.of(t),QT(),AX]}u(QX,"lineNumbers");function BT(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(MX.range(i)))}return Te.of(e)});function RX(){return BX}u(RX,"highlightActiveLineGutter");var VX=Object.defineProperty,Js=u((t,e)=>VX(t,"name",{value:e,configurable:!0}),"d$b");const RT=Js((t,e="",n=!1,r=[],i=(o,s)=>s[o]??o,l={},a="")=>new J({doc:e,parent:t,extensions:[hX(a),it.fromClass(class{constructor(o){this.items=FX(r),this.placeholders=this.matchResults(this.items).createDeco(o)}update(o){this.placeholders=this.matchResults(this.items).updateDeco(o,this.placeholders)}matchResults(o){return new Tf({regexp:X2,decoration:(s,c,d)=>re.replace({widget:new IX(s[1],i(s[1],o),()=>c.dispatch({changes:{from:d,to:d+s[1].length+4}}),l)})})}},{decorations:o=>o.placeholders,provide:o=>J.atomicRanges.of(s=>s.plugin(o)?.placeholders||re.none)}),J.updateListener.of(o=>{if(l.inputMask){if(o.focusChanged)o.state.doc.toString().includes("_")?o.view.dispatch({changes:{from:0,to:o.state.doc.length,insert:""}}):o.state.doc.toString().length===0&&o.view.hasFocus&&VT(o,l.inputMask);else if(o.docChanged&&o.view.hasFocus&&VT(o,l.inputMask))return}o.docChanged&&n&&n(o.state.doc.toString())}),J.theme({".cm-scroller":{fontFamily:"inherit",alignItems:"center !important"},"&.cm-editor.cm-focused":{outline:"none"}}),Xe.readOnly.of(l.readOnly??!1),J.contentAttributes.of({contenteditable:!(l.readOnly??!1)})]}),"createInput");var WO=!1;const VT=Js((t,e)=>{if(t.state.doc.toString().length===0){let n="";for(const r of e)n+=r==="a"||r==="9"||r==="*"?"_":r;t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n}})}else{if(t.startState.doc.toString()===""||WO)return WO=!1,!1;const n=t.startState.doc.toString().split("");let r;return t.changes.iterChanges((i,l,a,o)=>{const s=t.state.doc.sliceString(a,o).split("");let c=Math.min(Math.max(l,o),n.length),d=Math.min(i,a);r=s.length>0?c:d;let f=0,h=!1;for(;d!==c;){let p=e[d],m=s[f];switch(p){case"a":m&&m.match(/[a-zA-Z]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"9":m&&m.match(/[0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"*":m&&m.match(/[a-zA-Z0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;default:n[d]=p;break}d+=1}}),WO=!0,t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n.join("")},selection:{anchor:r,head:r}}),!0}},"handleMasking"),NX=Js((t,e)=>{if(t.length!==e.length)return!1;for(let n=0;nArray.isArray(t)?t.reduce((e,n)=>({...e,...n.choices??{}}),{}):t,"getItemsObject"),NT=(hc=class extends Hn{constructor(e,n,r,i){super(e),this.value=e,this.label=n,this.onRemove=r,this.config=i}toDOM(){const e=document.createElement("span");if(e.setAttribute("class","tf-dynamic-text-item"),e.setAttribute("data-id",this.value),e.textContent=this.label,this.config?.readOnly===!0)return e;const n=document.createElement("span");return n.setAttribute("class","tf-dynamic-text-item-delete"),n.addEventListener("click",this.onRemove),e.appendChild(n),e}},u(hc,"k"),hc);Js(NT,"DynamicString");let IX=NT;var LX=Object.defineProperty,FT=u((t,e)=>LX(t,"name",{value:e,configurable:!0}),"x$8");const zX=wp.element.forwardRef(({inputProps:t,...e},n)=>{const r=wp.element.useRef();let i=e.value??"";if((e.prefix||e.suffix)&&(e.prefix&&!i.startsWith(e.prefix)&&(i=e.prefix+i),e.suffix&&!i.endsWith(e.suffix)&&(i=i+e.suffix)),e.inputMask){const c=e.prefix?e.prefix.length:0,d=e.suffix?i.length-e.suffix.length:i.length;i=NX(i.slice(c,d),e.inputMask)?i:""}const[l,a]=wp.element.useState(i);wp.element.useEffect(()=>{let c=l;e.prefix&&(c=c.slice(e.prefix.length)),e.suffix&&(c=c.slice(0,c.length-e.suffix.length)),r.current=r.current??RT(n.current,c,d=>{a(`${e.prefix??""}${d}${e.suffix??""}`)},e.choices,o,{readOnly:e.readOnly??!1,inputMask:e.inputMask&&e.inputMask!==""?e.inputMask:null},e.placeholder??"")},[n.current]),wp.element.useEffect(()=>{if(e.suffix){const c=document.createElement("span");c.textContent=e.suffix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--suffix"),n.current.appendChild(c)}if(e.prefix){const c=document.createElement("span");c.textContent=e.prefix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--prefix"),n.current.insertBefore(c,n.current.children[0])}},[]);const o=FT(c=>{const d=e.dynamic.parse(c);return d&&d.type?e.dynamic.getLabel(d.type):c},"getDynamicValueLabel");wp.element.useEffect(()=>e.onChange&&e.onChange(l),[l]);const s=FT(c=>{r.current.dispatch({changes:{from:r.current.state.doc.length,insert:`${c}`}})},"insertDynamicValue");return!e.inputMask&&e.dynamic&&e.dynamic.getMode()==="replace"?wp.element.createElement(Cs,{...e,config:e.dynamic??"",value:l,onValueSelection:a,onValueRemove:()=>{r.current=null,a("")},inputProps:t,readOnly:e.readOnly??!1,buttonType:"inside"},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`})):wp.element.createElement(bE,{config:e.dynamic??"",onValueSelection:s,buttonType:"inside",readOnly:e.readOnly??!1,inputMasking:e.inputMask},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`}))});var ZX=Object.defineProperty,XX=u((t,e)=>ZX(t,"name",{value:e,configurable:!0}),"u$a");const Rf=XX(t=>{const{locale:e}=Re(),[n,r]=wp.element.useState(t.value??""),i=wp.element.useMemo(()=>({maximumFractionDigits:10,useGrouping:!1}),[]),l=t.formatOptions??i,a=pN({...t,formatOptions:l,locale:e}),o=wp.element.useRef(),{labelProps:s,descriptionProps:c,groupProps:d,inputProps:f,incrementButtonProps:h,decrementButtonProps:p}=kN({...t,formatOptions:l},a,o);wp.element.useEffect(()=>t.onChange&&t.onChange(n),[n]);const m=t.hasButtons??!0,g=t.readOnly??!1;return wp.element.createElement("div",{className:"tf-number","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement("div",{className:"tf-number-field",...d},wp.element.createElement(Cs,{...t,value:n,onValueSelection:r,ref:o,inputProps:f},wp.element.createElement("input",{...f,step:t.step??1,ref:o,name:t.name??"",disabled:g}),m&&wp.element.createElement("div",{className:"tf-number-button-group"},wp.element.createElement(se,{type:"number",...h,isDisabled:g},"+"),wp.element.createElement(se,{type:"number",...p,isDisabled:g},"-")))),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"NumberComponent");var jX=Object.defineProperty,qX=u((t,e)=>jX(t,"name",{value:e,configurable:!0}),"r$6");const eu=qX(t=>{const e=HI(t),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),{labelProps:l,descriptionProps:a,triggerProps:o,valueProps:s,menuProps:c}=GF(t,e,n);return wp.element.createElement("div",{className:"tf-select",ref:i},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(HF,{state:e,triggerRef:n,label:t.label,name:t.name}),wp.element.createElement(se,{type:"select",...o,ref:n,onKeyDown:d=>d.code==="Space"?e.toggle():o.onKeyDown(d)},wp.element.createElement("span",{...s,className:"tf-select__value"},e.selectedItem?e.selectedItem.rendered:t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:n,placement:"bottom start",style:{width:i?.current?.offsetWidth}},wp.element.createElement(Nd,{...c,listBoxRef:r,state:e,items:t.items})),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Select");var WX=Object.defineProperty,tu=u((t,e)=>WX(t,"name",{value:e,configurable:!0}),"n$g");const IT=tu(t=>{const e=t.units??["px"],n=t.linked==="toggle"||t.linked===void 0,{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]),wp.element.useEffect(()=>{a.isLinked&&c(a.top)},[a.isLinked]);const s=tu((p,m)=>{o({...a,[m]:p})},"setAttribute"),c=tu(p=>{o({...a,top:p,left:p,right:p,bottom:p})},"setLinkedPosition"),d=tu(p=>{o({...a,isLinked:p})},"setIsLinked"),f=tu(()=>n?a.isLinked??!1:t.linked,"isLinked");let h="tf-dimensions-number-groups";return f()&&(h+=" tf-dimensions-number-groups-linked"),wp.element.createElement("div",{className:"tf-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-dimensions-container"},wp.element.createElement("div",{className:h},["top","left","right","bottom"].map(p=>wp.element.createElement(Rf,{key:p,value:a[p]??0,name:p,description:!1,label:`Value for ${p} position`,labelVisuallyHidden:!0,onChange:m=>f()?c(m):s(m,p)}))),wp.element.createElement(eu,{label:"Dimensions unit",labelVisuallyHidden:!0,description:!1,selectedKey:a.unit??"px",onSelectionChange:p=>s(p,"unit"),placeholder:"unit"},e.map(p=>wp.element.createElement(Qr,{key:p},p))),n&&wp.element.createElement(se,{type:"action",onPress:()=>d(!a.isLinked)},wp.element.createElement("span",{className:"dashicons dashicons-admin-links"}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Dimensions");var YX=Object.defineProperty,LT=u((t,e)=>YX(t,"name",{value:e,configurable:!0}),"a$9");const KX=LT(t=>{const e=t.units??["px"],n=t.format??"hex",{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{dimensions:{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1},color:"rgba(0,0,0,1)"}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]);const s=LT(c=>{o(typeof c=="string"?d=>({...d,color:c}):d=>({...d,dimensions:{...d.dimensions,...c}}))},"handleData");return wp.element.createElement("div",{className:"tf-border"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-border-container"},wp.element.createElement("div",{className:"tf-border-dimensions-container"},wp.element.createElement(IT,{label:"Border dimensions",labelVisuallyHidden:!0,onChange:s,linked:t.linked,units:e,value:a.dimensions})),wp.element.createElement("div",{className:"tf-border-color-picker-container"},wp.element.createElement(XQ,{label:"Border Color",labelVisuallyHidden:!0,onChange:s,value:a.color,format:n,hasAlpha:t.hasAlpha??!0}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Border");var UX=Object.defineProperty,GX=u((t,e)=>UX(t,"name",{value:e,configurable:!0}),"n$f");const _X=GX(t=>{const e=wp.element.useContext(t.context),n=wp.element.useRef(null),{inputProps:r}=I2(t,e,n);let i="tf-button-group-option";return e.selectedValue===t.value&&(i+=" tf-button-group-option-selected"),wp.element.createElement("label",{className:i},wp.element.createElement(gn,null,wp.element.createElement("input",{...r,ref:n})),t.children)},"ButtonOption");var HX=Object.defineProperty,JX=u((t,e)=>HX(t,"name",{value:e,configurable:!0}),"n$e");const zT=wp.element.createContext(null),ej=JX(t=>{const e=YP(t),n=rl(t.choices??{}),{radioGroupProps:r,labelProps:i,descriptionProps:l}=L2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-button-group"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-button-group-container",...r},wp.element.createElement(zT.Provider,{value:e},n.map(a=>wp.element.createElement(_X,{key:a.value,context:zT,...a},t.use_dashicon?wp.element.createElement("span",{className:`dashicons dashicons-${a.label}`}):a.label)))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"ButtonGroup");var tj=Object.defineProperty,nj=u((t,e)=>tj(t,"name",{value:e,configurable:!0}),"i$d");const nu=nj(t=>{const e=Cx(t),n=wp.element.useRef(),{inputProps:r}=UV({...t,children:t.label??!1},e,n),{labelProps:i,descriptionProps:l}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value==="1"&&e.setSelected(!0),typeof t.value=="boolean"&&t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]);const a=t?.labelVisuallyHidden?gn:wp.element.Fragment;return wp.element.createElement("div",{className:"tf-checkbox"},wp.element.createElement(xe,{labelProps:i,parent:{...t,labelVisuallyHidden:!1}},wp.element.createElement("input",{...r,ref:n,id:t.name??""}),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:e.isSelected?"1":"0"}),wp.element.createElement(a,null,t.label??"")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Checkbox"),ZT=1024;let rj=0;const O4=class O4{constructor(e,n){this.from=e,this.to=n}};u(O4,"Range");let It=O4;const b4=class b4{constructor(e={}){this.id=rj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=en.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}};u(b4,"NodeProp");let ue=b4;ue.closedBy=new ue({deserialize:t=>t.split(" ")}),ue.openedBy=new ue({deserialize:t=>t.split(" ")}),ue.group=new ue({deserialize:t=>t.split(" ")}),ue.isolate=new ue({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),ue.contextHash=new ue({perNode:!0}),ue.lookAhead=new ue({perNode:!0}),ue.mounted=new ue({perNode:!0});const y4=class y4{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[ue.mounted.id]}};u(y4,"MountedTree");let bl=y4;const ij=Object.create(null);let en=(Po=class{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):ij,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Po(e.name||"",n,e.id,r);if(e.props){for(let l of e.props)if(Array.isArray(l)||(l=l(i)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[l[0].id]=l[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(ue.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(ue.group),l=-1;l<(i?i.length:0);l++){let a=n[l<0?r.name:i[l]];if(a)return a}}}},u(Po,"NodeType"),Po);en.none=new en("",Object.create(null),0,8);const Ip=class Ip{constructor(e){this.types=e;for(let n=0;n0;for(let s=this.cursor(a|Ae.IncludeAnonymous);;){let c=!1;if(s.from<=l&&s.to>=i&&(!o&&s.type.isAnonymous||n(s)!==!1)){if(s.firstChild())continue;c=!0}for(;c&&r&&(o||!s.type.isAnonymous)&&r(s),!s.nextSibling();){if(!s.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:JO(en.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new pc(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new pc(en.none,n,r,i)))}static build(e){return aj(e)}};u(pc,"Tree");let Le=pc;Le.empty=new Le(en.none,[],[],0);const Lp=class Lp{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Lp(this.buffer,this.index)}};u(Lp,"FlatBufferCursor");let KO=Lp;const zp=class zp{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return en.none}toString(){let e=[];for(let n=0;n0));s=a[s+3]);return o}slice(e,n,r){let i=this.buffer,l=new Uint16Array(n-e),a=0;for(let o=e,s=0;o=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}u(jT,"checkSide");function ru(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?o.length:-1;e!=c;e+=n){let d=o[e],f=s[e]+a.from;if(jT(i,r,f,f+d.length)){if(d instanceof Si){if(l&Ae.ExcludeBuffers)continue;let h=d.findChild(0,d.buffer.length,n,r-f,i);if(h>-1)return new yl(new GO(a,d,e,f),null,h)}else if(l&Ae.IncludeAnonymous||!d.type.isAnonymous||HO(d)){let h;if(!(l&Ae.IgnoreMounts)&&(h=bl.get(d))&&!h.overlay)return new Eo(h.tree,f,e,a);let p=new Eo(d,f,e,a);return l&Ae.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?d.children.length-1:0,n,r,i)}}}if(l&Ae.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Ae.IgnoreOverlays)&&(i=bl.get(this._tree))&&i.overlay){let l=e-this.from;for(let{from:a,to:o}of i.overlay)if((n>0?a<=l:a=l:o>l))return new Eo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};u(Eo,"TreeNode");let Lt=Eo;function qT(t,e,n,r){let i=t.cursor(),l=[];if(!i.firstChild())return l;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return l}for(;;){if(r!=null&&i.type.is(r))return l;if(i.type.is(e)&&l.push(i.node),!i.nextSibling())return r==null?l:[]}}u(qT,"getChildren");function UO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}u(UO,"matchNodeContext");const $4=class $4{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}};u($4,"BufferContext");let GO=$4;const ql=class ql extends Nf{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return l<0?null:new ql(this.context,this,l)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Ae.ExcludeBuffers)return null;let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return l<0?null:new ql(this.context,this,l)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ql(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new ql(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,l=r.buffer[this.index+3];if(l>i){let a=r.buffer[this.index+1];e.push(r.slice(i,l,a)),n.push(0)}return new Le(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};u(ql,"BufferNode");let yl=ql;function WT(t){if(!t.length)return null;let e=0,n=t[0];for(let l=1;ln.from||a.to=e){let o=new Lt(a.tree,a.overlay[0].from+l.from,-1,l);(i||(i=[r])).push(ru(o,e,n,!1))}}return i?WT(i):r}u(lj,"stackIterator");const x4=class x4{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Lt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Lt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return l<0?!1:(this.stack.push(this.index),this.yieldBuf(l))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Ae.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ae.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ae.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let l=n+e,a=e<0?-1:r._tree.children.length;l!=a;l+=e){let o=r._tree.children[l];if(this.mode&Ae.IncludeAnonymous||o instanceof Si||!o.type.isAnonymous||HO(o))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=l+1;break e}i=this.stack[--l]}for(let i=r;i=0;l--){if(l<0)return UO(this._tree,e,i);let a=r[n.buffer[this.stack[l]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}};u(x4,"TreeCursor");let Za=x4;function HO(t){return t.children.some(e=>e instanceof Si||!e.type.isAnonymous||HO(e))}u(HO,"hasChild");function aj(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=ZT,reused:l=[],minRepeatType:a=r.types.length}=t,o=Array.isArray(n)?new KO(n,n.length):n,s=r.types,c=0,d=0;function f(S,x,C,Q,T,B){let{id:w,start:M,end:A,size:E}=o,I=d,D=c;for(;E<0;)if(o.next(),E==-1){let F=l[w];C.push(F),Q.push(M-S);return}else if(E==-3){c=w;return}else if(E==-4){d=w;return}else throw new RangeError(`Unrecognized record size: ${E}`);let P=s[w],R,L,k=M-S;if(A-M<=i&&(L=O(o.pos-x,T))){let F=new Uint16Array(L.size-L.skip),N=o.pos-L.size,z=F.length;for(;o.pos>N;)z=b(L.start,F,z);R=new Si(F,A-L.start,r),k=L.start-S}else{let F=o.pos-E;o.next();let N=[],z=[],G=w>=a?w:-1,le=0,ie=A;for(;o.pos>F;)G>=0&&o.id==G&&o.size>=0?(o.end<=ie-i&&(m(N,z,M,le,o.end,ie,G,I,D),le=N.length,ie=o.end),o.next()):B>2500?h(M,F,N,z):f(M,F,N,z,G,B+1);if(G>=0&&le>0&&le-1&&le>0){let me=p(P,D);R=JO(P,N,z,0,N.length,0,A-M,me,me)}else R=g(P,N,z,A-M,I-A,D)}C.push(R),Q.push(k)}u(f,"takeNode");function h(S,x,C,Q){let T=[],B=0,w=-1;for(;o.pos>x;){let{id:M,start:A,end:E,size:I}=o;if(I>4)o.next();else{if(w>-1&&A=0;E-=3)M[I++]=T[E],M[I++]=T[E+1]-A,M[I++]=T[E+2]-A,M[I++]=I;C.push(new Si(M,T[2]-A,r)),Q.push(A-S)}}u(h,"takeFlatNode");function p(S,x){return(C,Q,T)=>{let B=0,w=C.length-1,M,A;if(w>=0&&(M=C[w])instanceof Le){if(!w&&M.type==S&&M.length==T)return M;(A=M.prop(ue.lookAhead))&&(B=Q[w]+M.length+A)}return g(S,C,Q,T,B,x)}}u(p,"makeBalanced");function m(S,x,C,Q,T,B,w,M,A){let E=[],I=[];for(;S.length>Q;)E.push(S.pop()),I.push(x.pop()+C-T);S.push(g(r.types[w],E,I,B-T,M-B,A)),x.push(T-C)}u(m,"makeRepeatLeaf");function g(S,x,C,Q,T,B,w){if(B){let M=[ue.contextHash,B];w=w?[M].concat(w):[M]}if(T>25){let M=[ue.lookAhead,T];w=w?[M].concat(w):[M]}return new Le(S,x,C,Q,w)}u(g,"makeTree");function O(S,x){let C=o.fork(),Q=0,T=0,B=0,w=C.end-i,M={size:0,start:0,skip:0};e:for(let A=C.pos-S;C.pos>A;){let E=C.size;if(C.id==x&&E>=0){M.size=Q,M.start=T,M.skip=B,B+=4,Q+=4,C.next();continue}let I=C.pos-E;if(E<0||I=a?4:0,P=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3)D+=4;else break e;else C.id>=a&&(D+=4);C.next()}T=P,Q+=E,B+=D}return(x<0||Q==S)&&(M.size=Q,M.start=T,M.skip=B),M.size>4?M:void 0}u(O,"findBufferSize");function b(S,x,C){let{id:Q,start:T,end:B,size:w}=o;if(o.next(),w>=0&&Q4){let A=o.pos-(w-4);for(;o.pos>A;)C=b(S,x,C)}x[--C]=M,x[--C]=B-S,x[--C]=T-S,x[--C]=Q}else w==-3?c=Q:w==-4&&(d=Q);return C}u(b,"copyToBuffer");let y=[],$=[];for(;o.pos>0;)f(t.start||0,t.bufferStart||0,y,$,-1,0);let v=(e=t.length)!==null&&e!==void 0?e:y.length?$[0]+y[0].length:0;return new Le(s[t.topID],y.reverse(),$.reverse(),v)}u(aj,"buildTree$1");const YT=new WeakMap;function Ff(t,e){if(!t.isAnonymous||e instanceof Si||e.type!=t)return 1;let n=YT.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Le)){n=1;break}n+=Ff(t,r)}YT.set(e,n)}return n}u(Ff,"nodeSize$1");function JO(t,e,n,r,i,l,a,o,s){let c=0;for(let m=r;m=d)break;x+=C}if($==v+1){if(x>d){let C=m[v];p(C.children,C.positions,0,C.children.length,g[v]+y);continue}f.push(m[v])}else{let C=g[$-1]+m[$-1].length-S;f.push(JO(t,m,g,v,$,S,C,null,s))}h.push(S+y-l)}}return u(p,"divide"),p(e,n,r,i,0),(o||s)(f,h,a)}u(JO,"balanceRange");const S4=class S4{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof yl?this.setBuffer(e.context.buffer,e.index,n):e instanceof Lt&&this.map.set(e.tree,n)}get(e){return e instanceof yl?this.getBuffer(e.context.buffer,e.index):e instanceof Lt?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}};u(S4,"NodeWeakMap");let If=S4;const mc=class mc{constructor(e,n,r,i,l=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(l?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new mc(0,e.length,e,0,!1,r)];for(let l of n)l.to>e.length&&i.push(l);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],l=1,a=e.length?e[0]:null;for(let o=0,s=0,c=0;;o++){let d=o=r)for(;a&&a.from=h.from||f<=h.to||c){let p=Math.max(h.from,s)-c,m=Math.min(h.to,f)-c;h=p>=m?null:new mc(p,m,h.tree,h.offset+c,o>0,!!d)}if(h&&i.push(h),a.to>f)break;a=lnew It(i.from,i.to)):[new It(0,0)]:[new It(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let l=i.advance();if(l)return l}}};u(C4,"Parser");let Lf=C4;const k4=class k4{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}};u(k4,"StringInput");let eb=k4;function oj(t){return(e,n,r,i)=>new rb(e,t,n,r,i)}u(oj,"parseMixed");const D4=class D4{constructor(e,n,r,i,l){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.from=l}};u(D4,"InnerParse");let zf=D4;function KT(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}u(KT,"checkRanges");const P4=class P4{constructor(e,n,r,i,l,a,o){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=l,this.target=a,this.prev=o,this.depth=0,this.ranges=[]}};u(P4,"ActiveOverlay");let tb=P4;const nb=new ue({perNode:!0}),E4=class E4{constructor(e,n,r,i,l){this.nest=n,this.input=r,this.fragments=i,this.ranges=l,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Le(r.type,r.children,r.positions,r.length,r.propValues.concat([[nb,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[ue.mounted.id]=new bl(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(d=>d.frag.from<=i.from&&d.frag.to>=i.to&&d.mount.overlay);if(c)for(let d of c.mount.overlay){let f=d.from+c.pos,h=d.to+c.pos;f>=i.from&&h<=i.to&&!n.ranges.some(p=>p.fromf)&&n.ranges.push({from:f,to:h})}}o=!1}else if(r&&(a=sj(r.ranges,i.from,i.to)))o=a!=2;else if(!i.type.isAnonymous&&(l=this.nest(i,this.input))&&(i.fromnew It(f.from-i.from,f.to-i.from)):null,i.tree,d.length?d[0].from:i.from)),l.overlay?d.length&&(r={ranges:d,depth:0,prev:r}):o=!1}}else if(n&&(s=n.predicate(i))&&(s===!0&&(s=new It(i.from,i.to)),s.from=0&&n.ranges[c].to==s.from?n.ranges[c]={from:n.ranges[c].from,to:s.to}:n.ranges.push(s)}if(o&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=GT(this.ranges,n.ranges);c.length&&(KT(c),this.inner.splice(n.index,0,new zf(n.parser,n.parser.startParse(this.input,_T(n.mounts,c),c),n.ranges.map(d=>new It(d.from-n.start,d.to-n.start)),n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}};u(E4,"MixedParse");let rb=E4;function sj(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}u(sj,"checkCover");function UT(t,e,n,r,i,l){if(e=e&&n.enter(r,1,Ae.IgnoreOverlays|Ae.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Le)n=n.children[0];else break}return!1}};u(T4,"StructureCursor");let Zf=T4,cj=(gc=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(nb))!==null&&n!==void 0?n:r.to,this.inner=new Zf(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(nb))!==null&&e!==void 0?e:n.to,this.inner=new Zf(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let l=this.inner.cursor.node;l;l=l.parent){let a=(r=l.tree)===null||r===void 0?void 0:r.prop(ue.mounted);if(a&&a.parser==n)for(let o=this.fragI;o=l.to)break;s.tree==this.curFrag.tree&&i.push({frag:s,pos:l.from-s.offset,mount:a})}}}return i}},u(gc,"FragmentCursor"),gc);function GT(t,e){let n=null,r=e;for(let i=1,l=0;i=o)break;s.to<=a||(n||(r=n=e.slice()),s.fromo&&n.splice(l+1,0,new It(o,s.to))):s.to>o?n[l--]=new It(o,s.to):n.splice(l--,1))}}return r}u(GT,"punchRanges");function dj(t,e,n,r){let i=0,l=0,a=!1,o=!1,s=-1e9,c=[];for(;;){let d=i==t.length?1e9:a?t[i].to:t[i].from,f=l==e.length?1e9:o?e[l].to:e[l].from;if(a!=o){let h=Math.max(s,n),p=Math.min(d,f,r);hnew It(h.from+r,h.to+r)),f=dj(e,d,s,c);for(let h=0,p=s;;h++){let m=h==f.length,g=m?c:f[h].from;if(g>p&&n.push(new Ci(p,g,i.tree,-a,l.from>=p||l.openStart,l.to<=g||l.openEnd)),m)break;p=f[h].to}}else n.push(new Ci(s,c,i.tree,-a,l.from>=a||l.openStart,l.to<=o||l.openEnd))}return n}u(_T,"enterFragments");let fj=0;const Oc=class Oc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=fj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Oc&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new Oc(r,[],null,[]);if(i.set.push(i),n)for(let l of n.set)i.set.push(l);return i}static defineModifier(e){let n=new Xf(e);return r=>r.modified.indexOf(n)>-1?r:Xf.get(r.base||r,r.modified.concat(n).sort((i,l)=>i.id-l.id))}};u(Oc,"Tag");let Mn=Oc,hj=0;const Zp=class Zp{constructor(e){this.name=e,this.instances=[],this.id=hj++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(o=>o.base==e&&pj(n,o.modified));if(r)return r;let i=[],l=new Mn(e.name,i,e,n);for(let o of n)o.instances.push(l);let a=mj(n);for(let o of e.set)if(!o.modified.length)for(let s of a)i.push(Zp.get(o,s));return l}};u(Zp,"Modifier");let Xf=Zp;function pj(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}u(pj,"sameArray");function mj(t){let e=[[]];for(let n=0;nr.length-n.length)}u(mj,"powerSet");function jf(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let l=[],a=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!h)throw new RangeError("Invalid path: "+i);if(l.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let p=i[f++];if(f==i.length&&p=="!"){a=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let s=l.length-1,c=l[s];if(!c)throw new RangeError("Invalid path: "+i);let d=new Xa(r,a,s>0?l.slice(0,s):null);e[c]=d.sort(e[c])}}return HT.add(e)}u(jf,"styleTags");const HT=new ue,A4=class A4{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=i;for(let o of l)for(let s of o.set){let c=n[s.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}u(JT,"tagHighlighter");function gj(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}u(gj,"highlightTags");function Oj(t,e,n,r=0,i=t.length){let l=new ib(r,Array.isArray(e)?e:[e],n);l.highlightRange(t.cursor(),r,i,"",l.highlighters),l.flush(i)}u(Oj,"highlightTree");const Q4=class Q4{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,l){let{type:a,from:o,to:s}=e;if(o>=r||s<=n)return;a.isTop&&(l=this.highlighters.filter(p=>!p.scope||p.scope(a)));let c=i,d=bj(e)||Xa.empty,f=gj(l,d.tags);if(f&&(c&&(c+=" "),c+=f,d.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,o),c),d.opaque)return;let h=e.tree&&e.tree.prop(ue.mounted);if(h&&h.overlay){let p=e.node.enter(h.overlay[0].from+o,1),m=this.highlighters.filter(O=>!O.scope||O.scope(h.tree.type)),g=e.firstChild();for(let O=0,b=o;;O++){let y=O=$||!e.nextSibling())););if(!y||$>r)break;b=y.to+o,b>n&&(this.highlightRange(p.cursor(),Math.max(n,y.from+o),Math.min(r,b),"",m),this.startSpan(Math.min(r,b),c))}g&&e.parent()}else if(e.firstChild()){h&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,l),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}};u(Q4,"HighlightBuilder");let ib=Q4;function bj(t){let e=t.type.prop(HT);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}u(bj,"getStyleTags");const Y=Mn.define,qf=Y(),ki=Y(),e7=Y(ki),t7=Y(ki),Di=Y(),Wf=Y(Di),lb=Y(Di),rr=Y(),vl=Y(rr),ir=Y(),lr=Y(),ab=Y(),iu=Y(ab),Yf=Y(),V={comment:qf,lineComment:Y(qf),blockComment:Y(qf),docComment:Y(qf),name:ki,variableName:Y(ki),typeName:e7,tagName:Y(e7),propertyName:t7,attributeName:Y(t7),className:Y(ki),labelName:Y(ki),namespace:Y(ki),macroName:Y(ki),literal:Di,string:Wf,docString:Y(Wf),character:Y(Wf),attributeValue:Y(Wf),number:lb,integer:Y(lb),float:Y(lb),bool:Y(Di),regexp:Y(Di),escape:Y(Di),color:Y(Di),url:Y(Di),keyword:ir,self:Y(ir),null:Y(ir),atom:Y(ir),unit:Y(ir),modifier:Y(ir),operatorKeyword:Y(ir),controlKeyword:Y(ir),definitionKeyword:Y(ir),moduleKeyword:Y(ir),operator:lr,derefOperator:Y(lr),arithmeticOperator:Y(lr),logicOperator:Y(lr),bitwiseOperator:Y(lr),compareOperator:Y(lr),updateOperator:Y(lr),definitionOperator:Y(lr),typeOperator:Y(lr),controlOperator:Y(lr),punctuation:ab,separator:Y(ab),bracket:iu,angleBracket:Y(iu),squareBracket:Y(iu),paren:Y(iu),brace:Y(iu),content:rr,heading:vl,heading1:Y(vl),heading2:Y(vl),heading3:Y(vl),heading4:Y(vl),heading5:Y(vl),heading6:Y(vl),contentSeparator:Y(rr),list:Y(rr),quote:Y(rr),emphasis:Y(rr),strong:Y(rr),link:Y(rr),monospace:Y(rr),strikethrough:Y(rr),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Yf,documentMeta:Y(Yf),annotation:Y(Yf),processingInstruction:Y(Yf),definition:Mn.defineModifier("definition"),constant:Mn.defineModifier("constant"),function:Mn.defineModifier("function"),standard:Mn.defineModifier("standard"),local:Mn.defineModifier("local"),special:Mn.defineModifier("special")};for(let t in V){let e=V[t];e instanceof Mn&&(e.name=t)}JT([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var ob;const ja=new ue;function n7(t){return _.define({combine:t?e=>e.concat(t):void 0})}u(n7,"defineLanguageFacet");const sb=new ue,M4=class M4{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Xe.prototype.hasOwnProperty("tree")||Object.defineProperty(Xe.prototype,"tree",{get(){return ze(this)}}),this.parser=n,this.extension=[Pi.of(this),Xe.languageData.of((l,a,o)=>{let s=r7(l,a,o),c=s.type.prop(ja);if(!c)return[];let d=l.facet(c),f=s.type.prop(sb);if(f){let h=s.resolve(a-s.from,o);for(let p of f)if(p.test(h,l)){let m=l.facet(p.facet);return p.type=="replace"?m:m.concat(d)}}return d})].concat(r)}isActiveAt(e,n,r=-1){return r7(e,n,r).type.prop(ja)==this.data}findRegions(e){let n=e.facet(Pi);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=u((l,a)=>{if(l.prop(ja)==this.data){r.push({from:a,to:a+l.length});return}let o=l.prop(ue.mounted);if(o){if(o.tree.prop(ja)==this.data){if(o.overlay)for(let s of o.overlay)r.push({from:s.from+a,to:s.to+a});else r.push({from:a,to:a+l.length});return}else if(o.overlay){let s=r.length;if(i(o.tree,o.overlay[0].from+a),r.length>s)return}}for(let s=0;sr.isTop?n:void 0)]}),e.name)}configure(e,n){return new bc(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};u(bc,"LRLanguage");let lu=bc;function ze(t){let e=t.field(tn.state,!1);return e?e.tree:Le.empty}u(ze,"syntaxTree");const B4=class B4{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}};u(B4,"DocInput");let ub=B4,au=null,yj=(Wl=class{constructor(e,n,r=[],i,l,a,o,s){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=l,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Wl(e,n,[],Le.empty,0,r,[],null)}startParse(){return this.parser.startParse(new ub(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Le.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=u(()=>Date.now()>i,"until")}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ci.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=au;au=this;try{return e()}finally{au=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=i7(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:l,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let s=[];if(e.iterChangedRanges((c,d,f,h)=>s.push({fromA:c,toA:d,fromB:f,toB:h})),r=Ci.applyChanges(r,s),i=Le.empty,l=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);de.from&&(this.fragments=i7(this.fragments,i,l),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Lf{createParse(n,r,i){let l=i[0].from,a=i[i.length-1].to;return{parsedPos:l,advance(){let s=au;if(s){for(let c of i)s.tempSkipped.push(c);e&&(s.scheduleOn=s.scheduleOn?Promise.all([s.scheduleOn,e]):e)}return this.parsedPos=a,new Le(en.none,[],[],a-l)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return au}},u(Wl,"ParseContext"),Wl);function i7(t,e,n){return Ci.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}u(i7,"cutFragments");const yc=class yc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new yc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=yj.create(e.facet(Pi).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new yc(r)}};u(yc,"LanguageState");let ou=yc;tn.state=Gt.define({create:ou.init,update(t,e){for(let n of e.effects)if(n.is(tn.setState))return n.value;return e.startState.facet(Pi)!=e.state.facet(Pi)?ou.init(e.state):t.apply(e)}});let l7=u(t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)},"requestIdle");typeof requestIdleCallback<"u"&&(l7=u(t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)},"requestIdle"));const cb=typeof navigator<"u"&&(!((ob=navigator.scheduling)===null||ob===void 0)&&ob.isInputPending)?()=>navigator.scheduling.isInputPending():null,vj=it.fromClass((vc=class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(tn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(tn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=l7(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,s=l.context.work(()=>cb&&cb()||Date.now()>a,i+(o?0:1e5));this.chunkBudget-=Date.now()-n,(s||this.chunkBudget<=0)&&(l.context.takeTree(),this.view.dispatch({effects:tn.setState.of(new ou(l.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(l.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ht(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},u(vc,"ParseWorker"),vc),{eventHandlers:{focus(){this.scheduleWork()}}}),Pi=_.define({combine(t){return t.length?t[0]:null},enables:t=>[tn.state,vj,J.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),R4=class R4{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};u(R4,"LanguageSupport");let su=R4;const $j=_.define(),uu=_.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Kf(t){let e=t.facet(uu);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}u(Kf,"getIndentUnit");function cu(t,e){let n="",r=t.tabSize,i=t.facet(uu)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let l=0;l=e?wj(t,n,e):null}u(db,"getIndentation");const V4=class V4{constructor(e,n={}){this.state=e,this.options=n,this.unit=Kf(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:l}=this.options;return i!=null&&i>=r.from&&i<=r.to?l&&i==e?{text:"",from:e}:(n<0?i-1&&(l+=a-this.countColumn(r,r.search(/\S|$/))),l}countColumn(e,n=e.length){return Ra(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),l=this.options.overrideIndentation;if(l){let a=l(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}};u(V4,"IndentContext");let qa=V4;const Uf=new ue;function wj(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let l=[];for(let a=i;a&&!(a.fromr.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)l.push(a);for(let a=l.length-1;a>=0;a--)r={node:l[a],next:r}}return a7(r,t,n)}u(wj,"syntaxIndentation");function a7(t,e,n){for(let r=t;r;r=r.next){let i=Sj(r.node);if(i)return i(fb.create(e,n,r))}return 0}u(a7,"indentFor");function xj(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}u(xj,"ignoreClosed");function Sj(t){let e=t.type.prop(Uf);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(ue.closedBy))){let i=t.lastChild,l=i&&r.indexOf(i.name)>-1;return a=>o7(a,!0,1,void 0,l&&!xj(a)?i.from:void 0)}return t.parent==null?Cj:null}u(Sj,"indentStrategy");function Cj(){return 0}u(Cj,"topIndent");const Xp=class Xp extends qa{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Xp(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(kj(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return a7(this.context.next,this.base,this.pos)}};u(Xp,"TreeIndentContext");let fb=Xp;function kj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}u(kj,"isParent");function Dj(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,l=t.state.doc.lineAt(n.from),a=i==null||i<=l.from?l.to:Math.min(l.to,i);for(let o=n.to;;){let s=e.childAfter(o);if(!s||s==r)return null;if(!s.type.isSkipped){if(s.from>=a)return null;let c=/^ */.exec(l.text.slice(n.to-l.from))[0].length;return{from:n.from,to:n.to+c}}o=s.to}}u(Dj,"bracketedAligned");function Pj({closing:t,align:e=!0,units:n=1}){return r=>o7(r,e,n,t)}u(Pj,"delimitedIndent");function o7(t,e,n,r,i){let l=t.textAfter,a=l.match(/^\s*/)[0].length,o=r&&l.slice(a,a+r.length)==r||i==t.pos+a,s=e?Dj(t):null;return s?o?t.column(s.from):t.column(s.to):t.baseIndent+(o?0:t.unit*n)}u(o7,"delimitedStrategy");const Ej=u(t=>t.baseIndent,"flatIndent");function Gf({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}u(Gf,"continuedIndent");const Tj=200;function Aj(){return Xe.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+Tj)return t;let l=n.sliceString(i.from,r);if(!e.some(c=>c.test(l)))return t;let{state:a}=t,o=-1,s=[];for(let{head:c}of a.selection.ranges){let d=a.doc.lineAt(c);if(d.from==o)continue;o=d.from;let f=db(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],p=cu(a,f);h!=p&&s.push({from:d.from,to:d.from+h.length,insert:p})}return s.length?[t,{changes:s,sequential:!0}]:t})}u(Aj,"indentOnInput");const Qj=_.define(),_f=new ue;function s7(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(l&&o.from=e&&c.to>n&&(l=c)}}return l}u(Mj,"syntaxFolding");function Bj(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}u(Bj,"isUnfinished");function Hf(t,e,n){for(let r of t.facet(Qj)){let i=r(t,e,n);if(i)return i}return Mj(t,e,n)}u(Hf,"foldable");function u7(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}u(u7,"mapRange");const Jf=Oe.define({map:u7}),du=Oe.define({map:u7});function c7(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}u(c7,"selectedLines");const $l=Gt.define({create(){return re.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=d7(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Jf)&&!Rj(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(hb),i=r?re.replace({widget:new pb(r(e.state,n.value))}):g7;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(du)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=d7(t,e.selection.main.head)),t},provide:t=>J.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{ie&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,l)=>i>=n||l<=e}):t}u(d7,"clearTouchedFolds");function eh(t,e,n){var r;let i=null;return(r=t.field($l,!1))===null||r===void 0||r.between(e,n,(l,a)=>{(!i||i.from>l)&&(i={from:l,to:a})}),i}u(eh,"findFold");function Rj(t,e,n){let r=!1;return t.between(e,e,(i,l)=>{i==e&&l==n&&(r=!0)}),r}u(Rj,"foldExists");function f7(t,e){return t.field($l,!1)?e:e.concat(Oe.appendConfig.of(p7()))}u(f7,"maybeEnable");const Vj=u(t=>{for(let e of c7(t)){let n=Hf(t.state,e.from,e.to);if(n)return t.dispatch({effects:f7(t.state,[Jf.of(n),h7(t,n)])}),!0}return!1},"foldCode"),Nj=u(t=>{if(!t.state.field($l,!1))return!1;let e=[];for(let n of c7(t)){let r=eh(t.state,n.from,n.to);r&&e.push(du.of(r),h7(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0},"unfoldCode");function h7(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return J.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}u(h7,"announceFold");const Fj=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Vj},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Nj},{key:"Ctrl-Alt-[",run:u(t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field($l,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(du.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},"unfoldAll")}],Ij={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},hb=_.define({combine(t){return bi(t,Ij)}});function p7(t){let e=[$l,Zj];return t&&e.push(hb.of(t)),e}u(p7,"codeFolding");function m7(t,e){let{state:n}=t,r=n.facet(hb),i=u(a=>{let o=t.lineBlockAt(t.posAtDOM(a.target)),s=eh(t.state,o.from,o.to);s&&t.dispatch({effects:du.of(s)}),a.preventDefault()},"onclick");if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let l=document.createElement("span");return l.textContent=r.placeholderText,l.setAttribute("aria-label",n.phrase("folded code")),l.title=n.phrase("unfold"),l.className="cm-foldPlaceholder",l.onclick=i,l}u(m7,"widgetToDOM");const g7=re.replace({widget:new class extends Hn{toDOM(t){return m7(t,null)}}}),N4=class N4 extends Hn{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return m7(e,this.value)}};u(N4,"PreparedFoldWidget");let pb=N4;const Lj={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},F4=class F4 extends Qn{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}};u(F4,"FoldMarker");let fu=F4;function zj(t={}){let e={...Lj,...t},n=new fu(e,!0),r=new fu(e,!1),i=it.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(Pi)!=a.state.facet(Pi)||a.startState.field($l,!1)!=a.state.field($l,!1)||ze(a.startState)!=ze(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let o=new dl;for(let s of a.viewportLineBlocks){let c=eh(a.state,s.from,s.to)?r:Hf(a.state,s.from,s.to)?n:null;c&&o.add(s.from,s.from,c)}return o.finish()}}),{domEventHandlers:l}=e;return[i,kX({class:"cm-foldGutter",markers(a){var o;return((o=a.plugin(i))===null||o===void 0?void 0:o.markers)||Te.empty},initialSpacer(){return new fu(e,!1)},domEventHandlers:{...l,click:(a,o,s)=>{if(l.click&&l.click(a,o,s))return!0;let c=eh(a.state,o.from,o.to);if(c)return a.dispatch({effects:du.of(c)}),!0;let d=Hf(a.state,o.from,o.to);return d?(a.dispatch({effects:Jf.of(d)}),!0):!1}}}),p7()]}u(zj,"foldGutter");const Zj=J.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),jp=class jp{constructor(e,n){this.specs=e;let r;function i(o){let s=Un.newName();return(r||(r=Object.create(null)))["."+s]=o,s}u(i,"def");const l=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof tn?o=>o.prop(ja)==a.data:a?o=>o==a:void 0,this.style=JT(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:l}).style,this.module=r?new Un(r):null,this.themeType=n.themeType}static define(e,n){return new jp(e,n||{})}};u(jp,"HighlightStyle");let th=jp;const mb=_.define(),O7=_.define({combine(t){return t.length?[t[0]]:null}});function gb(t){let e=t.facet(mb);return e.length?e:t.facet(O7)}u(gb,"getHighlighters");function Xj(t,e){let n=[jj],r;return t instanceof th&&(t.module&&n.push(J.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(O7.of(t)):r?n.push(mb.computeN([J.darkTheme],i=>i.facet(J.darkTheme)==(r=="dark")?[t]:[])):n.push(mb.of(t)),n}u(Xj,"syntaxHighlighting");const I4=class I4{constructor(e){this.markCache=Object.create(null),this.tree=ze(e.state),this.decorations=this.buildDeco(e,gb(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ze(e.state),r=gb(e.state),i=r!=gb(e.startState),{viewport:l}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=l.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=l.to)}buildDeco(e,n){if(!n||!this.tree.length)return re.none;let r=new dl;for(let{from:i,to:l}of e.visibleRanges)Oj(this.tree,n,(a,o,s)=>{r.add(a,o,this.markCache[s]||(this.markCache[s]=re.mark({class:s})))},i,l);return r.finish()}};u(I4,"TreeHighlighter");let Ob=I4;const jj=cl.high(it.fromClass(Ob,{decorations:t=>t.decorations})),qj=th.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),Wj=J.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),b7=1e4,y7="()[]{}",v7=_.define({combine(t){return bi(t,{afterCursor:!0,brackets:y7,maxScanDistance:b7,renderMatch:Uj})}}),Yj=re.mark({class:"cm-matchingBracket"}),Kj=re.mark({class:"cm-nonmatchingBracket"});function Uj(t){let e=[],n=t.matched?Yj:Kj;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}u(Uj,"defaultRenderMatch");const Gj=[Gt.define({create(){return re.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(v7);for(let i of e.state.selection.ranges){if(!i.empty)continue;let l=ar(e.state,i.head,-1,r)||i.head>0&&ar(e.state,i.head-1,1,r)||r.afterCursor&&(ar(e.state,i.head,1,r)||i.headJ.decorations.from(t)}),Wj];function _j(t={}){return[v7.of(t),Gj]}u(_j,"bracketMatching");const $7=new ue;function bb(t,e,n){let r=t.prop(e<0?ue.openedBy:ue.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}u(bb,"matchingNodes");function yb(t){let e=t.type.prop($7);return e?e(t.node):t}u(yb,"findHandle");function ar(t,e,n,r={}){let i=r.maxScanDistance||b7,l=r.brackets||y7,a=ze(t),o=a.resolveInner(e,n);for(let s=o;s;s=s.parent){let c=bb(s.type,n,l);if(c&&s.from0?e>=d.from&&ed.from&&e<=d.to))return Hj(t,e,n,s,d,c,l)}}return Jj(t,e,n,a,o.type,i,l)}u(ar,"matchBrackets");function Hj(t,e,n,r,i,l,a){let o=r.parent,s={from:i.from,to:i.to},c=0,d=o?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(c==0&&l.indexOf(d.type.name)>-1&&d.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=l;){let p=d.value;n<0&&(h+=p.length);let m=e+h*n;for(let g=n>0?0:p.length-1,O=n>0?p.length:-1;g!=O;g+=n){let b=a.indexOf(p[g]);if(!(b<0||r.resolveInner(m+g,1).type!=i))if(b%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:m+g,to:m+g+1},matched:b>>1==s>>1};f--}}n>0&&(h+=p.length)}return d.done?{start:c,matched:!1}:null}u(Jj,"matchPlainBrackets");const eq=Object.create(null),w7=[en.none],x7=[],S7=Object.create(null),tq=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])tq[t]=nq(eq,e);function vb(t,e){x7.indexOf(t)>-1||(x7.push(t),console.warn(e))}u(vb,"warnForPart");function nq(t,e){let n=[];for(let o of e.split(" ")){let s=[];for(let c of o.split(".")){let d=t[c]||V[c];d?typeof d=="function"?s.length?s=s.map(d):vb(c,`Modifier ${c} used at start of tag`):s.length?vb(c,`Tag ${c} used as modifier`):s=Array.isArray(d)?d:[d]:vb(c,`Unknown highlighting tag ${c}`)}for(let c of s)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(o=>o.id),l=S7[i];if(l)return l.id;let a=S7[i]=en.define({id:w7.length,name:r,props:[jf({[r]:n})]});return w7.push(a),a.id}u(nq,"createTokenType"),Ve.RTL,Ve.LTR;const rq=u(t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=wb(t.state,n.from);return r.line?iq(t):r.block?aq(t):!1},"toggleComment");function $b(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}u($b,"command");const iq=$b(uq,0),lq=$b(C7,0),aq=$b((t,e)=>C7(t,e,sq(e)),0);function wb(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}u(wb,"getConfig");const hu=50;function oq(t,{open:e,close:n},r,i){let l=t.sliceDoc(r-hu,r),a=t.sliceDoc(i,i+hu),o=/\s*$/.exec(l)[0].length,s=/^\s*/.exec(a)[0].length,c=l.length-o;if(l.slice(c-e.length,c)==e&&a.slice(s,s+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:i+s,margin:s&&1}};let d,f;i-r<=2*hu?d=f=t.sliceDoc(r,i):(d=t.sliceDoc(r,r+hu),f=t.sliceDoc(i-hu,i));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-n.length;return d.slice(h,h+e.length)==e&&f.slice(m,m+n.length)==n?{open:{pos:r+h+e.length,margin:/\s/.test(d.charAt(h+e.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}u(oq,"findBlockComment");function sq(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let l=e.length-1;l>=0&&e[l].to>r.from?e[l].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}u(sq,"selectedLineRanges");function C7(t,e,n=e.selection.ranges){let r=n.map(l=>wb(e,l.from).block);if(!r.every(l=>l))return null;let i=n.map((l,a)=>oq(e,r[a],l.from,l.to));if(t!=2&&!i.every(l=>l))return{changes:e.changes(n.map((l,a)=>i[a]?[]:[{from:l.from,insert:r[a].open+" "},{from:l.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(l=>l)){let l=[];for(let a=0,o;ai&&(l==a||a>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+c.length)==c?h:-1;hl.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:o,token:s,indent:c,empty:d,single:f}of r)(f||!d)&&l.push({from:o.from+c,insert:s+" "});let a=e.changes(l);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(l=>l.comment>=0)){let l=[];for(let{line:a,comment:o,token:s}of r)if(o>=0){let c=a.from+o,d=c+s.length;a.text[d-a.from]==" "&&d++,l.push({from:c,to:d})}return{changes:l}}return null}u(uq,"changeLineComment");const xb=Tn.define(),cq=Tn.define(),dq=_.define(),k7=_.define({combine(t){return bi(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),D7=Gt.define({create(){return pu.empty},update(t,e){let n=e.state.facet(k7),r=e.annotation(xb);if(r){let s=Bn.fromTransaction(e,r.selection),c=r.side,d=c==0?t.undone:t.done;return s?d=rh(d,d.length,n.minDepth,s):d=T7(d,e.startState.selection),new pu(c==0?r.rest:d,c==0?d:r.rest)}let i=e.annotation(cq);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(xt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let l=Bn.fromTransaction(e),a=e.annotation(xt.time),o=e.annotation(xt.userEvent);return l?t=t.addChanges(l,a,o,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,o,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new pu(t.done.map(Bn.fromJSON),t.undone.map(Bn.fromJSON))}});function fq(t={}){return[D7,k7.of(t),J.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?P7:e.inputType=="historyRedo"?Sb:null;return r?(e.preventDefault(),r(n)):!1}})]}u(fq,"history$1");function nh(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(D7,!1);if(!i)return!1;let l=i.pop(t,n,e);return l?(r(l),!0):!1}}u(nh,"cmd");const P7=nh(0,!1),Sb=nh(1,!1),hq=nh(0,!0),pq=nh(1,!0),Yl=class Yl{constructor(e,n,r,i,l){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=l}setSelAfter(e){return new Yl(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Yl(e.changes&&Ut.fromJSON(e.changes),[],e.mapped&&gi.fromJSON(e.mapped),e.startSelection&&X.fromJSON(e.startSelection),e.selectionsAfter.map(X.fromJSON))}static fromTransaction(e,n){let r=vn;for(let i of e.startState.facet(dq)){let l=i(e);l.length&&(r=r.concat(l))}return!r.length&&e.changes.empty?null:new Yl(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,vn)}static selection(e){return new Yl(void 0,vn,void 0,void 0,e)}};u(Yl,"HistEvent");let Bn=Yl;function rh(t,e,n,r){let i=e+1>n+20?e-n-1:0,l=t.slice(i,e);return l.push(r),l}u(rh,"updateBranch");function mq(t,e){let n=[],r=!1;return t.iterChangedRanges((i,l)=>n.push(i,l)),e.iterChangedRanges((i,l,a,o)=>{for(let s=0;s=c&&a<=d&&(r=!0)}}),r}u(mq,"isAdjacent");function gq(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}u(gq,"eqSelectionShape");function E7(t,e){return t.length?e.length?t.concat(e):t:e}u(E7,"conc");const vn=[],Oq=200;function T7(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Oq));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),rh(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Bn.selection([e])]}u(T7,"addSelection");function bq(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}u(bq,"popSelection");function Cb(t,e){if(!t.length)return t;let n=t.length,r=vn;for(;n;){let i=yq(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let l=t.slice(0,n);return l[n-1]=i,l}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Bn.selection(r)]:vn}u(Cb,"addMappingToBranch");function yq(t,e,n){let r=E7(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):vn,n);if(!t.changes)return Bn.selection(r);let i=t.changes.map(e),l=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(l):l;return new Bn(i,Oe.mapEffects(t.effects,e),a,t.startSelection.map(l),r)}u(yq,"mapEvent");const vq=/^(input\.type|delete)($|\.)/;let pu=(ei=class{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new ei(this.done,this.undone):this}addChanges(e,n,r,i,l){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||vq.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):ih(n,e))}u(A7,"cursorByChar");function ht(t){return t.textDirectionAt(t.state.selection.main.head)==Ve.LTR}u(ht,"ltrAtCursor");const Q7=u(t=>A7(t,!ht(t)),"cursorCharLeft"),M7=u(t=>A7(t,ht(t)),"cursorCharRight");function B7(t,e){return Vn(t,n=>n.empty?t.moveByGroup(n,e):ih(n,e))}u(B7,"cursorByGroup");const wq=u(t=>B7(t,!ht(t)),"cursorGroupLeft"),xq=u(t=>B7(t,ht(t)),"cursorGroupRight");function Sq(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}u(Sq,"interestingNode");function lh(t,e,n){let r=ze(t).resolveInner(e.head),i=n?ue.closedBy:ue.openedBy;for(let s=e.head;;){let c=n?r.childAfter(s):r.childBefore(s);if(!c)break;Sq(t,c,i)?r=c:s=n?c.to:c.from}let l=r.type.prop(i),a,o;return l&&(a=n?ar(t,r.from,1):ar(t,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,X.cursor(o,n?-1:1)}u(lh,"moveBySyntax");const Cq=u(t=>Vn(t,e=>lh(t.state,e,!ht(t))),"cursorSyntaxLeft"),kq=u(t=>Vn(t,e=>lh(t.state,e,ht(t))),"cursorSyntaxRight");function R7(t,e){return Vn(t,n=>{if(!n.empty)return ih(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}u(R7,"cursorByLine");const V7=u(t=>R7(t,!1),"cursorLineUp"),N7=u(t=>R7(t,!0),"cursorLineDown");function F7(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):ih(a,e));if(i.eq(r.selection))return!1;let l;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;a&&a.top>s&&a.bottomI7(t,!1),"cursorPageUp"),kb=u(t=>I7(t,!0),"cursorPageDown");function Ei(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let l=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;l&&e.head!=r.from+l&&(i=X.cursor(r.from+l))}return i}u(Ei,"moveByLineBoundary");const Dq=u(t=>Vn(t,e=>Ei(t,e,!0)),"cursorLineBoundaryForward"),Pq=u(t=>Vn(t,e=>Ei(t,e,!1)),"cursorLineBoundaryBackward"),Eq=u(t=>Vn(t,e=>Ei(t,e,!ht(t))),"cursorLineBoundaryLeft"),Tq=u(t=>Vn(t,e=>Ei(t,e,ht(t))),"cursorLineBoundaryRight"),Aq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).from,1)),"cursorLineStart"),Qq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).to,-1)),"cursorLineEnd");function Mq(t,e,n){let r=!1,i=Wa(t.selection,l=>{let a=ar(t,l.head,-1)||ar(t,l.head,1)||l.head>0&&ar(t,l.head-1,1)||l.headMq(t,e,!1),"cursorMatchingBracket");function $n(t,e){let n=Wa(t.state.selection,r=>{let i=e(r);return X.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Rn(t.state,n)),!0)}u($n,"extendSel");function z7(t,e){return $n(t,n=>t.moveByChar(n,e))}u(z7,"selectByChar");const Z7=u(t=>z7(t,!ht(t)),"selectCharLeft"),X7=u(t=>z7(t,ht(t)),"selectCharRight");function j7(t,e){return $n(t,n=>t.moveByGroup(n,e))}u(j7,"selectByGroup");const Rq=u(t=>j7(t,!ht(t)),"selectGroupLeft"),Vq=u(t=>j7(t,ht(t)),"selectGroupRight"),Nq=u(t=>$n(t,e=>lh(t.state,e,!ht(t))),"selectSyntaxLeft"),Fq=u(t=>$n(t,e=>lh(t.state,e,ht(t))),"selectSyntaxRight");function q7(t,e){return $n(t,n=>t.moveVertically(n,e))}u(q7,"selectByLine");const W7=u(t=>q7(t,!1),"selectLineUp"),Y7=u(t=>q7(t,!0),"selectLineDown");function K7(t,e){return $n(t,n=>t.moveVertically(n,e,F7(t).height))}u(K7,"selectByPage");const U7=u(t=>K7(t,!1),"selectPageUp"),G7=u(t=>K7(t,!0),"selectPageDown"),Iq=u(t=>$n(t,e=>Ei(t,e,!0)),"selectLineBoundaryForward"),Lq=u(t=>$n(t,e=>Ei(t,e,!1)),"selectLineBoundaryBackward"),zq=u(t=>$n(t,e=>Ei(t,e,!ht(t))),"selectLineBoundaryLeft"),Zq=u(t=>$n(t,e=>Ei(t,e,ht(t))),"selectLineBoundaryRight"),Xq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).from)),"selectLineStart"),jq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).to)),"selectLineEnd"),_7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:0})),!0),"cursorDocStart"),H7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.doc.length})),!0),"cursorDocEnd"),J7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:0})),!0),"selectDocStart"),eA=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),"selectDocEnd"),qq=u(({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),"selectAll$1"),Wq=u(({state:t,dispatch:e})=>{let n=oh(t).map(({from:r,to:i})=>X.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:X.create(n),userEvent:"select"})),!0},"selectLine"),Yq=u(({state:t,dispatch:e})=>{let n=Wa(t.selection,r=>{let i=ze(t),l=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=l.node.from&&a.node.to<=l.node.to&&(l=a)}for(let a=l;a;a=a.next){let{node:o}=a;if((o.from=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return X.range(o.to,o.from)}return r});return n.eq(t.selection)?!1:(e(Rn(t,n)),!0)},"selectParentSyntax");function tA(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let l of n.selection.ranges){let a=n.doc.lineAt(l.head);if(e?a.to0)for(let o=l;;){let s=t.moveVertically(o,e);if(s.heada.to){i.some(c=>c.head==s.head)||i.push(s);break}else{if(s.head==o.head)break;o=s}}}return i.length==r.ranges.length?!1:(t.dispatch(Rn(n,X.create(i,i.length-1))),!0)}u(tA,"addCursorVertically");const Kq=u(t=>tA(t,!1),"addCursorAbove"),Uq=u(t=>tA(t,!0),"addCursorBelow"),Gq=u(({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=X.create([n.main]):n.main.empty||(r=X.create([X.cursor(n.main.head)])),r?(e(Rn(t,r)),!0):!1},"simplifySelection");function mu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(l=>{let{from:a,to:o}=l;if(a==o){let s=e(l);sa&&(n="delete.forward",s=ah(t,s,!0)),a=Math.min(a,s),o=Math.max(o,s)}else a=ah(t,a,!1),o=ah(t,o,!0);return a==o?{range:l}:{changes:{from:a,to:o},range:X.cursor(a,ai(t)))r.between(e,e,(i,l)=>{ie&&(e=n?l:i)});return e}u(ah,"skipAtomic");const nA=u((t,e,n)=>mu(t,r=>{let i=r.from,{state:l}=t,a=l.doc.lineAt(i),o,s;if(n&&!e&&i>a.from&&inA(t,!1,!0),"deleteCharBackward"),rA=u(t=>nA(t,!0,!1),"deleteCharForward"),iA=u((t,e)=>mu(t,n=>{let r=n.head,{state:i}=t,l=i.doc.lineAt(r),a=i.charCategorizer(r);for(let o=null;;){if(r==(e?l.to:l.from)){r==n.head&&l.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let s=wt(l.text,r-l.from,e)+l.from,c=l.text.slice(Math.min(r,s)-l.from,Math.max(r,s)-l.from),d=a(c);if(o!=null&&d!=o)break;(c!=" "||r!=n.head)&&(o=d),r=s}return r}),"deleteByGroup"),lA=u(t=>iA(t,!1),"deleteGroupBackward"),_q=u(t=>iA(t,!0),"deleteGroupForward"),Hq=u(t=>mu(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headmu(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),"deleteLineBoundaryBackward"),eW=u(t=>mu(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:pe.of(["",""])},range:X.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},"splitLine"),nW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,l=t.doc.lineAt(i),a=i==l.from?i-1:wt(l.text,i-l.from,!1)+l.from,o=i==l.to?i+1:wt(l.text,i-l.from,!0)+l.from;return{changes:{from:a,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(a,i))},range:X.cursor(o)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)},"transposeChars");function oh(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),l=t.doc.lineAt(r.to);if(!r.empty&&r.to==l.from&&(l=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=l.to,a.ranges.push(r)}else e.push({from:i.from,to:l.to,ranges:[r]});n=l.number+1}return e}u(oh,"selectedLineBlocks");function aA(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let l of oh(t)){if(n?l.to==t.doc.length:l.from==0)continue;let a=t.doc.lineAt(n?l.to+1:l.from-1),o=a.length+1;if(n){r.push({from:l.to,to:a.to},{from:l.from,insert:a.text+t.lineBreak});for(let s of l.ranges)i.push(X.range(Math.min(t.doc.length,s.anchor+o),Math.min(t.doc.length,s.head+o)))}else{r.push({from:a.from,to:l.from},{from:l.to,insert:t.lineBreak+a.text});for(let s of l.ranges)i.push(X.range(s.anchor-o,s.head-o))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:X.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}u(aA,"moveLine");const rW=u(({state:t,dispatch:e})=>aA(t,e,!1),"moveLineUp"),iW=u(({state:t,dispatch:e})=>aA(t,e,!0),"moveLineDown");function oA(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of oh(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}u(oA,"copyLine");const lW=u(({state:t,dispatch:e})=>oA(t,e,!1),"copyLineUp"),aW=u(({state:t,dispatch:e})=>oA(t,e,!0),"copyLineDown"),oW=u(t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(oh(e).map(({from:i,to:l})=>(i>0?i--:l{let l;if(t.lineWrapping){let a=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(l=a.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,l)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},"deleteLine");function sW(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ze(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),l;return r&&i&&r.to<=e&&i.from>=e&&(l=r.type.prop(ue.closedBy))&&l.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}u(sW,"isBetweenBrackets");const sA=uA(!1),uW=uA(!0);function uA(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:l,to:a}=i,o=e.doc.lineAt(l),s=!t&&l==a&&sW(e,l);t&&(l=a=(a<=o.to?o:e.doc.lineAt(a)).to);let c=new qa(e,{simulateBreak:l,simulateDoubleBreak:!!s}),d=db(c,l);for(d==null&&(d=Ra(/^\s*/.exec(e.doc.lineAt(l).text)[0],e.tabSize));ao.from&&l{let i=[];for(let a=r.from;a<=r.to;){let o=t.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(e(o,i,r),n=o.number),a=o.to+1}let l=t.changes(i);return{changes:i,range:X.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}u(Pb,"changeBySelectedLine");const cW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new qa(t,{overrideIndentation:l=>{let a=n[l];return a??-1}}),i=Pb(t,(l,a,o)=>{let s=db(r,l.from);if(s==null)return;/\S/.test(l.text)||(s=0);let c=/^\s*/.exec(l.text)[0],d=cu(t,s);(c!=d||o.fromt.readOnly?!1:(e(t.update(Pb(t,(n,r)=>{r.push({from:n.from,insert:t.facet(uu)})}),{userEvent:"input.indent"})),!0),"indentMore"),dA=u(({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Pb(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let l=Ra(i,t.tabSize),a=0,o=cu(t,Math.max(0,l-Kf(t)));for(;a(t.setTabFocusMode(),!0),"toggleTabFocusMode"),fW=[{key:"Ctrl-b",run:Q7,shift:Z7,preventDefault:!0},{key:"Ctrl-f",run:M7,shift:X7},{key:"Ctrl-p",run:V7,shift:W7},{key:"Ctrl-n",run:N7,shift:Y7},{key:"Ctrl-a",run:Aq,shift:Xq},{key:"Ctrl-e",run:Qq,shift:jq},{key:"Ctrl-d",run:rA},{key:"Ctrl-h",run:Db},{key:"Ctrl-k",run:Hq},{key:"Ctrl-Alt-h",run:lA},{key:"Ctrl-o",run:tW},{key:"Ctrl-t",run:nW},{key:"Ctrl-v",run:kb}],hW=[{key:"ArrowLeft",run:Q7,shift:Z7,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:wq,shift:Rq,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Eq,shift:zq,preventDefault:!0},{key:"ArrowRight",run:M7,shift:X7,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xq,shift:Vq,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Tq,shift:Zq,preventDefault:!0},{key:"ArrowUp",run:V7,shift:W7,preventDefault:!0},{mac:"Cmd-ArrowUp",run:_7,shift:J7},{mac:"Ctrl-ArrowUp",run:L7,shift:U7},{key:"ArrowDown",run:N7,shift:Y7,preventDefault:!0},{mac:"Cmd-ArrowDown",run:H7,shift:eA},{mac:"Ctrl-ArrowDown",run:kb,shift:G7},{key:"PageUp",run:L7,shift:U7},{key:"PageDown",run:kb,shift:G7},{key:"Home",run:Pq,shift:Lq,preventDefault:!0},{key:"Mod-Home",run:_7,shift:J7},{key:"End",run:Dq,shift:Iq,preventDefault:!0},{key:"Mod-End",run:H7,shift:eA},{key:"Enter",run:sA,shift:sA},{key:"Mod-a",run:qq},{key:"Backspace",run:Db,shift:Db,preventDefault:!0},{key:"Delete",run:rA,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lA,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:_q,preventDefault:!0},{mac:"Mod-Backspace",run:Jq,preventDefault:!0},{mac:"Mod-Delete",run:eW,preventDefault:!0}].concat(fW.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),pW=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Cq,shift:Nq},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:kq,shift:Fq},{key:"Alt-ArrowUp",run:rW},{key:"Shift-Alt-ArrowUp",run:lW},{key:"Alt-ArrowDown",run:iW},{key:"Shift-Alt-ArrowDown",run:aW},{key:"Mod-Alt-ArrowUp",run:Kq},{key:"Mod-Alt-ArrowDown",run:Uq},{key:"Escape",run:Gq},{key:"Mod-Enter",run:uW},{key:"Alt-l",mac:"Ctrl-l",run:Wq},{key:"Mod-i",run:Yq,preventDefault:!0},{key:"Mod-[",run:dA},{key:"Mod-]",run:cA},{key:"Mod-Alt-\\",run:cW},{key:"Shift-Mod-k",run:oW},{key:"Shift-Mod-\\",run:Bq},{key:"Mod-/",run:rq},{key:"Alt-A",run:lq},{key:"Ctrl-m",mac:"Shift-Alt-m",run:dW}].concat(hW),mW={key:"Tab",run:cA,shift:dA},L4=class L4{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ze(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),l=i.search(pA(e,!1));return l<0?null:{from:r+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}};u(L4,"CompletionContext");let sh=L4;function fA(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}u(fA,"toSet");function gW(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:gW(e);return i=>{let l=i.matchBefore(r);return l||i.explicit?{from:l?l.from:i.pos,options:e,validFor:n}:null}}u(hA,"completeFromList");function OW(t,e){return n=>{for(let r=ze(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}u(OW,"ifNotIn");const z4=class z4{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}};u(z4,"Option");let uh=z4;function wl(t){return t.selection.main.from}u(wl,"cur");function pA(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",l=r[r.length-1]!="$";return!i&&!l?t:new RegExp(`${i?"^":""}(?:${r})${l?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}u(pA,"ensureAnchor");const Eb=Tn.define();function bW(t,e,n,r){let{main:i}=t.selection,l=n-i.from,a=r-i.from;return{...t.changeByRange(o=>{if(o!=i&&n!=r&&t.sliceDoc(o.from+l,o.from+a)!=t.sliceDoc(n,r))return{range:o};let s=t.toText(e);return{changes:{from:o.from+l,to:r==i.from?o.to:o.from+a,insert:s},range:X.cursor(o.from+l+s.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}u(bW,"insertCompletionText");const mA=new WeakMap;function yW(t){if(!Array.isArray(t))return t;let e=mA.get(t);return e||mA.set(t,e=hA(t)),e}u(yW,"asSource");const ch=Oe.define(),gu=Oe.define(),Z4=class Z4{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(x=S0(S))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!y||C==1&&O||v==0&&C!=0)&&(n[f]==S||r[f]==S&&(h=!0)?a[f++]=y:a.length&&(b=!1)),v=C,y+=Kn(S)}return f==s&&a[0]==0&&b?this.result(-100+(h?-200:0),a,e):p==s&&m==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):p==s?this.ret(-900-e.length,[m,g]):f==s?this.result(-100+(h?-200:0)+-700+(b?0:-1100),a,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],l=0;for(let a of n){let o=a+(this.astral?Kn(Ft(r,a)):1);l&&i[l-1]==a?i[l-1]=o:(i[l++]=a,i[l++]=o)}return this.ret(e-r.length,i)}};u(Z4,"FuzzyMatcher");let Tb=Z4;const X4=class X4{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:vW,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>gA(e(r),n(r)),optionClass:(e,n)=>r=>gA(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function gA(t,e){return t?e?t+" "+e:t:e}u(gA,"joinClass");function vW(t,e,n,r,i,l){let a=t.textDirection==Ve.RTL,o=a,s=!1,c="top",d,f,h=e.left-i.left,p=i.right-e.right,m=r.right-r.left,g=r.bottom-r.top;if(o&&h=g||y>e.top?d=n.bottom-e.top:(c="bottom",d=e.bottom-n.top)}let O=(e.bottom-e.top)/l.offsetHeight,b=(e.right-e.left)/l.offsetWidth;return{style:`${c}: ${d/O}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(s?a?"left-narrow":"right-narrow":o?"left":"right")}}u(vW,"defaultPositionInfo");function $W(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,l){let a=document.createElement("span");a.className="cm-completionLabel";let o=n.displayLabel||n.label,s=0;for(let c=0;cs&&a.appendChild(document.createTextNode(o.slice(s,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(o.slice(d,f))),h.className="cm-completionMatchedText",s=f}return sn.position-r.position).map(n=>n.render)}u($W,"optionContent");function Qb(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}u(Qb,"rangeAroundSelected");const j4=class j4{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:s=>this.placeInfo(s),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:l,selected:a}=i.open,o=e.state.facet(He);this.optionContent=$W(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Qb(l.length,a,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",s=>{let{options:c}=e.state.field(n).open;for(let d=s.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(He).closeOnBlur&&s.relatedTarget!=e.contentDOM&&e.dispatch({effects:gu.of(null)})}),this.showOptions(l,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:l,selected:a,disabled:o}=r.open;(!i.open||i.open.options!=l)&&(this.range=Qb(l.length,a,e.state.facet(He).maxRenderedOptions),this.showOptions(l,r.id)),this.updateSel(),o!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=Qb(n.options.length,n.selected,this.view.state.facet(He).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let l=typeof i=="string"?document.createTextNode(i):i(r);if(!l)return;"then"in l?l.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>Ht(this.view.state,a,"completion info")):this.addInfoPane(l,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:l}=e;r.appendChild(i),this.infoDestroy=l||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&xW(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),l=this.space;if(!l){let a=this.dom.ownerDocument.documentElement;l={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return i.top>Math.min(l.bottom,n.bottom)-10||i.bottom{a.target==i&&a.preventDefault()});let l=null;for(let a=r.from;ar.from||r.from==0))if(l=h,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=h}}const d=i.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(o);f&&(d.className=f);for(let h of this.optionContent){let p=h(o,this.view.state,this.view,s);p&&d.appendChild(p)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew Mb(n,t,e)}u(wW,"completionTooltip");function xW(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}u(xW,"scrollIntoView");function OA(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}u(OA,"score");function SW(t,e){let n=[],r=null,i=null,l=u(d=>{n.push(d);let{section:f}=d.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(p=>p.name==h)||r.push(typeof f=="string"?{name:h}:f)}},"addOption"),a=e.facet(He);for(let d of t)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)l(new uh(h,d.source,f?f(h):[],1e9-n.length));else{let h=e.sliceDoc(d.from,d.to),p,m=a.filterStrict?new Ab(h):new Tb(h);for(let g of d.result.options)if(p=m.match(g.label)){let O=g.displayLabel?f?f(g,p.matched):[]:p.matched,b=p.score+(g.boost||0);if(l(new uh(g,d.source,O,b)),typeof g.section=="object"&&g.section.rank==="dynamic"){let{name:y}=g.section;i||(i=Object.create(null)),i[y]=Math.max(b,i[y]||-1e9)}}}}if(r){let d=Object.create(null),f=0,h=u((p,m)=>(p.rank==="dynamic"&&m.rank==="dynamic"?i[m.name]-i[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(p.nameh.score-f.score||c(f.completion,h.completion))){let f=d.completion;!s||s.label!=f.label||s.detail!=f.detail||s.type!=null&&f.type!=null&&s.type!=f.type||s.apply!=f.apply||s.boost!=f.boost?o.push(d):OA(d.completion)>OA(s)&&(o[o.length-1]=d),s=d.completion}return o}u(SW,"sortOptions");const Kl=class Kl{constructor(e,n,r,i,l,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=l,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Kl(this.options,bA(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,l,a){if(i&&!a&&e.some(c=>c.isPending))return i.setDisabled();let o=SW(e,n);if(!o.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let s=n.facet(He).selectOnOpen?0:-1;if(i&&i.selected!=s&&i.selected!=-1){let c=i.options[i.selected].completion;for(let d=0;dd.hasResult()?Math.min(c,d.from):c,1e8),create:TW,above:l.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new Kl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Kl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}};u(Kl,"CompletionDialog");let Bb=Kl;const $c=class $c{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new $c(PW,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(He),l=(r.override||n.languageDataAt("autocomplete",wl(n)).map(yW)).map(s=>(this.active.find(d=>d.source==s)||new Lr(s,this.active.some(d=>d.state!=0)?1:0)).update(e,r));l.length==this.active.length&&l.every((s,c)=>s==this.active[c])&&(l=this.active);let a=this.open,o=e.effects.some(s=>s.is(Vb));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||l.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!CW(l,this.active)||o?a=Bb.build(l,n,this.id,a,r,o):a&&a.disabled&&!l.some(s=>s.isPending)&&(a=null),!a&&l.every(s=>!s.isPending)&&l.some(s=>s.hasResult())&&(l=l.map(s=>s.hasResult()?new Lr(s.source,0):s));for(let s of e.effects)s.is(vA)&&(a=a&&a.setSelected(s.value,this.id));return l==this.active&&a==this.open?this:new $c(l,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?kW:DW}};u($c,"CompletionState");let Rb=$c;function CW(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}u(bA,"makeAttrs");const PW=[];function yA(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Eb);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}u(yA,"getUpdateType");const Ul=class Ul{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=yA(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new Ul(i.source,0)),r&4&&i.state==0&&(i=new Ul(this.source,1)),i=i.updateFor(e,r);for(let l of e.effects)if(l.is(ch))i=new Ul(i.source,1,l.value);else if(l.is(gu))i=new Ul(i.source,0);else if(l.is(Vb))for(let a of l.value)a.source==i.source&&(i=a);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(wl(e.state))}};u(Ul,"ActiveSource");let Lr=Ul;const To=class To extends Lr{constructor(e,n,r,i,l,a){super(e,3,n),this.limit=r,this.result=i,this.from=l,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let l=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),o=wl(e.state);if(o>a||!i||n&2&&(wl(e.startState)==this.from||on.map(e))}}),vA=Oe.define(),zt=Gt.define({create(){return Rb.start()},update(t,e){return t.update(e)},provide:t=>[TT.from(t,e=>e.tooltip),J.contentAttributes.from(t,e=>e.attrs)]});function Nb(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(zt).active.find(i=>i.source==e.source);return r instanceof dh?(typeof n=="string"?t.dispatch({...bW(t.state,n,r.from,r.to),annotations:Eb.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}u(Nb,"applyCompletion");const TW=wW(zt,Nb);function fh(t,e="option"){return n=>{let r=n.state.field(zt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:a-1;return o<0?o=e=="page"?0:a-1:o>=a&&(o=e=="page"?a-1:0),n.dispatch({effects:vA.of(o)}),!0}}u(fh,"moveCompletionSelection");const AW=u(t=>{let e=t.state.field(zt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(zt,!1)?(t.dispatch({effects:ch.of(!0)}),!0):!1,"startCompletion"),QW=u(t=>{let e=t.state.field(zt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:gu.of(null)}),!0)},"closeCompletion"),q4=class q4{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}};u(q4,"RunningQuery");let Ib=q4;const MW=50,BW=1e3,RW=it.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(zt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(zt),n=t.state.facet(He);if(!t.selectionSet&&!t.docChanged&&t.startState.field(zt)==e)return;let r=t.transactions.some(l=>{let a=yA(l,n);return a&8||(l.selection||l.docChanged)&&!(a&3)});for(let l=0;lMW&&Date.now()-a.time>BW){for(let o of a.context.abortListeners)try{o()}catch(s){Ht(this.view.state,s)}a.context.abortListeners=null,this.running.splice(l--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(l=>l.effects.some(a=>a.is(ch)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(l=>l.isPending&&!this.running.some(a=>a.active.source==l.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let l of t.transactions)l.isUserEvent("input.type")?this.composing=2:this.composing==2&&l.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(zt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=wl(e),r=new sh(e,n,t.explicit,this.view),i=new Ib(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(l=>{i.context.aborted||(i.done=l||null,this.scheduleAccept())},l=>{this.view.dispatch({effects:gu.of(null)}),Ht(this.view.state,l)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(He),r=this.view.state.field(zt);for(let i=0;io.source==l.active.source);if(a&&a.isPending)if(l.done==null){let o=new Lr(l.active.source,0);for(let s of l.updates)o=o.update(s,n);o.isPending||e.push(o)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Vb.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(zt,!1);if(e&&e.tooltip&&this.view.state.facet(He).closeOnBlur){let n=e.open&&AT(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:gu.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ch.of(!1)}),20),this.composing=0}}}),VW=typeof navigator=="object"&&/Win/.test(navigator.platform),NW=cl.highest(J.domEventHandlers({keydown(t,e){let n=e.state.field(zt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(VW&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),l=r.completion.commitCharacters||i.result.commitCharacters;return l&&l.indexOf(t.key)>-1&&Nb(e,r),!1}})),$A=J.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),W4=class W4{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}};u(W4,"FieldPos");let Lb=W4;const qp=class qp{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,ct.TrackDel),r=e.mapPos(this.to,1,ct.TrackDel);return n==null||r==null?null:new qp(this.field,n,r)}};u(qp,"FieldRange");let zb=qp;const Wp=class Wp{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],l=e.doc.lineAt(n),a=/^\s*/.exec(l.text)[0];for(let s of this.lines){if(r.length){let c=a,d=/^\t*/.exec(s)[0].length;for(let f=0;fnew zb(s.field,i[s.line]+s.from,i[s.line]+s.to));return{text:r,ranges:o}}static parse(e){let n=[],r=[],i=[],l;for(let a of e.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=l[1]?+l[1]:null,s=l[2]||l[3]||"",c=-1,d=s.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&h.field++}for(let f of i)if(f.line==r.length&&f.from>l.index){let h=l[2]?3+(l[1]||"").length:2;f.from-=h,f.to-=h}i.push(new Lb(c,r.length,l.index,l.index+d.length)),a=a.slice(0,l.index)+s+a.slice(l.index+l[0].length)}a=a.replace(/\\([{}])/g,(o,s,c)=>{for(let d of i)d.line==r.length&&d.from>c&&(d.from--,d.to--);return s}),r.push(a)}return new Wp(r,i)}};u(Wp,"Snippet");let Zb=Wp,FW=re.widget({widget:new class extends Hn{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),IW=re.mark({class:"cm-snippetField"});const Yp=class Yp{constructor(e,n){this.ranges=e,this.active=n,this.deco=re.set(e.map(r=>(r.from==r.to?FW:IW).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Yp(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}};u(Yp,"ActiveSnippet");let Ya=Yp;const Ou=Oe.define({map(t,e){return t&&t.map(e)}}),LW=Oe.define(),bu=Gt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Ou))return n.value;if(n.is(LW)&&t)return new Ya(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>J.decorations.from(t,e=>e?e.deco:re.none)});function Xb(t,e){return X.create(t.filter(n=>n.field==e).map(n=>X.range(n.from,n.to)))}u(Xb,"fieldSelection");function zW(t){let e=Zb.parse(t);return(n,r,i,l)=>{let{text:a,ranges:o}=e.instantiate(n.state,i),{main:s}=n.state.selection,c={changes:{from:i,to:l==s.from?s.to:l,insert:pe.of(a)},scrollIntoView:!0,annotations:r?[Eb.of(r),xt.userEvent.of("input.complete")]:void 0};if(o.length&&(c.selection=Xb(o,0)),o.some(d=>d.field>0)){let d=new Ya(o,0),f=c.effects=[Ou.of(d)];n.state.field(bu,!1)===void 0&&f.push(Oe.appendConfig.of([bu,XW,jW,$A]))}n.dispatch(n.state.update(c))}}u(zW,"snippet");function wA(t){return({state:e,dispatch:n})=>{let r=e.field(bu,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,l=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:Xb(r.ranges,i),effects:Ou.of(l?null:new Ya(r.ranges,i)),scrollIntoView:!0})),!0}}u(wA,"moveField");const ZW=[{key:"Tab",run:wA(1),shift:wA(-1)},{key:"Escape",run:u(({state:t,dispatch:e})=>t.field(bu,!1)?(e(t.update({effects:Ou.of(null)})),!0):!1,"clearSnippet")}],xA=_.define({combine(t){return t.length?t[0]:ZW}}),XW=cl.highest(Pf.compute([xA],t=>t.facet(xA)));function Zt(t,e){return{...e,apply:zW(t)}}u(Zt,"snippetCompletion");const jW=J.domEventHandlers({mousedown(t,e){let n=e.state.field(bu,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(l=>l.from<=r&&l.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:Xb(n.ranges,i.field),effects:Ou.of(n.ranges.some(l=>l.field>i.field)?new Ya(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),yu={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},xl=Oe.define({map(t,e){let n=e.mapPos(t,-1,ct.TrackAfter);return n??void 0}}),jb=new class extends Nr{};jb.startSide=1,jb.endSide=-1;const SA=Gt.define({create(){return Te.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(xl)&&(t=t.update({add:[jb.range(n.value,n.value+1)]}));return t}});function qW(){return[YW,SA]}u(qW,"closeBrackets");const qb="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function CA(t){for(let e=0;e{if((WW?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Kn(Ft(r,0))==1||e!=i.from||n!=i.to)return!1;let l=UW(t.state,r);return l?(t.dispatch(l),!0):!1}),KW=[{key:"Backspace",run:u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=kA(t,t.selection.main.head).brackets||yu.brackets,i=null,l=t.changeByRange(a=>{if(a.empty){let o=GW(t.doc,a.head);for(let s of r)if(s==o&&hh(t.doc,a.head)==CA(Ft(s,0)))return{changes:{from:a.head-s.length,to:a.head+s.length},range:X.cursor(a.head-s.length)}}return{range:i=a}});return i||e(t.update(l,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},"deleteBracketPair")}];function UW(t,e){let n=kA(t,t.selection.main.head),r=n.brackets||yu.brackets;for(let i of r){let l=CA(Ft(i,0));if(e==i)return l==i?JW(t,i,r.indexOf(i+i+i)>-1,n):_W(t,i,l,n.before||yu.before);if(e==l&&DA(t,t.selection.main.from))return HW(t,i,l)}return null}u(UW,"insertBracket");function DA(t,e){let n=!1;return t.field(SA).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}u(DA,"closedBracketAt");function hh(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Kn(Ft(n,0)))}u(hh,"nextChar");function GW(t,e){let n=t.sliceString(e-2,e);return Kn(Ft(n,0))==n.length?n:n.slice(1)}u(GW,"prevChar");function _W(t,e,n,r){let i=null,l=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:xl.of(a.to+e.length),range:X.range(a.anchor+e.length,a.head+e.length)};let o=hh(t.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:e+n,from:a.head},effects:xl.of(a.head+e.length),range:X.cursor(a.head+e.length)}:{range:i=a}});return i?null:t.update(l,{scrollIntoView:!0,userEvent:"input.type"})}u(_W,"handleOpen");function HW(t,e,n){let r=null,i=t.changeByRange(l=>l.empty&&hh(t.doc,l.head)==n?{changes:{from:l.head,to:l.head+n.length,insert:n},range:X.cursor(l.head+n.length)}:r={range:l});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}u(HW,"handleClose");function JW(t,e,n,r){let i=r.stringPrefixes||yu.stringPrefixes,l=null,a=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:xl.of(o.to+e.length),range:X.range(o.anchor+e.length,o.head+e.length)};let s=o.head,c=hh(t.doc,s),d;if(c==e){if(PA(t,s))return{changes:{insert:e+e,from:s},effects:xl.of(s+e.length),range:X.cursor(s+e.length)};if(DA(t,s)){let h=n&&t.sliceDoc(s,s+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+h.length,insert:h},range:X.cursor(s+h.length)}}}else{if(n&&t.sliceDoc(s-2*e.length,s)==e+e&&(d=EA(t,s-2*e.length,i))>-1&&PA(t,d))return{changes:{insert:e+e+e+e,from:s},effects:xl.of(s+e.length),range:X.cursor(s+e.length)};if(t.charCategorizer(s)(c)!=ft.Word&&EA(t,s,i)>-1&&!eY(t,s,e,i))return{changes:{insert:e+e,from:s},effects:xl.of(s+e.length),range:X.cursor(s+e.length)}}return{range:l=o}});return l?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}u(JW,"handleSame");function PA(t,e){let n=ze(t).resolveInner(e+1);return n.parent&&n.from==e}u(PA,"nodeStart");function eY(t,e,n,r){let i=ze(t).resolveInner(e,-1),l=r.reduce((a,o)=>Math.max(a,o.length),0);for(let a=0;a<5;a++){let o=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+l)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+s;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}u(eY,"probablyInString");function EA(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=ft.Word)return e;for(let i of n){let l=e-i.length;if(t.sliceDoc(l,e)==i&&r(t.sliceDoc(l-1,l))!=ft.Word)return l}return-1}u(EA,"canStartStringAt");function tY(t={}){return[NW,zt,He.of(t),RW,nY,$A]}u(tY,"autocompletion");const TA=[{key:"Ctrl-Space",run:Fb},{mac:"Alt-`",run:Fb},{mac:"Alt-i",run:Fb},{key:"Escape",run:QW},{key:"ArrowDown",run:fh(!0)},{key:"ArrowUp",run:fh(!1)},{key:"PageDown",run:fh(!0,"page")},{key:"PageUp",run:fh(!1,"page")},{key:"Enter",run:AW}],nY=cl.highest(Pf.computeN([He],t=>t.facet(He).defaultKeymap?[TA]:[])),AA=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t,Y4=class Y4{constructor(e,n,r=0,i=e.length,l,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=l?o=>l(AA(o)):AA,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ft(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=S0(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Kn(e);let i=this.normalize(n);if(i.length)for(let l=0,a=r;;l++){let o=i.charCodeAt(l),s=this.match(o,a,this.bufferPos+this.bufferStart);if(l==i.length-1){if(s)return this.value=s,this;break}a==r&&le||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function iY(t){let e=[uY,sY];return t&&e.push(QA.of(t)),e}u(iY,"highlightSelectionMatches");const lY=re.mark({class:"cm-selectionMatch"}),aY=re.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function MA(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=ft.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=ft.Word)}u(MA,"insideWordBoundaries");function oY(t,e,n,r){return t(e.sliceDoc(n,n+1))==ft.Word&&t(e.sliceDoc(r-1,r))==ft.Word}u(oY,"insideWord");const sY=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(QA),{state:n}=t,r=n.selection;if(r.ranges.length>1)return re.none;let i=r.main,l,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return re.none;let s=n.wordAt(i.head);if(!s)return re.none;a=n.charCategorizer(i.head),l=n.sliceDoc(s.from,s.to)}else{let s=i.to-i.from;if(s200)return re.none;if(e.wholeWords){if(l=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(MA(a,n,i.from,i.to)&&oY(a,n,i.from,i.to)))return re.none}else if(l=n.sliceDoc(i.from,i.to),!l)return re.none}let o=[];for(let s of t.visibleRanges){let c=new ph(n.doc,l,s.from,s.to);for(;!c.next().done;){let{from:d,to:f}=c.value;if((!a||MA(a,n,d,f))&&(i.empty&&d<=i.from&&f>=i.to?o.push(aY.range(d,f)):(d>=i.to||f<=i.from)&&o.push(lY.range(d,f)),o.length>e.maxMatches))return re.none}}return re.set(o)}},{decorations:t=>t.decorations}),uY=J.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),wc=class wc{constructor(e,n,r,i,l,a,o,s,c,d=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=l,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new wc(e,[],n,r,r,0,[],0,i?new mh(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:l}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,l=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(n==r)return;if(a.buffer[o-2]>=n){a.buffer[o-2]=r;return}}}if(!l||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0){let o=!1;for(let s=a;s>0&&this.buffer[s-2]>r;s-=4)if(this.buffer[s-1]>=0){o=!0;break}if(o)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let l=e,{parser:a}=this.p;(i>this.pos||n<=a.maxNode)&&(this.pos=i,a.stateFlag(l,1)||(this.reducePos=i)),this.pushState(l,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new wc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Yb(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let l=0,a;ls&1&&o==a)||i.push(n[l],a)}n=i}let r=[];for(let i=0;i>19,i=n&65535,l=this.stack.length-r*3;if(l<0||e.getGoto(this.stack[l],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=u((i,l)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let o=(a>>19)-l;if(o>1){let s=a&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],s,!1)>=0)return o<<19|65536|s}}else{let o=r(a,l+1);if(o!=null)return o}})},"explore");return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};u(wc,"Stack");let Wb=wc;const K4=class K4{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}};u(K4,"StackContext");let mh=K4;const U4=class U4{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}};u(U4,"SimulatedStack");let Yb=U4;const xc=class xc{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new xc(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new xc(this.stack,this.pos,this.index)}};u(xc,"StackBufferCursor");let Kb=xc;function vu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&a--,a>=34&&a--;let s=a-32;if(s>=46&&(s-=46,o=!0),l+=s,o)break;l*=46}n?n[i++]=l:n=new e(l)}return n}u(vu,"decodeArray");const G4=class G4{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};u(G4,"CachedToken");let Ka=G4;const BA=new Ka,_4=class _4{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=BA,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,l=this.pos+e;for(;lr.to:l>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];l+=a.from-r.to,r=a}return l}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ro.to&&(this.chunk2=this.chunk2.slice(0,o.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=BA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}};u(_4,"InputStream");let Ub=_4;const H4=class H4{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;RA(this.data,e,n,this.id,r.data,r.tokenPrecTable)}};u(H4,"TokenGroup");let Ti=H4;Ti.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const J4=class J4{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?vu(e):e}token(e,n){let r=e.pos,i=0;for(;;){let l=e.next<0,a=e.resolveOffset(1,1);if(RA(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(l||i++,a==null)break;e.reset(a,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}};u(J4,"LocalTokenGroup");let Ua=J4;Ua.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const e$=class e${constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};u(e$,"ExternalTokenizer");let Dt=e$;function RA(t,e,n,r,i,l){let a=0,o=1<0){let m=t[p];if(s.allows(m)&&(e.token.value==-1||e.token.value==m||cY(m,e.token.value,i,l))){e.acceptToken(m);break}}let d=e.next,f=0,h=t[a+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){a=t[c+h*3-1];continue e}for(;f>1,m=c+p+(p<<1),g=t[m],O=t[m+1]||65536;if(d=O)f=p+1;else{a=t[m+2],e.advance();continue e}}break}}u(RA,"readToken");function VA(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}u(VA,"findOffset");function cY(t,e,n,r){let i=VA(n,r,e);return i<0||VA(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}u(NA,"cutAt");const t$=class t${constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?NA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?NA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(l instanceof Le){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(l),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+l.length}}};u(t$,"FragmentCursor");let _b=t$;const n$=class n${constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Ka)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:l}=i,a=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let c=0;cf.end+25&&(s=Math.max(f.lookAhead,s)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!d.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return s&&e.setLookAhead(s),!r&&e.pos==this.stream.end&&(r=new Ka,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Ka,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:l}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let l=0;le.bufferLength*4?new _b(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,l;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(o);else{if(this.advanceStack(o,r,e))continue;{i||(i=[],l=[]),i.push(o);let s=this.tokens.getMainToken(o);l.push(s.value,s.end)}}break}}if(!r.length){let a=i&&dY(i);if(a)return nn&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw nn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,l,r);if(a)return nn&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((o,s)=>s.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)r.splice(s--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,d=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?l.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(ue.contextHash)||0)==d))return e.useNode(f,h),nn&&console.log(a+this.stackID(e)+` (via reuse of ${l.getName(f.type.id)})`),!0;if(!(f instanceof Le)||f.children.length==0||f.positions[0]>0)break;let p=f.children[0];if(p instanceof Le&&f.positions[0]==0)f=p;else break}}let o=l.stateSlot(e.state,4);if(o>0)return e.reduce(o),nn&&console.log(a+this.stackID(e)+` (via always-reduce ${l.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let c=0;ci?n.push(m):r.push(m)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return FA(e,n),!0}}runRecovery(e,n,r){let i=null,l=!1;for(let a=0;a ":"";if(o.deadEnd&&(l||(l=!0,o.restart(),nn&&console.log(d+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let f=o.split(),h=d;for(let p=0;f.forceReduce()&&p<10&&(nn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));p++)nn&&(h=this.stackID(f)+" -> ");for(let p of o.recoverByInsert(s))nn&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,r);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),nn&&console.log(d+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),FA(o,r)):(!i||i.scoret,"id"),l$=class l${constructor(e){this.start=e.start,this.shift=e.shift||ty,this.reduce=e.reduce||ty,this.reuse=e.reuse||ty,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}};u(l$,"ContextTracker");let gh=l$;const Sc=class Sc extends Lf{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)l(d,s,o[c++]);else{let f=o[c+-d];for(let h=-d;h>0;h--)l(o[c++],s,f);c++}}}this.nodeSet=new YO(n.map((o,s)=>en.define({name:s>=this.minRepeatTerm?void 0:o,id:s,props:i[s],top:r.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ZT;let a=vu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Ti(a,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new Jb(this,e,n,r);for(let l of this.wrappers)i=l(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let l=i[n+1];;){let a=i[l++],o=a&1,s=i[l++];if(o&&r)return s;for(let c=l+(a>>1);l0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let l=this.stateSlot(e,1);i==null;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=zr(this.data,l+2);else break;i=n(zr(this.data,l+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=zr(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((l,a)=>a&1&&l==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Sc.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(l=>l.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let l=e.specializers.find(o=>o.from==r.external);if(!l)return r;let a=Object.assign(Object.assign({},r),{external:l.to});return n.specializers[i]=IA(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let l of e.split(" ")){let a=n.indexOf(l);a>=0&&(r[a]=!0)}let i=null;for(let l=0;lr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}u(IA,"getSpecializer");const fY=55,hY=1,pY=56,mY=2,gY=57,OY=3,LA=4,bY=5,ny=6,zA=7,ZA=8,XA=9,jA=10,yY=11,vY=12,$Y=13,ry=58,wY=14,xY=15,qA=59,WA=21,SY=23,YA=24,CY=25,iy=27,KA=28,kY=29,DY=32,PY=35,EY=37,TY=38,AY=0,QY=1,MY={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},BY={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},UA={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function RY(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}u(RY,"nameChar");let GA=null,_A=null,HA=0;function ly(t,e){let n=t.pos+e;if(HA==n&&_A==t)return GA;let r=t.peek(e),i="";for(;RY(r);)i+=String.fromCharCode(r),r=t.peek(++e);return _A=t,HA=n,GA=i?i.toLowerCase():r==VY||r==NY?void 0:null}u(ly,"tagNameAfter");const JA=60,Oh=62,ay=47,VY=63,NY=33,FY=45;function eQ(t,e){this.name=t,this.parent=e}u(eQ,"ElementContext");const IY=[ny,jA,zA,ZA,XA],LY=new gh({start:null,shift(t,e,n,r){return IY.indexOf(e)>-1?new eQ(ly(r,1)||"",t):t},reduce(t,e){return e==WA&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==ny||i==EY?new eQ(ly(r,1)||"",t):t},strict:!1}),zY=new Dt((t,e)=>{if(t.next!=JA){t.next<0&&e.context&&t.acceptToken(ry);return}t.advance();let n=t.next==ay;n&&t.advance();let r=ly(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?xY:wY);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(yY);if(i&&BY[i])return t.acceptToken(ry,-2);if(e.dialectEnabled(AY))return t.acceptToken(vY);for(let l=e.context;l;l=l.parent)if(l.name==r)return;t.acceptToken($Y)}else{if(r=="script")return t.acceptToken(zA);if(r=="style")return t.acceptToken(ZA);if(r=="textarea")return t.acceptToken(XA);if(MY.hasOwnProperty(r))return t.acceptToken(jA);i&&UA[i]&&UA[i][r]?t.acceptToken(ry,-1):t.acceptToken(ny)}},{contextual:!0}),ZY=new Dt(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(qA);break}if(t.next==FY)e++;else if(t.next==Oh&&e>=2){n>=3&&t.acceptToken(qA,-2);break}else e=0;t.advance()}});function XY(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}u(XY,"inForeignElement");const jY=new Dt((t,e)=>{if(t.next==ay&&t.peek(1)==Oh){let n=e.dialectEnabled(QY)||XY(e.context);t.acceptToken(n?bY:LA,2)}else t.next==Oh&&t.acceptToken(LA,1)});function oy(t,e,n){let r=2+t.length;return new Dt(i=>{for(let l=0,a=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(l==0&&i.next==JA||l==1&&i.next==ay||l>=2&&la?i.acceptToken(e,-a):i.acceptToken(n,-(a-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else l=a=0;i.advance()}})}u(oy,"contentTokenizer");const qY=oy("script",fY,hY),WY=oy("style",pY,mY),YY=oy("textarea",gY,OY),KY=jf({"Text RawText IncompleteTag IncompleteCloseTag":V.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":V.angleBracket,TagName:V.tagName,"MismatchedCloseTag/TagName":[V.tagName,V.invalid],AttributeName:V.attributeName,"AttributeValue UnquotedAttributeValue":V.attributeValue,Is:V.definitionOperator,"EntityReference CharacterReference":V.character,Comment:V.blockComment,ProcessingInst:V.processingInstruction,DoctypeDecl:V.documentMeta}),UY=$u.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:LY,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[KY],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=o.type.id;if(c==kY)return sy(o,s,n);if(c==DY)return sy(o,s,r);if(c==PY)return sy(o,s,i);if(c==WA&&l.length){let d=o.node,f=d.firstChild,h=f&&nQ(f,s),p;if(h){for(let m of l)if(m.tag==h&&(!m.attrs||m.attrs(p||(p=tQ(f,s))))){let g=d.lastChild,O=g.type.id==TY?g.from:d.to;if(O>f.to)return{parser:m.parser,overlay:[{from:f.to,to:O}]}}}}if(a&&c==YA){let d=o.node,f;if(f=d.firstChild){let h=a[s.read(f.from,f.to)];if(h)for(let p of h){if(p.tagName&&p.tagName!=nQ(d.parent,s))continue;let m=d.lastChild;if(m.type.id==iy){let g=m.from+1,O=m.lastChild,b=m.to-(O&&O.isError?0:1);if(b>g)return{parser:p.parser,overlay:[{from:g,to:b}]}}else if(m.type.id==KA)return{parser:p.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}u(rQ,"configureNesting");const GY=122,iQ=1,_Y=123,HY=124,lQ=2,JY=125,eK=3,tK=4,aQ=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],nK=58,rK=40,oQ=95,iK=91,bh=45,lK=46,aK=35,oK=37,sK=38,uK=92,cK=10,dK=42;function wu(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}u(wu,"isAlpha");function uy(t){return t>=48&&t<=57}u(uy,"isDigit");function sQ(t){return uy(t)||t>=97&&t<=102||t>=65&&t<=70}u(sQ,"isHex");const uQ=u((t,e,n)=>(r,i)=>{for(let l=!1,a=0,o=0;;o++){let{next:s}=r;if(wu(s)||s==bh||s==oQ||l&&uy(s))!l&&(s!=bh||o>0)&&(l=!0),a===o&&s==bh&&a++,r.advance();else if(s==uK&&r.peek(1)!=cK){if(r.advance(),sQ(r.next)){do r.advance();while(sQ(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();l=!0}else{l&&r.acceptToken(a==2&&i.canShift(lQ)?e:s==rK?n:t);break}}},"identifierTokens"),fK=new Dt(uQ(_Y,lQ,HY)),hK=new Dt(uQ(JY,eK,tK)),pK=new Dt(t=>{if(aQ.includes(t.peek(-1))){let{next:e}=t;(wu(e)||e==oQ||e==aK||e==lK||e==dK||e==iK||e==nK&&wu(t.peek(1))||e==bh||e==sK)&&t.acceptToken(GY)}}),mK=new Dt(t=>{if(!aQ.includes(t.peek(-1))){let{next:e}=t;if(e==oK&&(t.advance(),t.acceptToken(iQ)),wu(e)){do t.advance();while(wu(t.next)||uy(t.next));t.acceptToken(iQ)}}}),gK=jf({"AtKeyword import charset namespace keyframes media supports":V.definitionKeyword,"from to selector":V.keyword,NamespaceName:V.namespace,KeyframeName:V.labelName,KeyframeRangeName:V.operatorKeyword,TagName:V.tagName,ClassName:V.className,PseudoClassName:V.constant(V.className),IdName:V.labelName,"FeatureName PropertyName":V.propertyName,AttributeName:V.attributeName,NumberLiteral:V.number,KeywordQuery:V.keyword,UnaryQueryOp:V.operatorKeyword,"CallTag ValueName":V.atom,VariableName:V.variableName,Callee:V.operatorKeyword,Unit:V.unit,"UniversalSelector NestingSelector":V.definitionOperator,"MatchOp CompareOp":V.compareOperator,"ChildOp SiblingOp, LogicOp":V.logicOperator,BinOp:V.arithmeticOperator,Important:V.modifier,Comment:V.blockComment,ColorLiteral:V.color,"ParenthesizedContent StringLiteral":V.string,":":V.punctuation,"PseudoOp #":V.derefOperator,"; ,":V.separator,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace}),OK={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},bK={__proto__:null,or:98,and:98,not:106,only:106,layer:170},yK={__proto__:null,selector:112,layer:166},vK={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},$K={__proto__:null,to:207},wK=$u.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hOK[t]||-1},{term:125,get:t=>bK[t]||-1},{term:4,get:t=>yK[t]||-1},{term:25,get:t=>vK[t]||-1},{term:123,get:t=>$K[t]||-1}],tokenPrec:1963});let cy=null;function dy(){if(!cy&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));cy=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return cy||[]}u(dy,"properties");const cQ=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),dQ=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),xK=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),SK=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Zr=/^(\w[\w-]*|-\w[\w-]*|)$/,CK=/^-(-[\w-]*)?$/;function kK(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}u(kK,"isVarArg");const fQ=new If,DK=["Declaration"];function PK(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}u(PK,"astTop");function hQ(t,e,n){if(e.to-e.from>4096){let r=fQ.get(e);if(r)return r;let i=[],l=new Set,a=e.cursor(Ae.IncludeAnonymous);if(a.firstChild())do for(let o of hQ(t,a.node,n))l.has(o.label)||(l.add(o.label),i.push(o));while(a.nextSibling());return fQ.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(l=>{var a;if(n(l)&&l.matchContext(DK)&&((a=l.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let o=t.sliceString(l.from,l.to);i.has(o)||(i.add(o),r.push({label:o,type:"variable"}))}}),r}}u(hQ,"variableNames");const EK=u(t=>e=>{let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(l||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:dy(),validFor:Zr};if(i.name=="ValueName")return{from:i.from,options:dQ,validFor:Zr};if(i.name=="PseudoClassName")return{from:i.from,options:cQ,validFor:Zr};if(t(i)||(e.explicit||l)&&kK(i,n.doc))return{from:t(i)||l?i.from:r,options:hQ(n.doc,PK(i),t),validFor:CK};if(i.name=="TagName"){for(let{parent:s}=i;s;s=s.parent)if(s.name=="Block")return{from:i.from,options:dy(),validFor:Zr};return{from:i.from,options:xK,validFor:Zr}}if(i.name=="AtKeyword")return{from:i.from,options:SK,validFor:Zr};if(!e.explicit)return null;let a=i.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:cQ,validFor:Zr}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:dQ,validFor:Zr}:a.name=="Block"||a.name=="Styles"?{from:r,options:dy(),validFor:Zr}:null},"defineCSSCompletionSource")(t=>t.name=="VariableName"),yh=lu.define({name:"css",parser:wK.configure({props:[Uf.add({Declaration:Gf()}),_f.add({"Block KeyframeList":s7})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function TK(){return new su(yh,yh.data.of({autocomplete:EK}))}u(TK,"css");const AK=316,QK=317,pQ=1,MK=2,BK=3,RK=4,VK=318,NK=320,FK=321,IK=5,LK=6,zK=0,fy=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],mQ=125,ZK=59,hy=47,XK=42,jK=43,qK=45,WK=60,YK=44,KK=63,UK=46,GK=91,_K=new gh({start:!1,shift(t,e){return e==IK||e==LK||e==NK?t:e==FK},strict:!1}),HK=new Dt((t,e)=>{let{next:n}=t;(n==mQ||n==-1||e.context)&&t.acceptToken(VK)},{contextual:!0,fallback:!0}),JK=new Dt((t,e)=>{let{next:n}=t,r;fy.indexOf(n)>-1||n==hy&&((r=t.peek(1))==hy||r==XK)||n!=mQ&&n!=ZK&&n!=-1&&!e.context&&t.acceptToken(AK)},{contextual:!0}),eU=new Dt((t,e)=>{t.next==GK&&!e.context&&t.acceptToken(QK)},{contextual:!0}),tU=new Dt((t,e)=>{let{next:n}=t;if(n==jK||n==qK){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(pQ);t.acceptToken(r?pQ:MK)}}else n==KK&&t.peek(1)==UK&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(BK))},{contextual:!0});function py(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}u(py,"identifierChar");const nU=new Dt((t,e)=>{if(t.next!=WK||!e.dialectEnabled(zK)||(t.advance(),t.next==hy))return;let n=0;for(;fy.indexOf(t.next)>-1;)t.advance(),n++;if(py(t.next,!0)){for(t.advance(),n++;py(t.next,!1);)t.advance(),n++;for(;fy.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==YK)return;for(let r=0;;r++){if(r==7){if(!py(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(RK,-n)}),rU=jf({"get set async static":V.modifier,"for while do if else switch try catch finally return throw break continue default case defer":V.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":V.operatorKeyword,"let var const using function class extends":V.definitionKeyword,"import export from":V.moduleKeyword,"with debugger new":V.keyword,TemplateString:V.special(V.string),super:V.atom,BooleanLiteral:V.bool,this:V.self,null:V.null,Star:V.modifier,VariableName:V.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":V.function(V.variableName),VariableDefinition:V.definition(V.variableName),Label:V.labelName,PropertyName:V.propertyName,PrivatePropertyName:V.special(V.propertyName),"CallExpression/MemberExpression/PropertyName":V.function(V.propertyName),"FunctionDeclaration/VariableDefinition":V.function(V.definition(V.variableName)),"ClassDeclaration/VariableDefinition":V.definition(V.className),"NewExpression/VariableName":V.className,PropertyDefinition:V.definition(V.propertyName),PrivatePropertyDefinition:V.definition(V.special(V.propertyName)),UpdateOp:V.updateOperator,"LineComment Hashbang":V.lineComment,BlockComment:V.blockComment,Number:V.number,String:V.string,Escape:V.escape,ArithOp:V.arithmeticOperator,LogicOp:V.logicOperator,BitOp:V.bitwiseOperator,CompareOp:V.compareOperator,RegExp:V.regexp,Equals:V.definitionOperator,Arrow:V.function(V.punctuation),": Spread":V.punctuation,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace,"InterpolationStart InterpolationEnd":V.special(V.brace),".":V.derefOperator,", ;":V.separator,"@":V.meta,TypeName:V.typeName,TypeDefinition:V.definition(V.typeName),"type enum interface implements namespace module declare":V.definitionKeyword,"abstract global Privacy readonly override":V.modifier,"is keyof unique infer asserts":V.operatorKeyword,JSXAttributeValue:V.attributeValue,JSXText:V.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":V.angleBracket,"JSXIdentifier JSXNameSpacedName":V.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":V.attributeName,"JSXBuiltin/JSXIdentifier":V.standard(V.tagName)}),iU={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},lU={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},aU={__proto__:null,"<":193},oU=$u.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:_K,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[rU],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[JK,eU,tU,nU,2,3,4,5,6,7,8,9,10,11,12,13,14,HK,new Ua("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Ua("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>iU[t]||-1},{term:343,get:t=>lU[t]||-1},{term:95,get:t=>aU[t]||-1}],tokenPrec:15201}),gQ=[Zt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Zt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Zt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Zt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Zt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Zt(`try { \${} } catch (\${error}) { \${} @@ -31,7 +31,7 @@ var Nne=Object.defineProperty;var u=(om,Ic)=>Nne(om,"name",{value:Ic,configurabl constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Zt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Zt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],sU=gQ.concat([Zt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Zt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Zt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),OQ=new If,bQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function xu(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}u(xu,"defID");const uU=["FunctionDeclaration"],cU={FunctionDeclaration:xu("function"),ClassDeclaration:xu("class"),ClassExpression:()=>!0,EnumDeclaration:xu("constant"),TypeAliasDeclaration:xu("type"),NamespaceDeclaration:xu("namespace"),VariableDefinition(t,e){t.matchContext(uU)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function yQ(t,e){let n=OQ.get(e);if(n)return n;let r=[],i=!0;function l(a,o){let s=t.sliceString(a.from,a.to);r.push({label:s,type:o})}return u(l,"def"),e.cursor(Ae.IncludeAnonymous).iterate(a=>{if(i)i=!1;else if(a.name){let o=cU[a.name];if(o&&o(a,l)||bQ.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of yQ(t,a.node))r.push(o);return!1}}),OQ.set(e,r),r}u(yQ,"getScope");const vQ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,$Q=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function dU(t){let e=ze(t.state).resolveInner(t.pos,-1);if($Q.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&vQ.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)bQ.has(i.name)&&(r=r.concat(yQ(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:vQ}}u(dU,"localCompletionSource");const or=lu.define({name:"javascript",parser:oU.configure({props:[Uf.add({IfStatement:Gf({except:/^\s*({|else\b)/}),TryStatement:Gf({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Ej,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:Pj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Gf({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),_f.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":s7,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),wQ={test:t=>/^JSX/.test(t.name),facet:n7({commentTokens:{block:{open:"{/*",close:"*/}"}}})},xQ=or.configure({dialect:"ts"},"typescript"),SQ=or.configure({dialect:"jsx",props:[sb.add(t=>t.isTop?[wQ]:void 0)]}),CQ=or.configure({dialect:"jsx ts",props:[sb.add(t=>t.isTop?[wQ]:void 0)]},"typescript");let kQ=u(t=>({label:t,type:"keyword"}),"kwCompletion");const DQ="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kQ),fU=DQ.concat(["declare","implements","private","protected","public"].map(kQ));function hU(t={}){let e=t.jsx?t.typescript?CQ:SQ:t.typescript?xQ:or,n=t.typescript?sU.concat(fU):gQ.concat(DQ);return new su(e,[or.data.of({autocomplete:OW($Q,hA(n))}),or.data.of({autocomplete:dU}),t.jsx?gU:[]])}u(hU,"javascript");function pU(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}u(pU,"findOpenTag");function PQ(t,e,n=t.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}u(PQ,"elementName$1");const mU=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),gU=J.inputHandler.of((t,e,n,r,i)=>{if((mU?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!or.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c;let{head:d}=s,f=ze(a).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(a.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:s,changes:{from:d,insert:""}};if(r=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=PQ(a.doc,m.firstChild,d))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:X.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let p=pU(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(h=PQ(a.doc,p,d)))return{range:s,changes:{from:d,insert:``}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Su=["_blank","_self","_top","_parent"],my=["ascii","utf-8","utf-16","latin1","latin1"],gy=["get","post","put","delete"],Oy=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],rn=["true","false"],te={},OU={a:{attrs:{href:null,ping:null,type:null,media:null,target:Su,hreflang:null}},abbr:te,address:te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:te,aside:te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:te,base:{attrs:{href:null,target:Su}},bdi:te,bdo:te,blockquote:{attrs:{cite:null}},body:te,br:te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Oy,formmethod:gy,formnovalidate:["novalidate"],formtarget:Su,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:te,center:te,cite:te,code:te,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:te,div:te,dl:te,dt:te,em:te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:te,figure:te,footer:te,form:{attrs:{action:null,name:null,"accept-charset":my,autocomplete:["on","off"],enctype:Oy,method:gy,novalidate:["novalidate"],target:Su}},h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:te,hgroup:te,hr:te,html:{attrs:{manifest:null}},i:te,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Oy,formmethod:gy,formnovalidate:["novalidate"],formtarget:Su,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:te,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:my,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:te,noscript:te,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:te,param:{attrs:{name:null,value:null}},pre:te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:te,rt:te,ruby:te,samp:te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:my}},section:te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:te,source:{attrs:{src:null,type:null,media:null}},span:te,strong:te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:te,summary:te,sup:te,table:te,tbody:te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:te,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:te,time:{attrs:{datetime:null}},title:te,tr:te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:te,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:te},EQ={accesskey:null,class:null,contenteditable:rn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:rn,autocorrect:rn,autocapitalize:rn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":rn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":rn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":rn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":rn,"aria-hidden":rn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":rn,"aria-multiselectable":rn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":rn,"aria-relevant":null,"aria-required":rn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},TQ="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of TQ)EQ[t]=null;let vh=(Cc=class{constructor(e,n){this.tags={...OU,...e},this.globalAttrs={...EQ,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}},u(Cc,"Schema"),Cc);vh.default=new vh;function Ga(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}u(Ga,"elementName");function _a(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}u(_a,"findParentElement");function AQ(t,e,n){let r=n.tags[Ga(t,_a(e))];return r?.children||n.allTags}u(AQ,"allowedChildren");function by(t,e){let n=[];for(let r=_a(e);r&&!r.type.isTop;r=_a(r.parent)){let i=Ga(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}u(by,"openTags");const QQ=/^[:\-\.\w\u00b7-\uffff]*$/;function MQ(t,e,n,r,i){let l=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",a=_a(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:AQ(t.doc,a,e).map(o=>({label:o,type:"type"})).concat(by(t.doc,n).map((o,s)=>({label:"/"+o,apply:"/"+o+l,type:"type",boost:99-s}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}u(MQ,"completeTag");function BQ(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:by(t.doc,e).map((l,a)=>({label:l,apply:l+i,type:"type",boost:99-a})),validFor:QQ}}u(BQ,"completeCloseTag");function bU(t,e,n,r){let i=[],l=0;for(let a of AQ(t.doc,n,e))i.push({label:"<"+a,type:"type"});for(let a of by(t.doc,n))i.push({label:"",type:"type",boost:99-l++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}u(bU,"completeStartTag");function yU(t,e,n,r,i){let l=_a(n),a=l?e.tags[Ga(t.doc,l)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],s=a&&a.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:s.map(c=>({label:c,type:"property"})),validFor:QQ}}u(yU,"completeAttrName");function vU(t,e,n,r,i){var l;let a=(l=n.parent)===null||l===void 0?void 0:l.getChild("AttributeName"),o=[],s;if(a){let c=t.sliceDoc(a.from,a.to),d=e.globalAttrs[c];if(!d){let f=_a(n),h=f?e.tags[Ga(t.doc,f)]:null;d=h?.attrs&&h.attrs[c]}if(d){let f=t.sliceDoc(r,i).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(s=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=t.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):s=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:h+m+p,type:"constant"})}}return{from:r,to:i,options:o,validFor:s}}u(vU,"completeAttrValue");function $U(t,e){let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.resolve(r);for(let a=r,o;l==i&&(o=i.childBefore(a));){let s=o.lastChild;if(!s||!s.type.isError||s.from$U(r,i)}u(wU,"htmlCompletionSourceWith");const xU=or.parser.configure({top:"SingleExpression"}),RQ=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:xQ.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:SQ.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:CQ.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:xU},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:or.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:yh.parser}],VQ=[{name:"style",parser:yh.parser.configure({top:"Styles"})}].concat(TQ.map(t=>({name:t,parser:or.parser}))),NQ=lu.define({name:"html",parser:UY.configure({props:[Uf.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),$h=NQ.configure({wrap:rQ(RQ,VQ)});function SU(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=rQ((t.nestedLanguages||[]).concat(RQ),(t.nestedAttributes||[]).concat(VQ)));let r=n?NQ.configure({wrap:n,dialect:e}):e?$h.configure({dialect:e}):$h;return new su(r,[$h.data.of({autocomplete:wU(t)}),t.autoCloseTags!==!1?CU:[],hU().support,TK().support])}u(SU,"html");const FQ=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),CU=J.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!$h.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c,d,f;let h=a.doc.sliceString(s.from-1,s.to)==r,{head:p}=s,m=ze(a).resolveInner(p,-1),g;if(h&&r==">"&&m.name=="EndTag"){let O=m.parent;if(((d=(c=O.parent)===null||c===void 0?void 0:c.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=Ga(a.doc,O.parent,p))&&!FQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=``;return{range:s,changes:{from:p,to:b,insert:y}}}}else if(h&&r=="/"&&m.name=="IncompleteCloseTag"){let O=m.parent;if(m.from==p-2&&((f=O.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=Ga(a.doc,O,p))&&!FQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=`${g}>`;return{range:X.cursor(p+y.length,-1),changes:{from:p,to:b,insert:y}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var kU=Object.defineProperty,IQ=u((t,e)=>kU(t,"name",{value:e,configurable:!0}),"i$c");const DU=IQ((t,e=!1)=>{const n=[QX(),RX(),aX(),fq(),zj(),HZ(),uu.of(" "),Aj(),_j(),qW(),tY(),OX(),vX(),cX(),iY(),Pf.of([mW,...KW,...pW,...$q,...Fj,...TA]),SU(),Xj(qj,{fallback:!0}),J.updateListener.of(r=>{r.docChanged&&e&&e(r.state.doc.toString())}),J.lineWrapping];return Xe.create({doc:t,extensions:n})},"createEditorState"),PU=IQ((t,e)=>new J({state:t,parent:e,lineWrapping:!0}),"createEditorView");var EU=Object.defineProperty,TU=u((t,e)=>EU(t,"name",{value:e,configurable:!0}),"i$b");const LQ=TU(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(null),i=wp.element.useRef(null);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{if(i.current)return;const l=DU(t.value??"",n);i.current=PU(l,r.current)},[r.current]),wp.element.createElement("div",{className:"tf-code"},wp.element.createElement("div",{className:"tf-code-editor",ref:r}))},"Editor");var AU=Object.defineProperty,QU=u((t,e)=>AU(t,"name",{value:e,configurable:!0}),"n$c");const MU=QU(t=>{const e=wp.element.useRef(null),[n,r]=wp.element.useState(t.value??""),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]),wp.element.createElement("div",{className:"tf-code"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",value:n,ref:e,name:t.name??""}),wp.element.createElement(LQ,{...t,value:n,onChange:r}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Code");var BU=Object.defineProperty,RU=u((t,e)=>BU(t,"name",{value:e,configurable:!0}),"c$e");const VU=RU(t=>{const e=wp.element.useRef(null),n=wp.element.useRef(null),r=wp.element.useRef(null),i=lN(t),{colorAreaProps:l,gradientProps:a,xInputProps:o,yInputProps:s,thumbProps:c}=yN({...t,inputXRef:e,inputYRef:n,containerRef:r},i),{focusProps:d}=is();return wp.element.createElement("div",{className:"tf-color-area",ref:r,style:l.style,...l},wp.element.createElement("div",{className:"tf-color-area-gradient",style:a?.style,...a}),wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...c.style,background:i.getDisplayColor().toString("css")},...c},wp.element.createElement("input",{ref:e,...o,...d}),wp.element.createElement("input",{ref:n,...s,...d})))},"ColorArea");var NU=Object.defineProperty,FU=u((t,e)=>NU(t,"name",{value:e,configurable:!0}),"c$d");const zQ=FU(t=>{const{locale:e}=Re(),n=cN({...t,locale:e}),r=wp.element.useRef(),i=wp.element.useRef(),l=t.label||n.value.getChannelName(t.channel,e),{trackProps:a,thumbProps:o,inputProps:s,labelProps:c,outputProps:d}=wN({...t,label:l,trackRef:r,inputRef:i},n),{focusProps:f}=is();return wp.element.createElement("div",{className:"tf-color-slider"},wp.element.createElement("div",{className:"tf-color-slider-label"},wp.element.createElement("label",{...c},l),wp.element.createElement("output",{...d},n.value.formatChannelValue(t.channel,e))),wp.element.createElement("div",{className:"tf-color-slider-container",ref:r,style:a.style,...a},wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...o.style,background:n.getDisplayColor().toString("css")},...o},wp.element.createElement(gn,null,wp.element.createElement("input",{ref:i,...s,...f})))))},"ColorSlider");var IU=Object.defineProperty,LU=u((t,e)=>IU(t,"name",{value:e,configurable:!0}),"t$7");const ZQ=LU(t=>{const[e,n]=wp.element.useState(mn(t.value&&t.value!==""?t.value:"rgba(255, 255, 255, 1)").toHSB()),[r,i,l]=e.getColorChannels(),[a,o]=wp.element.useState(t.value);wp.element.useEffect(()=>{o(t.value)},[t.value]),wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]);const{focusWithinProps:s}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}}),c=t.hasAlpha??!0;return wp.element.createElement("div",{className:"tf-color-picker",...s},wp.element.createElement(Os,null,wp.element.createElement($d,{autoFocus:!0,restoreFocus:!0},wp.element.createElement(VU,{"aria-labelledby":"hsb-label-id-1",value:e,onChange:n,xChannel:i,yChannel:l}),wp.element.createElement("div",{className:"tf-color-input"},wp.element.createElement("label",null,"Color"),wp.element.createElement("input",{type:"text",value:a,onChange:d=>{o(d.target.value)},onBlur:d=>{t.onChange(d.target.value)}})),wp.element.createElement("div",{className:"tf-color-sliders"},wp.element.createElement(zQ,{channel:r,value:e,onChange:n}),c&&wp.element.createElement(zQ,{channel:"alpha",value:e,onChange:n})))))},"ColorPicker");var zU=Object.defineProperty,ZU=u((t,e)=>zU(t,"name",{value:e,configurable:!0}),"c$c");const XU=wp.element.forwardRef(({inputProps:t,state:e,...n},r)=>{const[i,l]=wp.element.useState(!1),a=n.format??"hexa",o=wp.element.useRef(),s=ZU(c=>{const d=c.toString?c.toString(a):"";e.setInputValue(d),n.onChange&&n.onChange(d)},"onChange");return wp.element.useEffect(()=>e.setInputValue(e.colorValue?.toString(a)),[]),wp.element.createElement("div",{className:"tf-color-container",ref:o},wp.element.createElement("input",{ref:r,...t,onClick:()=>l(!0),value:e.inputValue??""}),i&&wp.element.createElement(Rr,{state:{isOpen:i,close:()=>l(!1)},triggerRef:r,placement:"bottom start",style:{width:o?.current?.offsetWidth},className:"tf-color-popover"},wp.element.createElement(ZQ,{value:e.colorValue?.toString(a),onChange:s,hasAlpha:n.hasAlpha??!0,onFocusChange:c=>l(c)})))});var jU=Object.defineProperty,qU=u((t,e)=>jU(t,"name",{value:e,configurable:!0}),"n$b");const XQ=qU(t=>{let e;typeof t.value=="object"?e=t.value?.value||"#FFFFFF":e=t?.value||"#FFFFFF";const n={...t,value:e},r=wp.element.useRef(),i=hN(n),{labelProps:l,inputProps:a,descriptionProps:o}=SN(n,i,r),[s,c]=wp.element.useState(n.value??"");return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement("div",{className:"tf-color"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(Cs,{...n,value:s,onValueSelection:c,inputProps:a,ref:r},wp.element.createElement(XU,{...n,value:s,onChange:t.onChange,state:i,inputProps:a,ref:r})),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Color");var WU=Object.defineProperty,jQ=u((t,e)=>WU(t,"name",{value:e,configurable:!0}),"c$b");const YU=jQ((t,e)=>{const{api:n,fetchResponse:r}=yr();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(t,{method:"POST",body:e,headers:{"X-WP-Nonce":n.nonce??!1,enctype:"multipart/form-data"},credentials:"same-origin",processData:!1,contentType:!1}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"post"),qQ=jQ((t,e=!1)=>{const{api:n,fetchResponse:r}=yr();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(`${t}?${e?new URLSearchParams(e):""}`,{method:"GET",headers:{"X-WP-Nonce":n.nonce??!1},credentials:"same-origin"}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"get");var KU=Object.defineProperty,yy=u((t,e)=>KU(t,"name",{value:e,configurable:!0}),"i$a");const UU=yy(t=>{const e=wp.element.useRef({status:!1,callback:!1,firstLoad:!0}),n=UI({async load({filterText:r}){if(e.current.firstLoad)e.current.firstLoad=!1;else{if(e.current.status==="waiting"){const o=t.debounceTime??200;clearTimeout(e.current.callback),e.current={status:"waiting",callback:setTimeout(()=>{e.current.status=!1,n.setFilterText(r)},o)};return}e.current.status="waiting"}const i={...t.asyncArgs??{},search:r};let l=t.ajaxAction?await Tangible?.ajax(t.ajaxAction,i):await qQ(t.searchUrl??"",i);l.length===0&&l.push({id:"_noResults",title:"No results"}),!Array.isArray(l)&&typeof l=="object"&&(l=Object.values(l).map(o=>o));const a=t.mapResults?GU(l,t.mapResults):l;return{items:rl((a??[]).reduce((o,s)=>({...o,[s.id]:s.title}),{}))}}});return{items:n.items,inputValue:n.filterText,onInputChange:n.setFilterText,selectedKeys:t.value.value??"",loadingState:n.loadingState}},"getAsyncProps"),GU=yy((t,e)=>t.map(n=>(e.id&&(n.id=WQ(n,e.id)),e.title&&(n.title=WQ(n,e.title)),n)),"mapResults"),WQ=yy((t,e)=>typeof e=="object"?t[e.key][e.attribute]:t[e],"mapResultsItem");var _U=Object.defineProperty,wh=u((t,e)=>_U(t,"name",{value:e,configurable:!0}),"n$a");const YQ=wh((t,e,n)=>{if(!e.isAsync){e.onSelectionChange&&e.onSelectionChange(t);return}const r=W2(t,e.items);e.onSelectionChange&&e.onSelectionChange(r),e.multiple||n.setInputValue(r.label)},"onSelectionChange"),KQ=wh((t,e)=>t.isAsync&&t.selectedKey?e.setInputValue(t.selectedKey.label??""):null,"setInputValue"),UQ=wh(t=>t.isAsync&&t.selectedKey?.value?t.selectedKey.value:t.selectedKey??"","getSelectedKey"),GQ=wh(t=>[...t.disabledKeys??[],"_noResults"],"getDisabledKeys"),HU=wp.element.forwardRef(({parent:t,buttonProps:e,descriptionProps:n,labelProps:r,inputProps:i,listBoxProps:l,state:a,multiple:o=!1},s)=>{if(o)throw new Error("The simple layout does not support multiple values");const{focusWithinProps:c}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}});return wp.element.createElement("div",{className:"tf-combo-box",...c},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement($d,{autoFocus:t.autoFocus,restoreFocus:!0},wp.element.createElement("div",{className:"tf-combo-box-text",ref:s.current.wrapper},wp.element.createElement("input",{...i,ref:s.current.input,readOnly:t.readOnly}),t.showButton&&wp.element.createElement(se,{type:"action",ref:s.current.trigger,preventFocusOnPress:!0,...e,isDisabled:t.readOnly},wp.element.createElement("span",{"aria-hidden":"true"},"\u25BC")),a.isOpen&&!t.readOnly&&wp.element.createElement(Rr,{state:a,triggerRef:s.current.input,popoverRef:s.current.popover,placement:"bottom start",isNonModal:!0,style:{width:s.current.wrapper?.current?.offsetWidth},className:"tf-combo-box-popover"},wp.element.createElement(Nd,{loadingState:t.loadingState??"idle",listBoxRef:s.current.listbox,state:a,items:t.items,focusWithinProps:!0,shouldUseVirtualFocus:!0,...l})))),t.description&&wp.element.createElement(we,{descriptionProps:n,parent:t},t.description))}),JU=wp.element.forwardRef(({parent:t,descriptionProps:e,labelProps:n,inputProps:r,itemProps:i,multiple:l,state:a,...o},s)=>{if(!l)throw new Error("The simple-multiple layout only support multiple values");const{add:c,getDisabledValues:d,remove:f}=l,[h,p]=wp.element.useState(l.values??[]);wp.element.useEffect(()=>p(l.values),[l.values]);const m=wp.element.useRef(),g=pi({}),{triggerProps:O,overlayProps:b}=cs({type:"dialog"},g,m),y=Array.isArray(t.choices)?t.choices.reduce(($,v)=>({...$,...v.choices??{}}),{}):t.choices;return wp.element.createElement("div",{className:"tf-multiple-combobox","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("div",{className:"tf-multiple-combobox-container"},wp.element.createElement("div",{ref:s.current.input,className:"tf-multiple-combobox-values",...r},h.length===0?t.placeholder??"No item selected":h.map(($,v)=>wp.element.createElement("span",{key:$.key??v,className:"tf-combo-box-item"},wp.element.createElement("span",null,t.isAsync?$.label:y[$]??""),t.readOnly!==!0&&wp.element.createElement(se,{onPress:()=>f(v)},"x")))),wp.element.createElement(se,{type:"action",ref:m,...O,isDisabled:t.readOnly},"Add"),g.isOpen&&wp.element.createElement("div",{className:"tf-popover",ref:s.current.overlay,...b},wp.element.createElement(JQ,{focusStrategy:"first",label:"Select an item to add",labelVisuallyHidden:!0,description:!1,disabledKeys:d(),autoFocus:!0,multiple:!0,showButton:!1,menuTrigger:"focus",onSelectionChange:$=>{$&&(c($),g.close())},onFocusChange:$=>$?!g.isOpen&&g.open():g.close(),isAsync:t.isAsync??!1,...i},t.children),wp.element.createElement(fs,{onDismiss:g.close}))),t.description&&wp.element.createElement(we,{descriptionProps:e,parent:t},t.description))});var eG=Object.defineProperty,tG=u((t,e)=>eG(t,"name",{value:e,configurable:!0}),"i$8");const _Q={"simple-multiple":JU,simple:HU},HQ=tG(t=>typeof t=="string"?_Q[t]:["function","object"].includes(typeof t)?t:_Q[fallback],"getLayout");var nG=Object.defineProperty,rG=u((t,e)=>nG(t,"name",{value:e,configurable:!0}),"l$8"),JQ=rG(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef();wp.element.useEffect(()=>{KQ(t,o)},[]);const{contains:a}=Sg({sensitivity:"base"}),o=nP({...t,onSelectionChange:g=>YQ(g,t,o),selectedKey:UQ(t),defaultFilter:a,disabledKeys:GQ(t)}),{buttonProps:s,inputProps:c,listBoxProps:d,labelProps:f,descriptionProps:h}=YD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},o),p=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),m=HQ(t.layout??"simple");return wp.element.createElement(m,{parent:t,labelProps:f,descriptionProps:h,inputProps:c,buttonProps:s,listBoxProps:d,itemProps:t.itemProps,ref:p,state:o,multiple:!1})},"ComboBox"),iG=Object.defineProperty,xh=u((t,e)=>iG(t,"name",{value:e,configurable:!0}),"n$8");const lG=xh(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef(),[a,o]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value&&!t.isAsync?t.value.split(","):[]);wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a.length]),wp.element.useEffect(()=>{KQ(t,c)},[]);const{contains:s}=Sg({sensitivity:"base"}),c=nP({...t,onSelectionChange:v=>YQ(v,t,c),selectedKey:UQ(t),defaultFilter:s,disabledKeys:GQ(t)}),{buttonProps:d,inputProps:f,listBoxProps:h,labelProps:p,descriptionProps:m}=YD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},c),g=xh(v=>{a.indexOf(v)===-1&&o([...a,v])},"add"),O=xh(v=>{a[v]&&o([...a.slice(0,v),...a.slice(v+1)])},"remove"),b=xh(()=>t.isAsync?a.map(v=>v.value):a,"getDisabledValues"),y=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),$=HQ(t.layout??"simple-multiple");return wp.element.createElement($,{parent:t,labelProps:p,descriptionProps:m,inputProps:f,buttonProps:d,listBoxProps:h,itemProps:t.itemProps,ref:y,state:c,multiple:{getDisabledValues:b,add:g,remove:O,values:a}})},"MultipleComboBox");var aG=Object.defineProperty,oG=u((t,e)=>aG(t,"name",{value:e,configurable:!0}),"t$6"),Sh=oG(t=>{const[e,n]=wp.element.useState(t.isAsync?On(t.value??""):t.value??!1),r=t.isAsync?UU(t):{defaultItems:rl(t.choices??{})};return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[r.selectedKeys]),t.multiple?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(lG,{...t,onChange:i=>n(t.isAsync?i:i.join(",")),value:e,label:t.label??null,placeholder:t.placeholder,description:t.description??!1,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple-multiple",itemProps:r,...r},zd)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(JQ,{focusStrategy:"first",label:t.label??null,placeholder:t.placeholder,description:t.description??!1,selectedKey:e,onSelectionChange:n,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple",itemProps:r,...r},zd))},"default"),sG=Object.defineProperty,uG=u((t,e)=>sG(t,"name",{value:e,configurable:!0}),"i$7");const Ch=uG((t,e)=>{if(t instanceof Fe)return t;const n=String(t??"").split("-");return n.length===3?new Fe("AD",n[0],n[1],n[2]):e},"formatValue");var cG=Object.defineProperty,eM=u((t,e)=>cG(t,"name",{value:e,configurable:!0}),"o$6");const tM=wp.element.createContext(null),dG=eM(({value:t,children:e})=>{const n=On(t)??"",r=Cr(kr()),i={start:Ch(n.start??"",r),end:Ch(n.end??"",r)},[l,a]=wp.element.useState(i);return wp.element.createElement(tM.Provider,{value:{dateValue:l,setDateValue:a}},e)},"CalendarContextProvider"),kh=eM(()=>{const t=wp.element.useContext(tM);if(!t)throw new Error("useCalendarContext must be used within a Calendar");return t},"useCalendarContext");var fG=Object.defineProperty,hG=u((t,e)=>fG(t,"name",{value:e,configurable:!0}),"t$5");const pG=hG(({state:t,date:e})=>{const n=wp.element.useRef(),{cellProps:r,buttonProps:i,isSelected:l,isOutsideVisibleRange:a,isDisabled:o,isUnavailable:s,formattedDate:c}=ZV({date:e},t,n),{focusProps:d}=is();let f="tf-calendar-cell";return l&&(f+=" tf-calendar-cell-selected"),o&&(f+=" tf-calendar-cell-disabled"),s&&(f+=" tf-calendar-cell-unavailable"),wp.element.createElement("td",{...r},wp.element.createElement("div",{...ne(i,d),ref:n,hidden:a,className:f},c))},"CalendarCell");var mG=Object.defineProperty,gG=u((t,e)=>mG(t,"name",{value:e,configurable:!0}),"l$7");const nM=gG(({state:t,...e})=>{const{locale:n}=Re(),r=e.dateRange??!1,i=t.visibleRange.start.add(e.offset??{}),l=ma(i),{gridProps:a,headerProps:o,weekDays:s}=$x(r?{startDate:i,endDate:l}:e,t),c=L3(t.visibleRange.start,n);return wp.element.createElement("table",{className:"tf-calendar-table",...a},wp.element.createElement("thead",{...o},wp.element.createElement("tr",null,s.map((d,f)=>wp.element.createElement("th",{key:f},d)))),wp.element.createElement("tbody",null,[...new Array(c).keys()].map(d=>{const f=r?[d,i]:[d];return wp.element.createElement("tr",{key:d},t.getDatesInWeek(...f).map((h,p)=>h?wp.element.createElement(pG,{key:p,state:t,date:h,currentMonth:i}):wp.element.createElement("td",{key:p})))})))},"CalendarGrid");var OG=Object.defineProperty,vy=u((t,e)=>OG(t,"name",{value:e,configurable:!0}),"e");const Dh=vy(({date:t,children:e})=>{const{setDateValue:n}=kh();return wp.element.createElement(se,{onPress:vy(()=>{n(t)},"onPress")},e)},"Preset"),bG=vy(()=>{const t=Cr(kr());return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Dh,{date:{start:t,end:t}},"Today"),wp.element.createElement(Dh,{date:{start:t.subtract({weeks:1}),end:t}},"Last Week"),wp.element.createElement(Dh,{date:{start:Gi(t),end:ma(t)}},"This Month"),wp.element.createElement(Dh,{date:{start:Gi(t.subtract({months:1})),end:ma(t.subtract({months:1}))}},"Last Month"))},"DateRangePresets");var yG=Object.defineProperty,vG=u((t,e)=>yG(t,"name",{value:e,configurable:!0}),"r$5");const rM=vG(t=>{const{locale:e}=Re(),{dateValue:n}=t.dateRange?kh():{},r=t.dateRange?EI({...t,value:n,locale:e,visibleDuration:{months:t.multiMonth},createCalendar:pg}):H2({...t,locale:e,createCalendar:pg}),i=wp.element.useRef(),{calendarProps:l,prevButtonProps:a,nextButtonProps:o,title:s}=t.dateRange?LV(t,r,i):IV(t,r);return wp.element.createElement("div",{className:"tf-calendar",...l,ref:i},wp.element.createElement("div",{className:"tf-calendar-header"},wp.element.createElement("div",{className:"tf-calendar-buttons"},wp.element.createElement(se,{...a},"<"),wp.element.createElement("div",{className:"tf-calendar-month"},s),wp.element.createElement(se,{...o},">"))),wp.element.createElement("div",{className:"tf-calendar-tables"},t.multiMonth===1||!t.dateRange?wp.element.createElement(nM,{state:r}):Array.from({length:t.multiMonth},(c,d)=>wp.element.createElement(nM,{key:d,state:r,dateRange:t.dateRange,offset:{months:d}}))),t.dateRange&&t.datePresets&&wp.element.createElement("div",{className:"tf-calendar-presets"},wp.element.createElement(bG,null)))},"Calendar");var $G=Object.defineProperty,wG=u((t,e)=>$G(t,"name",{value:e,configurable:!0}),"o$5");const iM=wG(({segment:t,state:e})=>{const n=wp.element.useRef(),{segmentProps:r}=yF(t,e,n);let i="tf-date-segment";return t.isPlaceholder&&(i+=" tf-date-segment-placeholder"),wp.element.createElement("div",{className:i,...r,ref:n},wp.element.createElement("span",{"aria-hidden":"true"},t.placeholder),t.isPlaceholder?"":t.text)},"DateSegment");var xG=Object.defineProperty,SG=u((t,e)=>xG(t,"name",{value:e,configurable:!0}),"a$5");const $y=SG(t=>{const{locale:e}=Re(),n=qP({...t,locale:e,createCalendar:pg}),r=wp.element.useRef(),{fieldProps:i}=A2(t,n,r);return wp.element.createElement("div",{className:"tf-date-field",...i,ref:r},n.segments.map((l,a)=>wp.element.createElement(iM,{key:a,segment:l,state:n})))},"DateField");var CG=Object.defineProperty,lM=u((t,e)=>CG(t,"name",{value:e,configurable:!0}),"i$6");const kG=wp.element.forwardRef(({datePickerProps:t,hasFutureOnly:e,state:n,...r},i)=>{const{groupProps:l,fieldProps:a,buttonProps:o,dialogProps:s,calendarProps:c,inputProps:d}=t,[f,h]=wp.element.useState(r.value);wp.element.useEffect(()=>{r.value!==f&&h(r.value)},[r.value]),wp.element.useEffect(()=>(document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)),[i]);const p=lM(g=>{const O=i.current??!1;O&&(O.contains(g.target)||n.setOpen(!1))},"onClickOutside");o.onPress=()=>n.setOpen(!n.isOpen);const m=lM(()=>n.value&&n.value.toString?n.value.toString():"","getStringValue");return wp.element.useEffect(()=>{if(r.onChange&&r.onChange(m()),e&&n.value&&r.value){const g=Cr(kr());n.value.compare(g)<0&&n.setValue(g)}},[n.value]),wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...d,type:"hidden",name:r.name??"",value:m()}),wp.element.createElement("div",{className:"tf-date-group",...l,ref:i},wp.element.createElement($y,{...a}),wp.element.createElement(se,{type:"action",...o},"\u{1F5D3}")),n.isOpen&&wp.element.createElement(Rr,{state:n,triggerRef:i,placement:"bottom start"},wp.element.createElement(Os,{...s},wp.element.createElement(rM,{...c}))))});var DG=Object.defineProperty,PG=u((t,e)=>DG(t,"name",{value:e,configurable:!0}),"c$8");const EG=PG(t=>{const[e,n]=wp.element.useState(t.value??"");wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=II({...t,value:Ch(t.value,i)}),o=wp.element.useRef(null),{labelProps:s,descriptionProps:c,inputProps:d,...f}=gF({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Cs,{...t,value:e,onValueSelection:n,ref:o,inputProps:f.inputProps},wp.element.createElement(kG,{ref:o,minValue:l,name:t.name??"",value:Ch(e),onChange:n,onFocusChange:t.onFocusChange??!1,dynamic:t.dynamic??!1,hasFutureOnly:r,state:a,datePickerProps:{inputProps:d,...f}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"Date");var TG=Object.defineProperty,AG=u((t,e)=>TG(t,"name",{value:e,configurable:!0}),"d$6");const QG=wp.element.forwardRef(({dateRangePickerProps:t,state:e,...n},r)=>{const{dateValue:i}=kh(),[l,a]=wp.element.useState(i!==null?i.start:"");wp.element.useEffect(()=>{n.value&&n.value!==l&&a(n.value.start)},[n.value]);const{groupProps:o,startFieldProps:s,endFieldProps:c,buttonProps:d,dialogProps:f,calendarProps:h,inputProps:p}=Q2(n,e,r),m=AG(()=>e.value&&e.value.start&&e.value.end?JSON.stringify({start:e.value.start.toString(),end:e.value.end.toString()}):"","getStringValue");return wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...p,type:"hidden",name:n.name??"",value:m()}),wp.element.createElement("div",{...o,ref:r,className:"tf-date-group"},wp.element.createElement($y,{...s}),wp.element.createElement("span",{style:{padding:"0 4px"}},"\u2013"),wp.element.createElement($y,{...c}),e.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}"),wp.element.createElement(se,{type:"action",...d},"\u{1F5D3}")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:r,placement:"bottom start"},wp.element.createElement(Os,{...f},wp.element.createElement(rM,{...h,dateRange:!0,datePresets:n.datePresets??!1,pageBehavior:"single",multiMonth:n.multiMonth,focusedValue:l,onFocusChange:a}))))});var MG=Object.defineProperty,BG=u((t,e)=>MG(t,"name",{value:e,configurable:!0}),"o$4");const RG=BG(t=>{const{dateValue:e,setDateValue:n}=kh();wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{e!==t.value&&typeof t.value=="object"&&n(t.value)},[t.value]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=qI({...t,value:e}),o=wp.element.useRef(),{labelProps:s,descriptionProps:c,...d}=Q2({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Cs,{...t,value:e,ref:o},wp.element.createElement(QG,{ref:o,name:t.name??"",minValue:l,value:e,hasFutureOnly:r,onChange:n,onFocusChange:t.onFocusChange??null,state:a,multiMonth:t.multiMonth??1,datePresets:t.datePresets??!1,dateRangePickerProps:{...d}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"DateRange");var VG=Object.defineProperty,NG=u((t,e)=>VG(t,"name",{value:e,configurable:!0}),"r$4"),FG=NG(t=>t.dateRange?wp.element.createElement(dG,{value:t.value},wp.element.createElement(RG,{...t})):wp.element.createElement(EG,{...t}),"default"),IG=Object.defineProperty,aM=u((t,e)=>IG(t,"name",{value:e,configurable:!0}),"s$8");const wy={},LG=aM(t=>{const[e,n]=wp.element.useState(t.value??""),[r,i]=wp.element.useState(fi()),l=wp.element.useRef(null),a=wp.element.useRef(null),o=wp.element.useRef(null),{labelProps:s,inputProps:c,descriptionProps:d}=si(t,l);wp.element.useEffect(()=>{wy[r]=RT(l.current,e,n,t.choices)},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const f=pi({}),{triggerProps:h,overlayProps:p}=cs({type:"dialog"},f,a),m=aM(g=>{wy[r].dispatch({changes:{from:wy[r].state.doc.length,insert:`[[${g}]]`}})},"addDynamicElement");return wp.element.createElement("div",{className:"tf-dynamic-text"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement("div",{className:"tf-dynamic-text-field"},wp.element.createElement(gn,null,wp.element.createElement(K9,{label:t.label??!1,name:t.name??"",value:e})),wp.element.createElement("div",{ref:l,className:"tf-dynamic-text-input",...c}),wp.element.createElement(se,{type:"action",ref:a,...h},"Add"),f.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-text-popover",ref:o,...p},wp.element.createElement(Sh,{label:"Select dynamic token",labelVisuallyHidden:!0,choices:t.choices??{},autoFocus:!0,showButton:!1,onChange:g=>{g&&(m(g),f.close())},onFocusChange:g=>g?!f.isOpen&&f.open():f.close()}),wp.element.createElement(fs,{onDismiss:f.close}))),t.description&&wp.element.createElement(we,{descriptionProps:d,parent:t},t.description))},"DynamicText");function lt(t){this.content=t}u(lt,"OrderedMap"),lt.prototype={constructor:lt,find:function(t){for(var e=0;e>1}},lt.from=function(t){if(t instanceof lt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new lt(e)};function oM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),l=e.child(r);if(i==l){n+=i.nodeSize;continue}if(!i.sameMarkup(l))return n;if(i.isText&&i.text!=l.text){for(let a=0;i.text[a]==l.text[a];a++)n++;return n}if(i.content.size||l.content.size){let a=oM(i.content,l.content,n+1);if(a!=null)return a}n+=i.nodeSize}}u(oM,"findDiffStart");function sM(t,e,n,r){for(let i=t.childCount,l=e.childCount;;){if(i==0||l==0)return i==l?null:{a:n,b:r};let a=t.child(--i),o=e.child(--l),s=a.nodeSize;if(a==o){n-=s,r-=s;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let c=0,d=Math.min(a.text.length,o.text.length);for(;ce&&r(s,i+o,l||null,a)!==!1&&s.content.size){let d=o+1;s.nodesBetween(Math.max(0,e-d),Math.min(s.content.size,n-d),r,i+d)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let l="",a=!0;return this.nodesBetween(e,n,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,n-s):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&r&&(a?a=!1:l+=r),l+=c},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),l=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),l=1);le)for(let l=0,a=0;ae&&((an)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new st(r,i)}cutByIndex(e,n){return e==n?st.empty:e==0&&n==this.content.length?this:new st(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),l=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new st(i,l)}addToStart(e){return new st([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new st(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),l=r+i.nodeSize;if(l>=e)return l==e?Ph(n+1,l):Ph(n,r);r=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return st.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new st(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return st.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(l)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};u(kc,"Mark");let ye=kc;ye.none=[];const a$=class a$ extends Error{};u(a$,"ReplaceError");let Ha=a$;const Fi=class Fi{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cM(this.content,e+this.openStart,n);return r&&new Fi(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Fi(uM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Fi.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Fi(j.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let l=e.firstChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.firstChild)r++;for(let l=e.lastChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.lastChild)i++;return new Fi(e,r,i)}};u(Fi,"Slice");let H=Fi;H.empty=new H(j.empty,0,0);function uM(t,e,n){let{index:r,offset:i}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:o}=t.findIndex(n);if(i==e||l.isText){if(o!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,l.copy(uM(l.content,e-i-1,n-i-1)))}u(uM,"removeRange");function cM(t,e,n,r){let{index:i,offset:l}=t.findIndex(e),a=t.maybeChild(i);if(l==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=cM(a.content,e-l-1,n,a);return o&&t.replaceChild(i,a.copy(o))}u(cM,"insertInto");function zG(t,e,n){if(n.openStart>t.depth)throw new Ha("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ha("Inconsistent open depths");return dM(t,e,n,0)}u(zG,"replace");function dM(t,e,n,r){let i=t.index(r),l=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}u(Sl,"addNode");function Cu(t,e,n,r){let i=(e||t).node(n),l=0,a=e?e.index(n):i.childCount;t&&(l=t.index(n),t.depth>n?l++:t.textOffset&&(Sl(t.nodeAfter,r),l++));for(let o=l;oi&&Sy(t,e,i+1),a=r.depth>i&&Sy(n,r,i+1),o=[];return Cu(null,t,i,o),l&&a&&e.index(i)==n.index(i)?(fM(l,a),Sl(Cl(l,hM(t,e,n,r,i+1)),o)):(l&&Sl(Cl(l,Th(t,e,i+1)),o),Cu(e,n,i,o),a&&Sl(Cl(a,Th(n,r,i+1)),o)),Cu(r,null,i,o),new j(o)}u(hM,"replaceThreeWay");function Th(t,e,n){let r=[];if(Cu(null,t,n,r),t.depth>n){let i=Sy(t,e,n+1);Sl(Cl(i,Th(t,e,n+1)),r)}return Cu(e,null,n,r),new j(r)}u(Th,"replaceTwoWay");function ZG(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let l=n-1;l>=0;l--)i=e.node(l).copy(j.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}u(ZG,"prepareSliceForReplace");const Dc=class Dc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let l=0;l0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ja(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,l=n;for(let a=e;;){let{index:o,offset:s}=a.content.findIndex(l),c=l-s;if(r.push(a,o,i+s),!c||(a=a.child(o),a.isText))break;l=c-1,i+=s+1}return new Dc(n,r,l)}static resolveCached(e,n){let r=pM.get(e);if(r)for(let l=0;le&&this.nodesBetween(e,n,l=>(r.isInSet(l.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,i=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,l),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let s=i;sn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=j.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,i,r);return l.type.checkAttrs(l.attrs),l}},u(Gl,"Node"),Gl);kl.prototype.text=void 0;const Pc=class Pc extends kl{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Pc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Pc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};u(Pc,"TextNode");let ky=Pc;function mM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}u(mM,"wrapMarks");const Kp=class Kp{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Dy(e,n);if(r.next==null)return Kp.empty;let i=gM(r);r.next&&r.err("Unexpected trailing text");let l=_G(GG(i));return HG(l,r),l}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let l=i+(r.validEnd?"*":" ")+" ";for(let a=0;a"+e.indexOf(r.next[a].next);return l}).join(` +}`,{label:"class",detail:"definition",type:"keyword"}),Zt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Zt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],sU=gQ.concat([Zt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Zt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Zt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),OQ=new If,bQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function xu(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}u(xu,"defID");const uU=["FunctionDeclaration"],cU={FunctionDeclaration:xu("function"),ClassDeclaration:xu("class"),ClassExpression:()=>!0,EnumDeclaration:xu("constant"),TypeAliasDeclaration:xu("type"),NamespaceDeclaration:xu("namespace"),VariableDefinition(t,e){t.matchContext(uU)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function yQ(t,e){let n=OQ.get(e);if(n)return n;let r=[],i=!0;function l(a,o){let s=t.sliceString(a.from,a.to);r.push({label:s,type:o})}return u(l,"def"),e.cursor(Ae.IncludeAnonymous).iterate(a=>{if(i)i=!1;else if(a.name){let o=cU[a.name];if(o&&o(a,l)||bQ.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of yQ(t,a.node))r.push(o);return!1}}),OQ.set(e,r),r}u(yQ,"getScope");const vQ=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,$Q=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function dU(t){let e=ze(t.state).resolveInner(t.pos,-1);if($Q.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&vQ.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)bQ.has(i.name)&&(r=r.concat(yQ(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:vQ}}u(dU,"localCompletionSource");const or=lu.define({name:"javascript",parser:oU.configure({props:[Uf.add({IfStatement:Gf({except:/^\s*({|else\b)/}),TryStatement:Gf({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Ej,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:Pj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Gf({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),_f.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":s7,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),wQ={test:t=>/^JSX/.test(t.name),facet:n7({commentTokens:{block:{open:"{/*",close:"*/}"}}})},xQ=or.configure({dialect:"ts"},"typescript"),SQ=or.configure({dialect:"jsx",props:[sb.add(t=>t.isTop?[wQ]:void 0)]}),CQ=or.configure({dialect:"jsx ts",props:[sb.add(t=>t.isTop?[wQ]:void 0)]},"typescript");let kQ=u(t=>({label:t,type:"keyword"}),"kwCompletion");const DQ="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kQ),fU=DQ.concat(["declare","implements","private","protected","public"].map(kQ));function hU(t={}){let e=t.jsx?t.typescript?CQ:SQ:t.typescript?xQ:or,n=t.typescript?sU.concat(fU):gQ.concat(DQ);return new su(e,[or.data.of({autocomplete:OW($Q,hA(n))}),or.data.of({autocomplete:dU}),t.jsx?gU:[]])}u(hU,"javascript");function pU(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}u(pU,"findOpenTag");function PQ(t,e,n=t.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}u(PQ,"elementName$1");const mU=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),gU=J.inputHandler.of((t,e,n,r,i)=>{if((mU?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!or.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c;let{head:d}=s,f=ze(a).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(a.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:s,changes:{from:d,insert:""}};if(r=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=PQ(a.doc,m.firstChild,d))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:X.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let p=pU(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(h=PQ(a.doc,p,d)))return{range:s,changes:{from:d,insert:``}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Su=["_blank","_self","_top","_parent"],my=["ascii","utf-8","utf-16","latin1","latin1"],gy=["get","post","put","delete"],Oy=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],rn=["true","false"],te={},OU={a:{attrs:{href:null,ping:null,type:null,media:null,target:Su,hreflang:null}},abbr:te,address:te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:te,aside:te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:te,base:{attrs:{href:null,target:Su}},bdi:te,bdo:te,blockquote:{attrs:{cite:null}},body:te,br:te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Oy,formmethod:gy,formnovalidate:["novalidate"],formtarget:Su,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:te,center:te,cite:te,code:te,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:te,div:te,dl:te,dt:te,em:te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:te,figure:te,footer:te,form:{attrs:{action:null,name:null,"accept-charset":my,autocomplete:["on","off"],enctype:Oy,method:gy,novalidate:["novalidate"],target:Su}},h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:te,hgroup:te,hr:te,html:{attrs:{manifest:null}},i:te,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Oy,formmethod:gy,formnovalidate:["novalidate"],formtarget:Su,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:te,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:my,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:te,noscript:te,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:te,param:{attrs:{name:null,value:null}},pre:te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:te,rt:te,ruby:te,samp:te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:my}},section:te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:te,source:{attrs:{src:null,type:null,media:null}},span:te,strong:te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:te,summary:te,sup:te,table:te,tbody:te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:te,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:te,time:{attrs:{datetime:null}},title:te,tr:te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:te,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:te},EQ={accesskey:null,class:null,contenteditable:rn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:rn,autocorrect:rn,autocapitalize:rn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":rn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":rn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":rn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":rn,"aria-hidden":rn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":rn,"aria-multiselectable":rn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":rn,"aria-relevant":null,"aria-required":rn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},TQ="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of TQ)EQ[t]=null;let vh=(Cc=class{constructor(e,n){this.tags={...OU,...e},this.globalAttrs={...EQ,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}},u(Cc,"Schema"),Cc);vh.default=new vh;function Ga(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}u(Ga,"elementName");function _a(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}u(_a,"findParentElement");function AQ(t,e,n){let r=n.tags[Ga(t,_a(e))];return r?.children||n.allTags}u(AQ,"allowedChildren");function by(t,e){let n=[];for(let r=_a(e);r&&!r.type.isTop;r=_a(r.parent)){let i=Ga(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}u(by,"openTags");const QQ=/^[:\-\.\w\u00b7-\uffff]*$/;function MQ(t,e,n,r,i){let l=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",a=_a(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:AQ(t.doc,a,e).map(o=>({label:o,type:"type"})).concat(by(t.doc,n).map((o,s)=>({label:"/"+o,apply:"/"+o+l,type:"type",boost:99-s}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}u(MQ,"completeTag");function BQ(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:by(t.doc,e).map((l,a)=>({label:l,apply:l+i,type:"type",boost:99-a})),validFor:QQ}}u(BQ,"completeCloseTag");function bU(t,e,n,r){let i=[],l=0;for(let a of AQ(t.doc,n,e))i.push({label:"<"+a,type:"type"});for(let a of by(t.doc,n))i.push({label:"",type:"type",boost:99-l++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}u(bU,"completeStartTag");function yU(t,e,n,r,i){let l=_a(n),a=l?e.tags[Ga(t.doc,l)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],s=a&&a.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:s.map(c=>({label:c,type:"property"})),validFor:QQ}}u(yU,"completeAttrName");function vU(t,e,n,r,i){var l;let a=(l=n.parent)===null||l===void 0?void 0:l.getChild("AttributeName"),o=[],s;if(a){let c=t.sliceDoc(a.from,a.to),d=e.globalAttrs[c];if(!d){let f=_a(n),h=f?e.tags[Ga(t.doc,f)]:null;d=h?.attrs&&h.attrs[c]}if(d){let f=t.sliceDoc(r,i).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(s=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=t.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):s=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:h+m+p,type:"constant"})}}return{from:r,to:i,options:o,validFor:s}}u(vU,"completeAttrValue");function $U(t,e){let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.resolve(r);for(let a=r,o;l==i&&(o=i.childBefore(a));){let s=o.lastChild;if(!s||!s.type.isError||s.from$U(r,i)}u(wU,"htmlCompletionSourceWith");const xU=or.parser.configure({top:"SingleExpression"}),RQ=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:xQ.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:SQ.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:CQ.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:xU},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:or.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:yh.parser}],VQ=[{name:"style",parser:yh.parser.configure({top:"Styles"})}].concat(TQ.map(t=>({name:t,parser:or.parser}))),NQ=lu.define({name:"html",parser:UY.configure({props:[Uf.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),$h=NQ.configure({wrap:rQ(RQ,VQ)});function SU(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=rQ((t.nestedLanguages||[]).concat(RQ),(t.nestedAttributes||[]).concat(VQ)));let r=n?NQ.configure({wrap:n,dialect:e}):e?$h.configure({dialect:e}):$h;return new su(r,[$h.data.of({autocomplete:wU(t)}),t.autoCloseTags!==!1?CU:[],hU().support,TK().support])}u(SU,"html");const FQ=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),CU=J.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!$h.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c,d,f;let h=a.doc.sliceString(s.from-1,s.to)==r,{head:p}=s,m=ze(a).resolveInner(p,-1),g;if(h&&r==">"&&m.name=="EndTag"){let O=m.parent;if(((d=(c=O.parent)===null||c===void 0?void 0:c.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=Ga(a.doc,O.parent,p))&&!FQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=``;return{range:s,changes:{from:p,to:b,insert:y}}}}else if(h&&r=="/"&&m.name=="IncompleteCloseTag"){let O=m.parent;if(m.from==p-2&&((f=O.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=Ga(a.doc,O,p))&&!FQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=`${g}>`;return{range:X.cursor(p+y.length,-1),changes:{from:p,to:b,insert:y}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var kU=Object.defineProperty,IQ=u((t,e)=>kU(t,"name",{value:e,configurable:!0}),"i$c");const DU=IQ((t,e=!1)=>{const n=[QX(),RX(),aX(),fq(),zj(),HZ(),uu.of(" "),Aj(),_j(),qW(),tY(),OX(),vX(),cX(),iY(),Pf.of([mW,...KW,...pW,...$q,...Fj,...TA]),SU(),Xj(qj,{fallback:!0}),J.updateListener.of(r=>{r.docChanged&&e&&e(r.state.doc.toString())}),J.lineWrapping];return Xe.create({doc:t,extensions:n})},"createEditorState"),PU=IQ((t,e)=>new J({state:t,parent:e,lineWrapping:!0}),"createEditorView");var EU=Object.defineProperty,TU=u((t,e)=>EU(t,"name",{value:e,configurable:!0}),"i$b");const LQ=TU(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(null),i=wp.element.useRef(null);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{if(i.current)return;const l=DU(t.value??"",n);i.current=PU(l,r.current)},[r.current]),wp.element.createElement("div",{className:"tf-code"},wp.element.createElement("div",{className:"tf-code-editor",ref:r}))},"Editor");var AU=Object.defineProperty,QU=u((t,e)=>AU(t,"name",{value:e,configurable:!0}),"n$c");const MU=QU(t=>{const e=wp.element.useRef(null),[n,r]=wp.element.useState(t.value??""),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]),wp.element.createElement("div",{className:"tf-code"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",value:n,ref:e,name:t.name??""}),wp.element.createElement(LQ,{...t,value:n,onChange:r}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Code");var BU=Object.defineProperty,RU=u((t,e)=>BU(t,"name",{value:e,configurable:!0}),"c$e");const VU=RU(t=>{const e=wp.element.useRef(null),n=wp.element.useRef(null),r=wp.element.useRef(null),i=lN(t),{colorAreaProps:l,gradientProps:a,xInputProps:o,yInputProps:s,thumbProps:c}=yN({...t,inputXRef:e,inputYRef:n,containerRef:r},i),{focusProps:d}=is();return wp.element.createElement("div",{className:"tf-color-area",ref:r,style:l.style,...l},wp.element.createElement("div",{className:"tf-color-area-gradient",style:a?.style,...a}),wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...c.style,background:i.getDisplayColor().toString("css")},...c},wp.element.createElement("input",{ref:e,...o,...d}),wp.element.createElement("input",{ref:n,...s,...d})))},"ColorArea");var NU=Object.defineProperty,FU=u((t,e)=>NU(t,"name",{value:e,configurable:!0}),"c$d");const zQ=FU(t=>{const{locale:e}=Re(),n=cN({...t,locale:e}),r=wp.element.useRef(),i=wp.element.useRef(),l=t.label||n.value.getChannelName(t.channel,e),{trackProps:a,thumbProps:o,inputProps:s,labelProps:c,outputProps:d}=wN({...t,label:l,trackRef:r,inputRef:i},n),{focusProps:f}=is();return wp.element.createElement("div",{className:"tf-color-slider"},wp.element.createElement("div",{className:"tf-color-slider-label"},wp.element.createElement("label",{...c},l),wp.element.createElement("output",{...d},n.value.formatChannelValue(t.channel,e))),wp.element.createElement("div",{className:"tf-color-slider-container",ref:r,style:a.style,...a},wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...o.style,background:n.getDisplayColor().toString("css")},...o},wp.element.createElement(gn,null,wp.element.createElement("input",{ref:i,...s,...f})))))},"ColorSlider");var IU=Object.defineProperty,LU=u((t,e)=>IU(t,"name",{value:e,configurable:!0}),"t$7");const ZQ=LU(t=>{const[e,n]=wp.element.useState(mn(t.value&&t.value!==""?t.value:"rgba(255, 255, 255, 1)").toHSB()),[r,i,l]=e.getColorChannels(),[a,o]=wp.element.useState(t.value);wp.element.useEffect(()=>{o(t.value)},[t.value]),wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]);const{focusWithinProps:s}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}}),c=t.hasAlpha??!0;return wp.element.createElement("div",{className:"tf-color-picker",...s},wp.element.createElement(Os,null,wp.element.createElement($d,{autoFocus:!0,restoreFocus:!0},wp.element.createElement(VU,{"aria-labelledby":"hsb-label-id-1",value:e,onChange:n,xChannel:i,yChannel:l}),wp.element.createElement("div",{className:"tf-color-input"},wp.element.createElement("label",null,"Color"),wp.element.createElement("input",{type:"text",value:a,onChange:d=>{o(d.target.value)},onBlur:d=>{t.onChange(d.target.value)}})),wp.element.createElement("div",{className:"tf-color-sliders"},wp.element.createElement(zQ,{channel:r,value:e,onChange:n}),c&&wp.element.createElement(zQ,{channel:"alpha",value:e,onChange:n})))))},"ColorPicker");var zU=Object.defineProperty,ZU=u((t,e)=>zU(t,"name",{value:e,configurable:!0}),"c$c");const XU=wp.element.forwardRef(({inputProps:t,state:e,...n},r)=>{const[i,l]=wp.element.useState(!1),a=n.format??"hexa",o=wp.element.useRef(),s=ZU(c=>{const d=c.toString?c.toString(a):"";e.setInputValue(d),n.onChange&&n.onChange(d)},"onChange");return wp.element.useEffect(()=>e.setInputValue(e.colorValue?.toString(a)),[]),wp.element.createElement("div",{className:"tf-color-container",ref:o},wp.element.createElement("input",{ref:r,...t,onClick:()=>l(!0),value:e.inputValue??""}),i&&wp.element.createElement(Rr,{state:{isOpen:i,close:()=>l(!1)},triggerRef:r,placement:"bottom start",style:{width:o?.current?.offsetWidth},className:"tf-color-popover"},wp.element.createElement(ZQ,{value:e.colorValue?.toString(a),onChange:s,hasAlpha:n.hasAlpha??!0,onFocusChange:c=>l(c)})))});var jU=Object.defineProperty,qU=u((t,e)=>jU(t,"name",{value:e,configurable:!0}),"n$b");const XQ=qU(t=>{let e;typeof t.value=="object"?e=t.value?.value||"#FFFFFF":e=t?.value||"#FFFFFF";const n={...t,value:e},r=wp.element.useRef(),i=hN(n),{labelProps:l,inputProps:a,descriptionProps:o}=SN(n,i,r),[s,c]=wp.element.useState(n.value??"");return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement("div",{className:"tf-color"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(Cs,{...n,value:s,onValueSelection:c,inputProps:a,ref:r},wp.element.createElement(XU,{...n,value:s,onChange:t.onChange,state:i,inputProps:a,ref:r})),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Color");var WU=Object.defineProperty,jQ=u((t,e)=>WU(t,"name",{value:e,configurable:!0}),"c$b");const YU=jQ((t,e)=>{const{api:n,fetchResponse:r}=yr();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(t,{method:"POST",body:e,headers:{"X-WP-Nonce":n.nonce??!1,enctype:"multipart/form-data"},credentials:"same-origin",processData:!1,contentType:!1}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"post"),qQ=jQ((t,e=!1)=>{const{api:n,fetchResponse:r}=yr();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(`${t}?${e?new URLSearchParams(e):""}`,{method:"GET",headers:{"X-WP-Nonce":n.nonce??!1},credentials:"same-origin"}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"get");var KU=Object.defineProperty,yy=u((t,e)=>KU(t,"name",{value:e,configurable:!0}),"i$a");const UU=yy(t=>{const e=wp.element.useRef({status:!1,callback:!1,firstLoad:!0}),n=UI({async load({filterText:r}){if(e.current.firstLoad)e.current.firstLoad=!1;else{if(e.current.status==="waiting"){const o=t.debounceTime??200;clearTimeout(e.current.callback),e.current={status:"waiting",callback:setTimeout(()=>{e.current.status=!1,n.setFilterText(r)},o)};return}e.current.status="waiting"}const i={...t.asyncArgs??{},search:r};let l=t.ajaxAction?await Tangible?.ajax(t.ajaxAction,i):await qQ(t.searchUrl??"",i);l.length===0&&l.push({id:"_noResults",title:"No results"}),!Array.isArray(l)&&typeof l=="object"&&(l=Object.values(l).map(o=>o));const a=t.mapResults?GU(l,t.mapResults):l;return{items:rl((a??[]).reduce((o,s)=>({...o,[s.id]:s.title}),{}))}}});return{items:n.items,inputValue:n.filterText,onInputChange:n.setFilterText,selectedKeys:t.value.value??"",loadingState:n.loadingState}},"getAsyncProps"),GU=yy((t,e)=>t.map(n=>(e.id&&(n.id=WQ(n,e.id)),e.title&&(n.title=WQ(n,e.title)),n)),"mapResults"),WQ=yy((t,e)=>typeof e=="object"?t[e.key][e.attribute]:t[e],"mapResultsItem");var _U=Object.defineProperty,wh=u((t,e)=>_U(t,"name",{value:e,configurable:!0}),"n$a");const YQ=wh((t,e,n)=>{if(!e.isAsync){e.onSelectionChange&&e.onSelectionChange(t);return}const r=W2(t,e.items);e.onSelectionChange&&e.onSelectionChange(r),e.multiple||n.setInputValue(r.label)},"onSelectionChange"),KQ=wh((t,e)=>t.isAsync&&t.selectedKey?e.setInputValue(t.selectedKey.label??""):null,"setInputValue"),UQ=wh(t=>t.isAsync&&t.selectedKey?.value?t.selectedKey.value:t.selectedKey??"","getSelectedKey"),GQ=wh(t=>[...t.disabledKeys??[],"_noResults"],"getDisabledKeys"),HU=wp.element.forwardRef(({parent:t,buttonProps:e,descriptionProps:n,labelProps:r,inputProps:i,listBoxProps:l,state:a,multiple:o=!1},s)=>{if(o)throw new Error("The simple layout does not support multiple values");const{focusWithinProps:c}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}});return wp.element.createElement("div",{className:"tf-combo-box",...c},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement($d,{autoFocus:t.autoFocus,restoreFocus:!0},wp.element.createElement("div",{className:"tf-combo-box-text",ref:s.current.wrapper},wp.element.createElement("input",{...i,ref:s.current.input,readOnly:t.readOnly}),t.showButton&&wp.element.createElement(se,{type:"action",ref:s.current.trigger,preventFocusOnPress:!0,...e,isDisabled:t.readOnly},wp.element.createElement("span",{"aria-hidden":"true"},"\u25BC")),a.isOpen&&!t.readOnly&&wp.element.createElement(Rr,{state:a,triggerRef:s.current.input,popoverRef:s.current.popover,placement:"bottom start",isNonModal:!0,style:{width:s.current.wrapper?.current?.offsetWidth},className:"tf-combo-box-popover"},wp.element.createElement(Nd,{loadingState:t.loadingState??"idle",listBoxRef:s.current.listbox,state:a,items:t.items,focusWithinProps:!0,shouldUseVirtualFocus:!0,...l})))),t.description&&wp.element.createElement(we,{descriptionProps:n,parent:t},t.description))}),JU=wp.element.forwardRef(({parent:t,descriptionProps:e,labelProps:n,inputProps:r,itemProps:i,multiple:l,state:a,...o},s)=>{if(!l)throw new Error("The simple-multiple layout only support multiple values");const{add:c,getDisabledValues:d,remove:f}=l,[h,p]=wp.element.useState(l.values??[]);wp.element.useEffect(()=>p(l.values),[l.values]);const m=wp.element.useRef(),g=pi({}),{triggerProps:O,overlayProps:b}=cs({type:"dialog"},g,m),y=Array.isArray(t.choices)?t.choices.reduce(($,v)=>({...$,...v.choices??{}}),{}):t.choices;return wp.element.createElement("div",{className:"tf-multiple-combobox","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("div",{className:"tf-multiple-combobox-container"},wp.element.createElement("div",{ref:s.current.input,className:"tf-multiple-combobox-values",...r},h.length===0?t.placeholder??"No item selected":h.map(($,v)=>wp.element.createElement("span",{key:$.key??v,className:"tf-combo-box-item"},wp.element.createElement("span",null,t.isAsync?$.label:y[$]??""),t.readOnly!==!0&&wp.element.createElement(se,{onPress:()=>f(v)},"x")))),wp.element.createElement(se,{type:"action",ref:m,...O,isDisabled:t.readOnly},"Add"),g.isOpen&&wp.element.createElement("div",{className:"tf-popover",ref:s.current.overlay,...b},wp.element.createElement(JQ,{focusStrategy:"first",label:"Select an item to add",labelVisuallyHidden:!0,description:!1,disabledKeys:d(),autoFocus:!0,multiple:!0,showButton:!1,menuTrigger:"focus",onSelectionChange:$=>{$&&(c($),g.close())},onFocusChange:$=>$?!g.isOpen&&g.open():g.close(),isAsync:t.isAsync??!1,...i},t.children),wp.element.createElement(fs,{onDismiss:g.close}))),t.description&&wp.element.createElement(we,{descriptionProps:e,parent:t},t.description))});var eG=Object.defineProperty,tG=u((t,e)=>eG(t,"name",{value:e,configurable:!0}),"i$8");const _Q={"simple-multiple":JU,simple:HU},HQ=tG(t=>typeof t=="string"?_Q[t]:["function","object"].includes(typeof t)?t:_Q[fallback],"getLayout");var nG=Object.defineProperty,rG=u((t,e)=>nG(t,"name",{value:e,configurable:!0}),"l$8"),JQ=rG(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef();wp.element.useEffect(()=>{KQ(t,o)},[]);const{contains:a}=Sg({sensitivity:"base"}),o=nP({...t,onSelectionChange:g=>YQ(g,t,o),selectedKey:UQ(t),defaultFilter:a,disabledKeys:GQ(t)}),{buttonProps:s,inputProps:c,listBoxProps:d,labelProps:f,descriptionProps:h}=YD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},o),p=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),m=HQ(t.layout??"simple");return wp.element.createElement(m,{parent:t,labelProps:f,descriptionProps:h,inputProps:c,buttonProps:s,listBoxProps:d,itemProps:t.itemProps,ref:p,state:o,multiple:!1})},"ComboBox"),iG=Object.defineProperty,xh=u((t,e)=>iG(t,"name",{value:e,configurable:!0}),"n$8");const lG=xh(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef(),[a,o]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value&&!t.isAsync?t.value.split(","):[]);wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a.length]),wp.element.useEffect(()=>{KQ(t,c)},[]);const{contains:s}=Sg({sensitivity:"base"}),c=nP({...t,onSelectionChange:v=>YQ(v,t,c),selectedKey:UQ(t),defaultFilter:s,disabledKeys:GQ(t)}),{buttonProps:d,inputProps:f,listBoxProps:h,labelProps:p,descriptionProps:m}=YD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},c),g=xh(v=>{a.indexOf(v)===-1&&o([...a,v])},"add"),O=xh(v=>{a[v]&&o([...a.slice(0,v),...a.slice(v+1)])},"remove"),b=xh(()=>t.isAsync?a.map(v=>v.value):a,"getDisabledValues"),y=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),$=HQ(t.layout??"simple-multiple");return wp.element.createElement($,{parent:t,labelProps:p,descriptionProps:m,inputProps:f,buttonProps:d,listBoxProps:h,itemProps:t.itemProps,ref:y,state:c,multiple:{getDisabledValues:b,add:g,remove:O,values:a}})},"MultipleComboBox");var aG=Object.defineProperty,oG=u((t,e)=>aG(t,"name",{value:e,configurable:!0}),"t$6"),Sh=oG(t=>{const[e,n]=wp.element.useState(t.isAsync?On(t.value??""):t.value??!1),r=t.isAsync?UU(t):{defaultItems:rl(t.choices??{})};return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[r.selectedKeys]),t.multiple?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(lG,{...t,onChange:i=>n(t.isAsync?i:i.join(",")),value:e,label:t.label??null,placeholder:t.placeholder,description:t.description??!1,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple-multiple",itemProps:r,...r},zd)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(JQ,{focusStrategy:"first",label:t.label??null,placeholder:t.placeholder,description:t.description??!1,selectedKey:e,onSelectionChange:n,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple",itemProps:r,...r},zd))},"default"),sG=Object.defineProperty,uG=u((t,e)=>sG(t,"name",{value:e,configurable:!0}),"i$7");const Ch=uG((t,e)=>{if(t instanceof Fe)return t;const n=String(t??"").split("-");return n.length===3?new Fe("AD",n[0],n[1],n[2]):e},"formatValue");var cG=Object.defineProperty,eM=u((t,e)=>cG(t,"name",{value:e,configurable:!0}),"o$7");const tM=wp.element.createContext(null),dG=eM(({value:t,children:e})=>{const n=On(t)??"",r=Cr(kr()),i={start:Ch(n.start??"",r),end:Ch(n.end??"",r)},[l,a]=wp.element.useState(i);return wp.element.createElement(tM.Provider,{value:{dateValue:l,setDateValue:a}},e)},"CalendarContextProvider"),kh=eM(()=>{const t=wp.element.useContext(tM);if(!t)throw new Error("useCalendarContext must be used within a Calendar");return t},"useCalendarContext");var fG=Object.defineProperty,hG=u((t,e)=>fG(t,"name",{value:e,configurable:!0}),"t$5");const pG=hG(({state:t,date:e})=>{const n=wp.element.useRef(),{cellProps:r,buttonProps:i,isSelected:l,isOutsideVisibleRange:a,isDisabled:o,isUnavailable:s,formattedDate:c}=ZV({date:e},t,n),{focusProps:d}=is();let f="tf-calendar-cell";return l&&(f+=" tf-calendar-cell-selected"),o&&(f+=" tf-calendar-cell-disabled"),s&&(f+=" tf-calendar-cell-unavailable"),wp.element.createElement("td",{...r},wp.element.createElement("div",{...ne(i,d),ref:n,hidden:a,className:f},c))},"CalendarCell");var mG=Object.defineProperty,gG=u((t,e)=>mG(t,"name",{value:e,configurable:!0}),"l$7");const nM=gG(({state:t,...e})=>{const{locale:n}=Re(),r=e.dateRange??!1,i=t.visibleRange.start.add(e.offset??{}),l=ma(i),{gridProps:a,headerProps:o,weekDays:s}=$x(r?{startDate:i,endDate:l}:e,t),c=L3(t.visibleRange.start,n);return wp.element.createElement("table",{className:"tf-calendar-table",...a},wp.element.createElement("thead",{...o},wp.element.createElement("tr",null,s.map((d,f)=>wp.element.createElement("th",{key:f},d)))),wp.element.createElement("tbody",null,[...new Array(c).keys()].map(d=>{const f=r?[d,i]:[d];return wp.element.createElement("tr",{key:d},t.getDatesInWeek(...f).map((h,p)=>h?wp.element.createElement(pG,{key:p,state:t,date:h,currentMonth:i}):wp.element.createElement("td",{key:p})))})))},"CalendarGrid");var OG=Object.defineProperty,vy=u((t,e)=>OG(t,"name",{value:e,configurable:!0}),"e");const Dh=vy(({date:t,children:e})=>{const{setDateValue:n}=kh();return wp.element.createElement(se,{onPress:vy(()=>{n(t)},"onPress")},e)},"Preset"),bG=vy(()=>{const t=Cr(kr());return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Dh,{date:{start:t,end:t}},"Today"),wp.element.createElement(Dh,{date:{start:t.subtract({weeks:1}),end:t}},"Last Week"),wp.element.createElement(Dh,{date:{start:Gi(t),end:ma(t)}},"This Month"),wp.element.createElement(Dh,{date:{start:Gi(t.subtract({months:1})),end:ma(t.subtract({months:1}))}},"Last Month"))},"DateRangePresets");var yG=Object.defineProperty,vG=u((t,e)=>yG(t,"name",{value:e,configurable:!0}),"r$5");const rM=vG(t=>{const{locale:e}=Re(),{dateValue:n}=t.dateRange?kh():{},r=t.dateRange?EI({...t,value:n,locale:e,visibleDuration:{months:t.multiMonth},createCalendar:pg}):H2({...t,locale:e,createCalendar:pg}),i=wp.element.useRef(),{calendarProps:l,prevButtonProps:a,nextButtonProps:o,title:s}=t.dateRange?LV(t,r,i):IV(t,r);return wp.element.createElement("div",{className:"tf-calendar",...l,ref:i},wp.element.createElement("div",{className:"tf-calendar-header"},wp.element.createElement("div",{className:"tf-calendar-buttons"},wp.element.createElement(se,{...a},"<"),wp.element.createElement("div",{className:"tf-calendar-month"},s),wp.element.createElement(se,{...o},">"))),wp.element.createElement("div",{className:"tf-calendar-tables"},t.multiMonth===1||!t.dateRange?wp.element.createElement(nM,{state:r}):Array.from({length:t.multiMonth},(c,d)=>wp.element.createElement(nM,{key:d,state:r,dateRange:t.dateRange,offset:{months:d}}))),t.dateRange&&t.datePresets&&wp.element.createElement("div",{className:"tf-calendar-presets"},wp.element.createElement(bG,null)))},"Calendar");var $G=Object.defineProperty,wG=u((t,e)=>$G(t,"name",{value:e,configurable:!0}),"o$6");const iM=wG(({segment:t,state:e})=>{const n=wp.element.useRef(),{segmentProps:r}=yF(t,e,n);let i="tf-date-segment";return t.isPlaceholder&&(i+=" tf-date-segment-placeholder"),wp.element.createElement("div",{className:i,...r,ref:n},wp.element.createElement("span",{"aria-hidden":"true"},t.placeholder),t.isPlaceholder?"":t.text)},"DateSegment");var xG=Object.defineProperty,SG=u((t,e)=>xG(t,"name",{value:e,configurable:!0}),"a$5");const $y=SG(t=>{const{locale:e}=Re(),n=qP({...t,locale:e,createCalendar:pg}),r=wp.element.useRef(),{fieldProps:i}=A2(t,n,r);return wp.element.createElement("div",{className:"tf-date-field",...i,ref:r},n.segments.map((l,a)=>wp.element.createElement(iM,{key:a,segment:l,state:n})))},"DateField");var CG=Object.defineProperty,lM=u((t,e)=>CG(t,"name",{value:e,configurable:!0}),"i$6");const kG=wp.element.forwardRef(({datePickerProps:t,hasFutureOnly:e,state:n,...r},i)=>{const{groupProps:l,fieldProps:a,buttonProps:o,dialogProps:s,calendarProps:c,inputProps:d}=t,[f,h]=wp.element.useState(r.value);wp.element.useEffect(()=>{r.value!==f&&h(r.value)},[r.value]),wp.element.useEffect(()=>(document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)),[i]);const p=lM(g=>{const O=i.current??!1;O&&(O.contains(g.target)||n.setOpen(!1))},"onClickOutside");o.onPress=()=>n.setOpen(!n.isOpen);const m=lM(()=>n.value&&n.value.toString?n.value.toString():"","getStringValue");return wp.element.useEffect(()=>{if(r.onChange&&r.onChange(m()),e&&n.value&&r.value){const g=Cr(kr());n.value.compare(g)<0&&n.setValue(g)}},[n.value]),wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...d,type:"hidden",name:r.name??"",value:m()}),wp.element.createElement("div",{className:"tf-date-group",...l,ref:i},wp.element.createElement($y,{...a}),wp.element.createElement(se,{type:"action",...o},"\u{1F5D3}")),n.isOpen&&wp.element.createElement(Rr,{state:n,triggerRef:i,placement:"bottom start"},wp.element.createElement(Os,{...s},wp.element.createElement(rM,{...c}))))});var DG=Object.defineProperty,PG=u((t,e)=>DG(t,"name",{value:e,configurable:!0}),"c$8");const EG=PG(t=>{const[e,n]=wp.element.useState(t.value??"");wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=II({...t,value:Ch(t.value,i)}),o=wp.element.useRef(null),{labelProps:s,descriptionProps:c,inputProps:d,...f}=gF({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Cs,{...t,value:e,onValueSelection:n,ref:o,inputProps:f.inputProps},wp.element.createElement(kG,{ref:o,minValue:l,name:t.name??"",value:Ch(e),onChange:n,onFocusChange:t.onFocusChange??!1,dynamic:t.dynamic??!1,hasFutureOnly:r,state:a,datePickerProps:{inputProps:d,...f}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"Date");var TG=Object.defineProperty,AG=u((t,e)=>TG(t,"name",{value:e,configurable:!0}),"d$6");const QG=wp.element.forwardRef(({dateRangePickerProps:t,state:e,...n},r)=>{const{dateValue:i}=kh(),[l,a]=wp.element.useState(i!==null?i.start:"");wp.element.useEffect(()=>{n.value&&n.value!==l&&a(n.value.start)},[n.value]);const{groupProps:o,startFieldProps:s,endFieldProps:c,buttonProps:d,dialogProps:f,calendarProps:h,inputProps:p}=Q2(n,e,r),m=AG(()=>e.value&&e.value.start&&e.value.end?JSON.stringify({start:e.value.start.toString(),end:e.value.end.toString()}):"","getStringValue");return wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...p,type:"hidden",name:n.name??"",value:m()}),wp.element.createElement("div",{...o,ref:r,className:"tf-date-group"},wp.element.createElement($y,{...s}),wp.element.createElement("span",{style:{padding:"0 4px"}},"\u2013"),wp.element.createElement($y,{...c}),e.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}"),wp.element.createElement(se,{type:"action",...d},"\u{1F5D3}")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:r,placement:"bottom start"},wp.element.createElement(Os,{...f},wp.element.createElement(rM,{...h,dateRange:!0,datePresets:n.datePresets??!1,pageBehavior:"single",multiMonth:n.multiMonth,focusedValue:l,onFocusChange:a}))))});var MG=Object.defineProperty,BG=u((t,e)=>MG(t,"name",{value:e,configurable:!0}),"o$5");const RG=BG(t=>{const{dateValue:e,setDateValue:n}=kh();wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{e!==t.value&&typeof t.value=="object"&&n(t.value)},[t.value]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=qI({...t,value:e}),o=wp.element.useRef(),{labelProps:s,descriptionProps:c,...d}=Q2({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Cs,{...t,value:e,ref:o},wp.element.createElement(QG,{ref:o,name:t.name??"",minValue:l,value:e,hasFutureOnly:r,onChange:n,onFocusChange:t.onFocusChange??null,state:a,multiMonth:t.multiMonth??1,datePresets:t.datePresets??!1,dateRangePickerProps:{...d}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"DateRange");var VG=Object.defineProperty,NG=u((t,e)=>VG(t,"name",{value:e,configurable:!0}),"r$4"),FG=NG(t=>t.dateRange?wp.element.createElement(dG,{value:t.value},wp.element.createElement(RG,{...t})):wp.element.createElement(EG,{...t}),"default"),IG=Object.defineProperty,aM=u((t,e)=>IG(t,"name",{value:e,configurable:!0}),"s$7");const wy={},LG=aM(t=>{const[e,n]=wp.element.useState(t.value??""),[r,i]=wp.element.useState(fi()),l=wp.element.useRef(null),a=wp.element.useRef(null),o=wp.element.useRef(null),{labelProps:s,inputProps:c,descriptionProps:d}=si(t,l);wp.element.useEffect(()=>{wy[r]=RT(l.current,e,n,t.choices)},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const f=pi({}),{triggerProps:h,overlayProps:p}=cs({type:"dialog"},f,a),m=aM(g=>{wy[r].dispatch({changes:{from:wy[r].state.doc.length,insert:`[[${g}]]`}})},"addDynamicElement");return wp.element.createElement("div",{className:"tf-dynamic-text"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement("div",{className:"tf-dynamic-text-field"},wp.element.createElement(gn,null,wp.element.createElement(K9,{label:t.label??!1,name:t.name??"",value:e})),wp.element.createElement("div",{ref:l,className:"tf-dynamic-text-input",...c}),wp.element.createElement(se,{type:"action",ref:a,...h},"Add"),f.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-text-popover",ref:o,...p},wp.element.createElement(Sh,{label:"Select dynamic token",labelVisuallyHidden:!0,choices:t.choices??{},autoFocus:!0,showButton:!1,onChange:g=>{g&&(m(g),f.close())},onFocusChange:g=>g?!f.isOpen&&f.open():f.close()}),wp.element.createElement(fs,{onDismiss:f.close}))),t.description&&wp.element.createElement(we,{descriptionProps:d,parent:t},t.description))},"DynamicText");function lt(t){this.content=t}u(lt,"OrderedMap"),lt.prototype={constructor:lt,find:function(t){for(var e=0;e>1}},lt.from=function(t){if(t instanceof lt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new lt(e)};function oM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),l=e.child(r);if(i==l){n+=i.nodeSize;continue}if(!i.sameMarkup(l))return n;if(i.isText&&i.text!=l.text){for(let a=0;i.text[a]==l.text[a];a++)n++;return n}if(i.content.size||l.content.size){let a=oM(i.content,l.content,n+1);if(a!=null)return a}n+=i.nodeSize}}u(oM,"findDiffStart");function sM(t,e,n,r){for(let i=t.childCount,l=e.childCount;;){if(i==0||l==0)return i==l?null:{a:n,b:r};let a=t.child(--i),o=e.child(--l),s=a.nodeSize;if(a==o){n-=s,r-=s;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let c=0,d=Math.min(a.text.length,o.text.length);for(;ce&&r(s,i+o,l||null,a)!==!1&&s.content.size){let d=o+1;s.nodesBetween(Math.max(0,e-d),Math.min(s.content.size,n-d),r,i+d)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let l="",a=!0;return this.nodesBetween(e,n,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,n-s):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&r&&(a?a=!1:l+=r),l+=c},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),l=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),l=1);le)for(let l=0,a=0;ae&&((an)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new st(r,i)}cutByIndex(e,n){return e==n?st.empty:e==0&&n==this.content.length?this:new st(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),l=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new st(i,l)}addToStart(e){return new st([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new st(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),l=r+i.nodeSize;if(l>=e)return l==e?Ph(n+1,l):Ph(n,r);r=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return st.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new st(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return st.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(l)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};u(kc,"Mark");let ye=kc;ye.none=[];const a$=class a$ extends Error{};u(a$,"ReplaceError");let Ha=a$;const Fi=class Fi{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cM(this.content,e+this.openStart,n);return r&&new Fi(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Fi(uM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Fi.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Fi(j.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let l=e.firstChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.firstChild)r++;for(let l=e.lastChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.lastChild)i++;return new Fi(e,r,i)}};u(Fi,"Slice");let H=Fi;H.empty=new H(j.empty,0,0);function uM(t,e,n){let{index:r,offset:i}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:o}=t.findIndex(n);if(i==e||l.isText){if(o!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,l.copy(uM(l.content,e-i-1,n-i-1)))}u(uM,"removeRange");function cM(t,e,n,r){let{index:i,offset:l}=t.findIndex(e),a=t.maybeChild(i);if(l==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=cM(a.content,e-l-1,n,a);return o&&t.replaceChild(i,a.copy(o))}u(cM,"insertInto");function zG(t,e,n){if(n.openStart>t.depth)throw new Ha("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ha("Inconsistent open depths");return dM(t,e,n,0)}u(zG,"replace");function dM(t,e,n,r){let i=t.index(r),l=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}u(Sl,"addNode");function Cu(t,e,n,r){let i=(e||t).node(n),l=0,a=e?e.index(n):i.childCount;t&&(l=t.index(n),t.depth>n?l++:t.textOffset&&(Sl(t.nodeAfter,r),l++));for(let o=l;oi&&Sy(t,e,i+1),a=r.depth>i&&Sy(n,r,i+1),o=[];return Cu(null,t,i,o),l&&a&&e.index(i)==n.index(i)?(fM(l,a),Sl(Cl(l,hM(t,e,n,r,i+1)),o)):(l&&Sl(Cl(l,Th(t,e,i+1)),o),Cu(e,n,i,o),a&&Sl(Cl(a,Th(n,r,i+1)),o)),Cu(r,null,i,o),new j(o)}u(hM,"replaceThreeWay");function Th(t,e,n){let r=[];if(Cu(null,t,n,r),t.depth>n){let i=Sy(t,e,n+1);Sl(Cl(i,Th(t,e,n+1)),r)}return Cu(e,null,n,r),new j(r)}u(Th,"replaceTwoWay");function ZG(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let l=n-1;l>=0;l--)i=e.node(l).copy(j.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}u(ZG,"prepareSliceForReplace");const Dc=class Dc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let l=0;l0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ja(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,l=n;for(let a=e;;){let{index:o,offset:s}=a.content.findIndex(l),c=l-s;if(r.push(a,o,i+s),!c||(a=a.child(o),a.isText))break;l=c-1,i+=s+1}return new Dc(n,r,l)}static resolveCached(e,n){let r=pM.get(e);if(r)for(let l=0;le&&this.nodesBetween(e,n,l=>(r.isInSet(l.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,i=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,l),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let s=i;sn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=j.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,i,r);return l.type.checkAttrs(l.attrs),l}},u(Gl,"Node"),Gl);kl.prototype.text=void 0;const Pc=class Pc extends kl{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Pc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Pc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};u(Pc,"TextNode");let ky=Pc;function mM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}u(mM,"wrapMarks");const Kp=class Kp{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Dy(e,n);if(r.next==null)return Kp.empty;let i=gM(r);r.next&&r.err("Unexpected trailing text");let l=_G(GG(i));return HG(l,r),l}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let l=i+(r.validEnd?"*":" ")+" ";for(let a=0;a"+e.indexOf(r.next[a].next);return l}).join(` `)}};u(Kp,"ContentMatch");let Dl=Kp;Dl.empty=new Dl(!0);const u$=class u${constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};u(u$,"TokenStream");let Dy=u$;function gM(t){let e=[];do e.push(qG(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}u(gM,"parseExpr");function qG(t){let e=[];do e.push(WG(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}u(qG,"parseExprSeq");function WG(t){let e=UG(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=YG(t,e);else break;return e}u(WG,"parseExprSubscript");function OM(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}u(OM,"parseNum");function YG(t,e){let n=OM(t),r=n;return t.eat(",")&&(t.next!="}"?r=OM(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}u(YG,"parseExprRange");function KG(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let l in n){let a=n[l];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}u(KG,"resolveName");function UG(t){if(t.eat("(")){let e=gM(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=KG(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}u(UG,"parseExprAtom");function GG(t){let e=[[]];return i(l(t,0),n()),e;function n(){return e.push([])-1}u(n,"node");function r(a,o,s){let c={term:s,to:o};return e[a].push(c),c}u(r,"edge");function i(a,o){a.forEach(s=>s.to=o)}u(i,"connect");function l(a,o){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(l(c,o)),[]);if(a.type=="seq")for(let s=0;;s++){let c=l(a.exprs[s],o);if(s==a.exprs.length-1)return c;i(c,o=n())}else if(a.type=="star"){let s=n();return r(o,s),i(l(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(l(a.expr,o),s),i(l(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(o)].concat(l(a.expr,o));if(a.type=="range"){let s=o;for(let c=0;c{t[a].forEach(({term:o,to:s})=>{if(!o)return;let c;for(let d=0;d{c||i.push([o,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let l=e[r.join(",")]=new Dl(r.indexOf(t.length-1)>-1);for(let a=0;a-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:$M(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kl(this,this.computeAttrs(e),j.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=j.from(n),this.checkContent(n),new kl(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=j.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),l=i&&i.fillBefore(j.empty,!0);return l?new kl(this,e,n.append(l),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[l]=new Ao(l,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let l in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}},u(Ao,"NodeType"),Ao);function JG(t,e,n){let r=n.split("|");return i=>{let l=i===null?"null":typeof i;if(r.indexOf(l)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${l}`)}}u(JG,"validateType");const c$=class c${constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?JG(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}};u(c$,"Attribute");let Py=c$;const Up=class Up{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=xM(e,i.attrs),this.excluded=null;let l=vM(this.attrs);this.instance=l?new ye(this,l):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,$M(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((l,a)=>r[l]=new Up(l,i++,n,a)),r}removeFromSet(e){for(var n=0;n-1}};u(Up,"MarkType");let Qh=Up;const d$=class d${constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=lt.from(e.nodes),n.marks=lt.from(e.marks||{}),this.nodes=SM.compile(this.spec.nodes,this),this.marks=Qh.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let l=this.nodes[i],a=l.spec.content||"",o=l.spec.marks;if(l.contentMatch=r[a]||(r[a]=Dl.parse(a,this.nodes)),l.inlineContent=l.contentMatch.inlineContent,l.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!l.isInline||!l.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=l}l.markSet=o=="_"?null:o?CM(this,o.split(" ")):o==""||!l.inlineContent?[]:null}for(let i in this.marks){let l=this.marks[i],a=l.spec.excludes;l.excluded=a==null?[l]:a==""?[]:CM(this,a.split(" "))}this.nodeFromJSON=i=>kl.fromJSON(this,i),this.markFromJSON=i=>ye.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof SM){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new ky(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};u(d$,"Schema");let Mh=d$;function CM(t,e){let n=[];for(let r=0;r-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}u(CM,"gatherMarks");function e_(t){return t.tag!=null}u(e_,"isTagRule");function t_(t){return t.style!=null}u(t_,"isStyleRule");const Ec=class Ec{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(e_(i))this.tags.push(i);else if(t_(i)){let l=/[^=]*/.exec(i.style)[0];r.indexOf(l)<0&&r.push(l),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let l=e.nodes[i.node];return l.contentMatch.matchType(l)})}parse(e,n={}){let r=new Bh(this,n,!1);return r.addAll(e,ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Bh(this,n,!0);return r.addAll(e,ye.none,n.from,n.to),H.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(e){let n=[];function r(i){let l=i.priority==null?50:i.priority,a=0;for(;a{r(a=EM(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let l=e.nodes[i].spec.parseDOM;l&&l.forEach(a=>{r(a=EM(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ec(e,Ec.schemaRules(e)))}};u(Ec,"DOMParser");let ku=Ec;const kM={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},n_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},DM={ol:!0,ul:!0},Du=1,Ey=2,Pu=4;function PM(t,e,n){return e!=null?(e?Du:0)|(e==="full"?Ey:0):t&&t.whitespace=="pre"?Du|Ey:n&~Pu}u(PM,"wsOptionsFor");const f$=class f${constructor(e,n,r,i,l,a){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=ye.none,this.match=l||(a&Pu?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(j.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Du)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let l=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=l.withText(l.text.slice(0,l.text.length-i[0].length))}}let n=j.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!kM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}};u(f$,"NodeContext");let eo=f$;const h$=class h${constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,l,a=PM(null,n.preserveWhitespace,0)|(r?Pu:0);i?l=new eo(i.type,i.attrs,ye.none,!0,n.topMatch||i.type.contentMatch,a):r?l=new eo(null,null,ye.none,!0,null,a):l=new eo(e.schema.topNodeType,null,ye.none,!0,null,a),this.nodes=[l],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,l=i.options&Ey?"full":this.localPreserveWS||(i.options&Du)>0;if(l==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(l)l!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],o=e.previousSibling;(!a||o&&o.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,l=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;DM.hasOwnProperty(a)&&this.parser.normalizeLists&&r_(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(s?s.ignore:n_.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let c,d=this.needsBlock;if(kM.hasOwnProperty(a))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),c=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=s&&s.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(l),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,s,c,s.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!s.clearMark(c)):n=n.concat(this.parser.schema.marks[s.mark].create(s.attrs)),s.consuming===!1)o=s;else break}}return n}addElementByRule(e,n,r,i){let l,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let s=this.enter(a,n.attrs||null,r,n.preserveWhitespace);s&&(l=!0,r=s)}else{let s=this.parser.schema.marks[n.mark];r=r.concat(s.create(n.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(s=>this.insertNode(s,r,!1));else{let s=e;typeof n.contentElement=="string"?s=e.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(e):n.contentElement&&(s=n.contentElement),this.findAround(e,s,!0),this.addAll(s,r),this.findAround(e,s,!1)}l&&this.sync(o)&&this.open--}addAll(e,n,r,i){let l=r||0;for(let a=r?e.childNodes[r]:e.firstChild,o=i==null?null:e.childNodes[i];a!=o;a=a.nextSibling,++l)this.findAtPoint(e,l),this.addDOM(a,n);this.findAtPoint(e,l)}findPlace(e,n,r){let i,l;for(let a=this.open,o=0;a>=0;a--){let s=this.nodes[a],c=s.findWrapping(e);if(c&&(!i||i.length>c.length+o)&&(i=c,l=s,!c.length))break;if(s.solid){if(r)break;o+=2}}if(!i)return null;this.sync(l);for(let a=0;a(a.type?a.type.allowsMarkType(c.type):TM(c.type,e))?(s=c.addToSet(s),!1):!0),this.nodes.push(new eo(e,n,s,i,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Du)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),l=-(r?r.depth+1:0)+(i?0:1),a=u((o,s)=>{for(;o>=0;o--){let c=n[o];if(c==""){if(o==n.length-1||o==0)continue;for(;s>=l;s--)if(a(o-1,s))return!0;return!1}else{let d=s>0||s==0&&i?this.nodes[s].type:r&&s>=l?r.node(s-l).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;s--}}return!0},"match");return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};u(h$,"ParseContext");let Bh=h$;function r_(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&DM.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}u(r_,"normalizeList");function i_(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}u(i_,"matches");function EM(t){let e={};for(let n in t)e[n]=t[n];return e}u(EM,"copy");function TM(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let l=[],a=u(o=>{l.push(o);for(let s=0;s{if(l.length||a.marks.length){let o=0,s=0;for(;o=0;i--){let l=this.serializeMark(e.marks[i],e.isInline,n);l&&((l.contentDOM||l.dom).appendChild(r),r=l.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Rh(Ty(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Rh(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Gp(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=AM(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return AM(e.marks)}};u(Gp,"DOMSerializer");let to=Gp;function AM(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}u(AM,"gatherToDOM");function Ty(t){return t.document||window.document}u(Ty,"doc$1");const QM=new WeakMap;function l_(t){let e=QM.get(t);return e===void 0&&QM.set(t,e=a_(t)),e}u(l_,"suspiciousAttributes");function a_(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let o,s=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let h=f.indexOf(" ");h>0?s.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):f=="style"&&s.style?s.style.cssText=c[f]:s.setAttribute(f,c[f])}}for(let f=d;fd)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:m}=Rh(t,h,n,r);if(s.appendChild(p),m){if(o)throw new RangeError("Multiple content holes");o=m}}}return{dom:s,contentDOM:o}}u(Rh,"renderSpec");const MM=65535,BM=Math.pow(2,16);function o_(t,e){return t+e*BM}u(o_,"makeRecover");function RM(t){return t&MM}u(RM,"recoverIndex");function s_(t){return(t-(t&MM))/BM}u(s_,"recoverOffset");const VM=1,NM=2,Vh=4,FM=8,p$=class p${constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&FM)>0}get deletedBefore(){return(this.delInfo&(VM|Vh))>0}get deletedAfter(){return(this.delInfo&(NM|Vh))>0}get deletedAcross(){return(this.delInfo&Vh)>0}};u(p$,"MapResult");let Eu=p$;const Ii=class Ii{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ii.empty)return Ii.empty}recover(e){let n=0,r=RM(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[o+l],d=this.ranges[o+a],f=s+c;if(e<=f){let h=c?e==s?-1:e==f?1:n:n,p=s+i+(h<0?0:d);if(r)return p;let m=e==(n<0?s:f)?null:o_(o/3,e-s),g=e==s?NM:e==f?VM:Vh;return(n<0?e!=s:e!=f)&&(g|=FM),new Eu(p,g,m)}i+=d-c}return r?e+i:new Eu(e+i,0,null)}touches(e,n){let r=0,i=RM(n),l=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;oe)break;let c=this.ranges[o+l],d=s+c;if(e<=d&&o==i*3)return!0;r+=this.ranges[o+a]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,l=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Tc;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;rl&&s!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,l)}invert(){return new Pl(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Hl(n.pos,r.pos,this.mark)}merge(e){return e instanceof Hl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Hl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Hl(n.from,n.to,e.markFromJSON(n.mark))}};u(Hl,"AddMarkStep");let Tu=Hl;Je.jsonID("addMark",Tu);const Jl=class Jl extends Je{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new H(Qy(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,r)}invert(){return new Tu(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Jl(n.pos,r.pos,this.mark)}merge(e){return e instanceof Jl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Jl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Jl(n.from,n.to,e.markFromJSON(n.mark))}};u(Jl,"RemoveMarkStep");let Pl=Jl;Je.jsonID("removeMark",Pl);const ea=class ea extends Je{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return at.fromReplace(e,this.pos,this.pos+1,new H(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Qo(n.pos,r.pos,i,l,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Qo(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}};u(Qo,"ReplaceAroundStep");let Pt=Qo;Je.jsonID("replaceAround",Pt);function My(t,e,n){let r=t.resolve(e),i=n-e,l=r.depth;for(;i>0&&l>0&&r.indexAfter(l)==r.node(l).childCount;)l--,i--;if(i>0){let a=r.node(l).maybeChild(r.indexAfter(l));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}u(My,"contentBetween");function u_(t,e,n,r){let i=[],l=[],a,o;t.doc.nodesBetween(e,n,(s,c,d)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let h=Math.max(c,e),p=Math.min(c+s.nodeSize,n),m=r.addToSet(f);for(let g=0;gt.step(s)),l.forEach(s=>t.step(s))}u(u_,"addMark");function c_(t,e,n,r){let i=[],l=0;t.doc.nodesBetween(e,n,(a,o)=>{if(!a.isInline)return;l++;let s=null;if(r instanceof Qh){let c=a.marks,d;for(;d=r.isInSet(c);)(s||(s=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(o+a.nodeSize,n);for(let d=0;dt.step(new Pl(a.from,a.to,a.style)))}u(c_,"removeMark");function By(t,e,n,r=n.contentMatch,i=!0){let l=t.doc.nodeAt(e),a=[],o=e+1;for(let s=0;s=0;s--)t.step(a[s])}u(By,"clearIncompatible");function d_(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}u(d_,"canCut");function Qu(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),l=t.$from.index(r),a=t.$to.indexAfter(r);if(rn;m--)g||r.index(m)>0?(g=!0,d=j.from(r.node(m).copy(d)),f++):s--;let h=j.empty,p=0;for(let m=l,g=!1;m>n;m--)g||i.after(m+1)=0;a--){if(r.size){let o=n[a].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=j.from(n[a].type.create(n[a].attrs,r))}let i=e.start,l=e.end;t.step(new Pt(i,l,i,l,new H(r,0,0),n.length,!0))}u(m_,"wrap");function g_(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=t.steps.length;t.doc.nodesBetween(e,n,(a,o)=>{let s=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,s)&&O_(t.doc,t.mapping.slice(l).map(o),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}c===!1&&zM(t,a,o,l),By(t,t.mapping.slice(l).map(o,1),r,void 0,c===null);let d=t.mapping.slice(l),f=d.map(o,1),h=d.map(o+a.nodeSize,1);return t.step(new Pt(f,h,f+1,h-1,new H(j.from(r.create(s,null,a.marks)),0,0),1,!0)),c===!0&&LM(t,a,o,l),!1}})}u(g_,"setBlockType$1");function LM(t,e,n,r){e.forEach((i,l)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let s=t.mapping.slice(r).map(n+1+l+a.index);t.replaceWith(s,s+1,e.type.schema.linebreakReplacement.create())}}})}u(LM,"replaceNewlines");function zM(t,e,n,r){e.forEach((i,l)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+l);t.replaceWith(a,a+1,e.type.schema.text(` @@ -40,4 +40,4 @@ var Nne=Object.defineProperty;var u=(om,Ic)=>Nne(om,"name",{value:Ic,configurabl `);return{dom:s,text:h,slice:e}}u(s1,"serializeForClipboard");function F8(t,e,n,r,i){let l=i.parent.type.spec.code,a,o;if(!n&&!e)return null;let s=!!e&&(r||l||!n);if(s){if(t.someProp("transformPastedText",h=>{e=h(e,l||r,t)}),l)return o=new H(j.from(t.state.schema.text(e.replace(/\r\n?/g,` `))),0,0),t.someProp("transformPasted",h=>{o=h(o,t,!0)}),o;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)o=f;else{let h=i.marks(),{schema:p}=t.state,m=to.fromSchema(p);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let O=a.appendChild(document.createElement("p"));g&&O.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),a=yH(n),Fu&&vH(a);let c=a&&a.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let h=a.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;a=h}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||ku.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||d),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!gH.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)o=$H(Z8(o,+d[1],+d[2]),d[4]);else if(o=H.maxOpen(OH(o.content,i),!0),o.openStart||o.openEnd){let f=0,h=0;for(let p=o.content.firstChild;f{o=f(o,t,s)}),o}u(F8,"parseFromClipboard");const gH=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function OH(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),l,a=[];if(t.forEach(o=>{if(!a)return;let s=i.findWrapping(o.type),c;if(!s)return a=null;if(c=a.length&&l.length&&L8(s,l,o,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=z8(a[a.length-1],l.length));let d=I8(o,s);a.push(d),i=i.matchType(d.type),l=s}}),a)return j.from(a)}return t}u(OH,"normalizeSiblings");function I8(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,j.from(t));return t}u(I8,"withWrappers");function L8(t,e,n,r,i){if(i1&&(l=0),i=n&&(o=e<0?a.contentMatchAt(0).fillBefore(o,l<=i).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore(j.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(o))}u(u1,"closeRange");function Z8(t,e,n){return en})),c1.createHTML(t)):t}u(bH,"maybeWrapTrusted");function yH(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=q8().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&X8[r[1].toLowerCase()])&&(t=i.map(l=>"<"+l+">").join("")+t+i.map(l=>"").reverse().join("")),n.innerHTML=bH(t),i)for(let l=0;l=0;o-=2){let s=n.nodes[r[o]];if(!s||s.hasRequiredAttrs())break;i=j.from(s.create(r[o+1],i)),l++,a++}return new H(i,l,a)}u($H,"addContext");const Tt={},At={},wH={touchstart:!0,touchmove:!0},A$=class A${constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};u(A$,"InputState");let d1=A$;function xH(t){for(let e in Tt){let n=Tt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{CH(t,r)&&!h1(t,r)&&(t.editable||!(r.type in At))&&n(t,r)},wH[e]?{passive:!0}:void 0)}Et&&t.dom.addEventListener("input",()=>null),f1(t)}u(xH,"initInput");function Vi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}u(Vi,"setSelectionOrigin");function SH(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}u(SH,"destroyInput");function f1(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>h1(t,r))})}u(f1,"ensureListeners");function h1(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}u(h1,"runCustomHandler");function CH(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}u(CH,"eventBelongsToView");function kH(t,e){!h1(t,e)&&Tt[e.type]&&(t.editable||!(e.type in At))&&Tt[e.type](t,e)}u(kH,"dispatchEvent"),At.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Y8(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Wr&&pt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),so&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Al(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||mH(t,n)?n.preventDefault():Vi(t,"key")},At.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},At.keypress=(t,e)=>{let n=e;if(Y8(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Sn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),l=u(()=>t.state.tr.insertText(i).scrollIntoView(),"deflt");!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,i,l))&&t.dispatch(l()),n.preventDefault()}};function Uh(t){return{left:t.clientX,top:t.clientY}}u(Uh,"eventCoords");function DH(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}u(DH,"isNear");function p1(t,e,n,r,i){if(r==-1)return!1;let l=t.state.doc.resolve(r);for(let a=l.depth+1;a>0;a--)if(t.someProp(e,o=>a>l.depth?o(t,n,l.nodeAfter,l.before(a),i,!0):o(t,n,l.node(a),l.before(a),i,!1)))return!0;return!1}u(p1,"runHandlerOnContext");function ho(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}u(ho,"updateSelection");function PH(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ae.isSelectable(r)?(ho(t,new ae(n),"pointer"),!0):!1}u(PH,"selectClickedLeaf");function EH(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ae&&(r=n.node);let l=t.state.doc.resolve(e);for(let a=l.depth+1;a>0;a--){let o=a>l.depth?l.nodeAfter:l.node(a);if(ae.isSelectable(o)){r&&n.$from.depth>0&&a>=n.$from.depth&&l.before(n.$from.depth+1)==n.$from.pos?i=l.before(n.$from.depth):i=l.before(a);break}}return i!=null?(ho(t,ae.create(t.state.doc,i),"pointer"),!0):!1}u(EH,"selectClickedNode");function TH(t,e,n,r,i){return p1(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(i?EH(t,n):PH(t,n))}u(TH,"handleSingleClick");function AH(t,e,n,r){return p1(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}u(AH,"handleDoubleClick");function QH(t,e,n,r){return p1(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||MH(t,n,r)}u(QH,"handleTripleClick");function MH(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ho(t,ke.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let l=i.depth+1;l>0;l--){let a=l>i.depth?i.nodeAfter:i.node(l),o=i.before(l);if(a.inlineContent)ho(t,ke.create(r,o+1,o+1+a.content.size),"pointer");else if(ae.isSelectable(a))ho(t,ae.create(r,o),"pointer");else continue;return!0}}u(MH,"defaultTripleClick");function m1(t){return Gh(t)}u(m1,"forceDOMFlush");const W8=Sn?"metaKey":"ctrlKey";Tt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=m1(t),i=Date.now(),l="singleClick";i-t.input.lastClick.time<500&&DH(n,t.input.lastClick)&&!n[W8]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?l="doubleClick":t.input.lastClick.type=="doubleClick"&&(l="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:l,button:n.button};let a=t.posAtCoords(Uh(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new g1(t,a,n,!!r)):(l=="doubleClick"?AH:QH)(t,a.pos,a.inside,n)?n.preventDefault():Vi(t,"pointer"))};const Q$=class Q${constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[W8],this.allowDefault=r.shiftKey;let l,a;if(n.inside>-1)l=e.state.doc.nodeAt(n.inside),a=n.inside;else{let d=e.state.doc.resolve(n.pos);l=d.parent,a=d.depth?d.before():0}const o=i?null:r.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||c instanceof ae&&c.from<=a&&c.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Vi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Kr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Uh(e))),this.updateAllowDefault(e),this.allowDefault||!n?Vi(this.view,"pointer"):TH(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Et&&this.mightDrag&&!this.mightDrag.node.isAtom||pt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ho(this.view,de.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Vi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Vi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};u(Q$,"MouseDown");let g1=Q$;Tt.touchstart=t=>{t.input.lastTouch=Date.now(),m1(t),Vi(t,"pointer")},Tt.touchmove=t=>{t.input.lastTouch=Date.now(),Vi(t,"pointer")},Tt.contextmenu=t=>m1(t);function Y8(t,e){return t.composing?!0:Et&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}u(Y8,"inOrNearComposition");const BH=Wr?5e3:-1;At.compositionstart=At.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Gh(t,!0),t.markCursor=null;else if(Gh(t,!e.selection.empty),xn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,l=r.focusOffset;i&&i.nodeType==1&&l!=0;){let a=l<0?i.lastChild:i.childNodes[l-1];if(!a)break;if(a.nodeType==3){let o=t.domSelection();o&&o.collapse(a,a.nodeValue.length);break}else i=a,l=-1}}t.input.composing=!0}K8(t,BH)},At.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,K8(t,20))};function K8(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Gh(t),e))}u(K8,"scheduleComposeEnd");function U8(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=VH());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}u(U8,"clearComposition");function RH(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Q_(e.focusNode,e.focusOffset),r=M_(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,l=t.domObserver.lastChangedTextNode;if(n==l||r==l)return l;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}u(RH,"findCompositionNode");function VH(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}u(VH,"timestampFromCustomEvent");function Gh(t,e=!1){if(!(Wr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),U8(t),e||t.docView&&t.docView.dirty){let n=r1(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}u(Gh,"endComposition");function NH(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}u(NH,"captureCopy");const Zu=Xt&&Qi<15||so&&F_<604;Tt.copy=At.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let l=Zu?null:n.clipboardData,a=r.content(),{dom:o,text:s}=s1(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",o.innerHTML),l.setData("text/plain",s)):NH(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function FH(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}u(FH,"sliceSingleNode");function IH(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Xu(t,r.value,null,i,e):Xu(t,r.textContent,r.innerHTML,i,e)},50)}u(IH,"capturePaste");function Xu(t,e,n,r,i){let l=F8(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",s=>s(t,i,l||H.empty)))return!0;if(!l)return!1;let a=FH(l),o=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(l);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}u(Xu,"doPaste");function G8(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}u(G8,"getText"),At.paste=(t,e)=>{let n=e;if(t.composing&&!Wr)return;let r=Zu?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Xu(t,G8(r),r.getData("text/html"),i,n)?n.preventDefault():IH(t,n)};const M$=class M${constructor(e,n,r){this.slice=e,this.move=n,this.node=r}};u(M$,"Dragging");let _h=M$;const LH=Sn?"altKey":"ctrlKey";function _8(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[LH]}u(_8,"dragMoves"),Tt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,l=i.empty?null:t.posAtCoords(Uh(n)),a;if(!(l&&l.pos>=i.from&&l.pos<=(i instanceof ae?i.to-1:i.to))){if(r&&r.mightDrag)a=ae.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(a=ae.create(t.state.doc,f.posBefore))}}let o=(a||t.state.selection).content(),{dom:s,text:c,slice:d}=s1(t,o);(!n.dataTransfer.files.length||!pt||a8>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Zu?"Text":"text/html",s.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zu||n.dataTransfer.setData("text/plain",c),t.dragging=new _h(d,_8(t,n),a)},Tt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},At.dragover=At.dragenter=(t,e)=>e.preventDefault(),At.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Uh(n));if(!i)return;let l=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",m=>{a=m(a,t,!1)}):a=F8(t,G8(n.dataTransfer),Zu?null:n.dataTransfer.getData("text/html"),!1,l);let o=!!(r&&_8(t,n));if(t.someProp("handleDrop",m=>m(t,n,a||H.empty,o))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?jM(t.state.doc,l.pos,a):l.pos;s==null&&(s=l.pos);let c=t.state.tr;if(o){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let d=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,h=c.doc;if(f?c.replaceRangeWith(d,d,a.content.firstChild):c.replaceRange(d,d,a),c.doc.eq(h))return;let p=c.doc.resolve(d);if(f&&ae.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ae(p));else{let m=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((g,O,b,y)=>m=y),c.setSelection(l1(t,p,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Tt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Kr(t)},20))},Tt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Tt.beforeinput=(t,e)=>{if(pt&&Wr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",l=>l(t,Al(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in At)Tt[t]=At[t];function ju(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}u(ju,"compareObjs");const tm=class tm{constructor(e,n){this.toDOM=e,this.spec=n||Vl,this.side=this.spec.side||0}map(e,n,r,i){let{pos:l,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Ur(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof tm&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ju(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};u(tm,"WidgetType");let Hh=tm;const Rc=class Rc{constructor(e,n){this.attrs=e,this.spec=n||Vl}map(e,n,r,i){let l=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return l>=a?null:new Ur(l,a,this)}valid(e,n){return n.from=e&&(!l||l(o.spec))&&r.push(o.copy(o.from+i,o.to+i))}for(let a=0;ae){let o=this.children[a]+1;this.children[a+2].findInner(e-o,n-o,r,i+o,l)}}map(e,n,r){return this==mt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Vl)}mapInner(e,n,r,i,l){let a;for(let o=0;o{let c=s+r,d;if(d=J8(n,o,c)){for(i||(i=this.children.slice());lo&&f.to=e){this.children[o]==e&&(r=this.children[o+2]);break}let l=e+1,a=l+n.content.size;for(let o=0;ol&&s.type instanceof Rl){let c=Math.max(l,s.from)-l,d=Math.min(a,s.to)-l;ci.map(e,n,Vl));return Li.from(r)}forChild(e,n){if(n.isLeaf)return ln.empty;let r=[];for(let i=0;in instanceof ln)?e:e.reduce((n,r)=>n.concat(r instanceof ln?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let O=g-m-(p-h);for(let b=0;by+d-f)continue;let $=o[b]+d-f;p>=$?o[b+1]=h<=$?-2:-1:h>=d&&O&&(o[b]+=O,o[b+1]+=O)}f+=O}),d=n.maps[c].map(d,-1)}let s=!1;for(let c=0;c=r.content.size){s=!0;continue}let h=n.map(t[c+1]+l,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),O=r.maybeChild(m);if(O&&g==f&&g+O.nodeSize==p){let b=o[c+2].mapInner(n,O,d+1,t[c]+l+1,a);b!=mt?(o[c]=f,o[c+1]=p,o[c+2]=b):(o[c+1]=-2,s=!0)}else s=!0}if(s){let c=ZH(o,t,e,n,i,l,a),d=ep(c,r,0,a);e=d.local;for(let f=0;fn&&a.to{let c=J8(t,o,s+n);if(c){l=!0;let d=ep(c,o,n+s+1,r);d!=mt&&i.push(s,s+o.nodeSize,d)}});let a=H8(l?e9(t):t,-n).sort(Nl);for(let o=0;o0;)e++;t.splice(e,0,n)}u(t9,"insertAhead");function y1(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=mt&&e.push(r)}),t.cursorWrapper&&e.push(ln.create(t.state.doc,[t.cursorWrapper.deco])),Jh.from(e)}u(y1,"viewDecorations");const XH={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},jH=Xt&&Qi<=11,B$=class B${constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}};u(B$,"SelectionState");let v1=B$;const R$=class R${constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new v1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),jH&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,XH)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(T8(this.view)){if(this.suppressingSelectionUpdates)return Kr(this.view);if(Xt&&Qi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Tl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let l=e.focusNode;l;l=oo(l))n.add(l);for(let l=e.anchorNode;l;l=oo(l))if(n.has(l)){r=l;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&T8(e)&&!this.ignoreSelectionChange(r),l=-1,a=-1,o=!1,s=[];if(e.editable)for(let d=0;df.nodeName=="BR");if(d.length==2){let[f,h]=d;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of d){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||YH(e,f)!=p)&&h.remove()}}}let c=null;l<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(l>-1&&(e.docView.markDirty(l,a),qH(e)),this.handleDOMChange(l,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Kr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;O--){let b=r.childNodes[O-1],y=b.pmViewDesc;if(b.nodeName=="BR"&&!y){l=O;break}if(!y||y.size)break}let f=t.state.doc,h=t.someProp("domParser")||ku.fromSchema(t.state.schema),p=f.resolve(a),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:l,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:UH,context:p});if(c&&c[0].pos!=null){let O=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=O),m={anchor:O+a,head:b+a}}return{doc:g,sel:m,from:a,to:o}}u(KH,"parseBetween");function UH(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Et&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Et&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}u(UH,"ruleFromNode");const GH=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function _H(t,e,n,r,i){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=r1(t,C);if(Q&&!t.state.selection.eq(Q)){if(pt&&Wr&&t.input.lastKeyCode===13&&Date.now()-100B(t,Al(13,"Enter"))))return;let T=t.state.tr.setSelection(Q);C=="pointer"?T.setMeta("pointer",!0):C=="key"&&T.scrollIntoView(),l&&T.setMeta("composition",l),t.dispatch(T)}return}let a=t.state.doc.resolve(e),o=a.sharedDepth(n);e=a.before(o+1),n=t.state.doc.resolve(n).after(o+1);let s=t.state.selection,c=KH(t,e,n),d=t.state.doc,f=d.slice(c.from,c.to),h,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Wr)&&i.some(C=>C.nodeType==1&&!GH.test(C.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",C=>C(t,Al(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&s instanceof ke&&!s.empty&&s.$head.sameParent(s.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:s.from,endA:s.to,endB:s.to};else{if(c.sel){let C=l9(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let Q=t.state.tr.setSelection(C);l&&Q.setMeta("composition",l),t.dispatch(Q)}}return}t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Xt&&Qi<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" \xA0"&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),O=c.doc.resolveNoCache(m.endB-c.from),b=d.resolve(m.start),y=g.sameParent(O)&&g.parent.inlineContent&&b.end()>=m.endA;if((so&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!y&&g.posC(t,Al(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&JH(d,m.start,m.endA,g,O)&&t.someProp("handleKeyDown",C=>C(t,Al(8,"Backspace")))){Wr&&pt&&t.domObserver.suppressSelectionUpdates();return}pt&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),Wr&&!y&&g.start()!=O.start()&&O.parentOffset==0&&g.depth==O.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,O=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,Al(13,"Enter"))})},20));let $=m.start,v=m.endA,S=u(C=>{let Q=C||t.state.tr.replace($,v,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let T=l9(t,Q.doc,c.sel);T&&!(pt&&t.composing&&T.empty&&(m.start!=m.endB||t.input.lastChromeDeleteKr(t),20));let C=S(t.state.tr.delete($,v)),Q=d.resolve(m.start).marksAcross(d.resolve(m.endA));Q&&C.ensureMarks(Q),t.dispatch(C)}else if(m.endA==m.endB&&(x=HH(g.parent.content.cut(g.parentOffset,O.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let C=S(t.state.tr);x.type=="add"?C.addMark($,v,x.mark):C.removeMark($,v,x.mark),t.dispatch(C)}else if(g.parent.child(g.index()).isText&&g.index()==O.index()-(O.textOffset?0:1)){let C=g.parent.textBetween(g.parentOffset,O.parentOffset),Q=u(()=>S(t.state.tr.insertText(C,$,v)),"deflt");t.someProp("handleTextInput",T=>T(t,$,v,C,Q))||t.dispatch(Q())}else t.dispatch(S());else t.dispatch(S())}u(_H,"readDOMChange");function l9(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:l1(t,e.resolve(n.anchor),e.resolve(n.head))}u(l9,"resolveSelection");function HH(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,l=r,a,o,s;for(let d=0;dd.mark(o.addToSet(d.marks)),"update");else if(i.length==0&&l.length==1)o=l[0],a="remove",s=u(d=>d.mark(o.removeFromSet(d.marks)),"update");else return null;let c=[];for(let d=0;dn||w1(a,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let l=t.node(r).maybeChild(t.indexAfter(r));for(;l&&!l.isLeaf;)l=l.firstChild,i++}return i}u(w1,"skipClosingAndOpening");function eJ(t,e,n,r,i){let l=t.findDiffStart(e,n);if(l==null)return null;let{a,b:o}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let s=Math.max(0,l-Math.min(a,o));r-=a+s-l}if(a=a?l-r:0;l-=s,l&&l=o?l-r:0;l-=s,l&&l=56320&&e<=57343&&n>=55296&&n<=56319}u(a9,"isSurrogatePair");const V$=class V${constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new d1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(d9),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=u9(this),s9(this),this.nodeViews=c9(this),this.docView=y8(this.state.doc,o9(this),y1(this),this.dom,this),this.domObserver=new $1(this,(r,i,l,a)=>_H(this,r,i,l,a)),this.domObserver.start(),xH(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&f1(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(d9),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(U8(this),a=!0),this.state=e;let o=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(o||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=c9(this);nJ(p,this.nodeViews)&&(this.nodeViews=p,l=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&f1(this),this.editable=u9(this),s9(this);let s=y1(this),c=o9(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=l||!this.docView.matchesNode(e.doc,c,s);(f||!e.selection.eq(i.selection))&&(a=!0);let h=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&z_(this);if(a){this.domObserver.stop();let p=f&&(Xt||pt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&tJ(i.selection,e.selection);if(f){let m=pt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=RH(this)),(l||!this.docView.update(e.doc,c,s,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=y8(e.doc,c,s,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&sH(this))?Kr(this,p):(P8(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&Z_(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ae){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&o8(this,n.getBoundingClientRect(),e)}else o8(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(l))==r.node&&(i=l)}this.dragging=new _h(e.slice,e.move,i<0?void 0:ae.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;an.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return K_(this,e)}coordsAtPos(e,n=1){return h8(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return J_(this,n||this.state,e)}pasteHTML(e,n){return Xu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Xu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return s1(this,e)}destroy(){this.docView&&(SH(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],y1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,T_())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return kH(this,e)}domSelectionRange(){let e=this.domSelection();return e?Et&&this.root.nodeType===11&&R_(this.dom.ownerDocument)==this.dom&&WH(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};u(V$,"EditorView");let tp=V$;tp.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function o9(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ur.node(0,t.state.doc.content.size,e)]}u(o9,"computeDocDeco");function s9(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ur.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}u(s9,"updateCursorWrapper");function u9(t){return!t.someProp("editable",e=>e(t.state)===!1)}u(u9,"getEditable");function tJ(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}u(tJ,"selectionContextChanged");function c9(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return u(n,"add"),t.someProp("nodeViews",n),t.someProp("markViews",n),e}u(c9,"buildNodeViews");function nJ(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}u(nJ,"changedNodeViews");function d9(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}u(d9,"checkStateComponent");const rJ=["p",0],iJ=["blockquote",0],lJ=["hr"],aJ=["pre",["code",0]],oJ=["br"],sJ={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return rJ}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM(){return iJ}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return lJ}},heading:{attrs:{level:{default:1,validate:"number"}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM(){return aJ}},text:{group:"inline"},image:{inline:!0,attrs:{src:{validate:"string"},alt:{default:null,validate:"string|null"},title:{default:null,validate:"string|null"}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){let{src:e,alt:n,title:r}=t.attrs;return["img",{src:e,alt:n,title:r}]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return oJ}}},uJ=["em",0],cJ=["strong",0],dJ=["code",0],fJ={link:{attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){let{href:e,title:n}=t.attrs;return["a",{href:e,title:n},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return uJ}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return cJ}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return dJ}}},f9=new Mh({nodes:sJ,marks:fJ}),hJ=["ol",0],pJ=["ul",0],mJ=["li",0],gJ={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM(t){return t.attrs.order==1?hJ:["ol",{start:t.attrs.order},0]}},OJ={parseDOM:[{tag:"ul"}],toDOM(){return pJ}},bJ={parseDOM:[{tag:"li"}],toDOM(){return mJ},defining:!0};function x1(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}u(x1,"add");function yJ(t,e,n){return t.append({ordered_list:x1(gJ,{content:"list_item+",group:n}),bullet_list:x1(OJ,{content:"list_item+",group:n}),list_item:x1(bJ,{content:e})})}u(yJ,"addListNodes");function S1(t,e=null){return function(n,r){let{$from:i,$to:l}=n.selection,a=i.blockRange(l);if(!a)return!1;let o=r?n.tr:null;return vJ(o,a,t,e)?(r&&r(o.scrollIntoView()),!0):!1}}u(S1,"wrapInList");function vJ(t,e,n,r=null){let i=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let s=a.resolve(e.start-2);l=new Ja(s,s,e.depth),e.endIndex=0;d--)l=j.from(n[d].type.create(n[d].attrs,l));t.step(new Pt(e.start-(r?2:0),e.end,e.start,e.end,new H(l,0,0),n.length,!0));let a=0;for(let d=0;d=i.depth-3;b--)f=j.from(i.node(b).copy(f));let p=i.indexAfter(-1){if(O>-1)return!1;b.isTextblock&&b.content.size==0&&(O=y+1)}),O>-1&&g.setSelection(de.near(g.doc.resolve(O))),r(g.scrollIntoView())}return!0}let s=l.pos==i.end()?o.contentMatchAt(0).defaultType:null,c=n.tr.delete(i.pos,l.pos),d=s?[e?{type:t,attrs:e}:null,{type:s}]:void 0;return ro(c.doc,i.pos,2,d)?(r&&r(c.split(i.pos,2,d).scrollIntoView()),!0):!1}}u(wJ,"splitListItem");function xJ(t){return function(e,n){let{$from:r,$to:i}=e.selection,l=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==t);return l?n?r.node(l.depth-1).type==t?SJ(e,n,t,l):CJ(e,n,l):!0:!1}}u(xJ,"liftListItem");function SJ(t,e,n,r){let i=t.tr,l=r.end,a=r.$to.end(r.depth);lg;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let o=n.startIndex==0,s=n.endIndex==i.childCount,c=l.node(-1),d=l.index(-1);if(!c.canReplace(d+(o?0:1),d+1,a.content.append(s?j.empty:j.from(i))))return!1;let f=l.pos,h=f+a.nodeSize;return r.step(new Pt(f-(o?1:0),h+(s?1:0),f+1,h-1,new H((o?j.empty:j.from(i.copy(j.empty))).append(s?j.empty:j.from(i.copy(j.empty))),o?0:1,s?0:1),o?0:1)),e(r.scrollIntoView()),!0}u(CJ,"liftOutOfList");function kJ(t){return function(e,n){let{$from:r,$to:i}=e.selection,l=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(a==0)return!1;let o=l.parent,s=o.child(a-1);if(s.type!=t)return!1;if(n){let c=s.lastChild&&s.lastChild.type==o.type,d=j.from(c?t.create():null),f=new H(j.from(t.create(null,j.from(o.type.create(null,d)))),c?3:1,0),h=l.start,p=l.end;n(e.tr.step(new Pt(h-(c?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}u(kJ,"sinkListItem");const DJ=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),PJ=typeof navigator<"u"&&/Win/.test(navigator.platform);function EJ(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,l,a;for(let o=0;o=n?et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},"slice"),et.prototype.get=u(function(e){if(!(e<0||e>=this.length))return this.getInner(e)},"get"),et.prototype.forEach=u(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},"forEach"),et.prototype.map=u(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(l,a){return i.push(e(l,a))},n,r),i},"map"),et.from=u(function(e){return e instanceof et?e:e&&e.length?new m9(e):et.empty},"from");var m9=function(t){function e(r){t.call(this),this.values=r}u(e,"Leaf"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=u(function(){return this.values},"flatten"),e.prototype.sliceInner=u(function(i,l){return i==0&&l==this.length?this:new e(this.values.slice(i,l))},"sliceInner"),e.prototype.getInner=u(function(i){return this.values[i]},"getInner"),e.prototype.forEachInner=u(function(i,l,a,o){for(var s=l;s=a;s--)if(i(this.values[s],o+s)===!1)return!1},"forEachInvertedInner"),e.prototype.leafAppend=u(function(i){if(this.length+i.length<=np)return new e(this.values.concat(i.flatten()))},"leafAppend"),e.prototype.leafPrepend=u(function(i){if(this.length+i.length<=np)return new e(i.flatten().concat(this.values))},"leafPrepend"),n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(et);et.empty=new m9([]);var AJ=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return u(e,"Append"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=u(function(){return this.left.flatten().concat(this.right.flatten())},"flatten"),e.prototype.getInner=u(function(r){return ro&&this.right.forEachInner(r,Math.max(i-o,0),Math.min(this.length,l)-o,a+o)===!1)return!1},"forEachInner"),e.prototype.forEachInvertedInner=u(function(r,i,l,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(r,i-o,Math.max(l,o)-o,a+o)===!1||l=l?this.right.slice(r-l,i-l):this.left.slice(r,l).append(this.right.slice(0,i-l))},"sliceInner"),e.prototype.leafAppend=u(function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},"leafAppend"),e.prototype.leafPrepend=u(function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},"leafPrepend"),e.prototype.appendInner=u(function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},"appendInner"),e}(et);const QJ=500,zi=class zi{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,l;n&&(i=this.remapping(r,this.items.length),l=i.maps.length);let a=e.tr,o,s,c=[],d=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),l=i.maps.length),l--,d.push(f);return}if(i){d.push(new cr(f.map));let p=f.step.map(i.slice(l)),m;p&&a.maybeStep(p).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],c.push(new cr(m,void 0,void 0,c.length+d.length))),l--,m&&i.appendMap(m,l)}else a.maybeStep(f.step);if(f.selection)return o=i?f.selection.map(i.slice(l)):f.selection,s=new zi(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,n,r,i){let l=[],a=this.eventCount,o=this.items,s=!i&&o.length?o.get(o.length-1):null;for(let d=0;dBJ&&(o=MJ(o,c),a-=c),new zi(o.append(l),a)}remapping(e,n){let r=new Nh;return this.items.forEach((i,l)=>{let a=i.mirrorOffset!=null&&l-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new zi(this.items.append(e.map(n=>new cr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),l=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach(h=>{h.selection&&o--},i);let s=n;this.items.forEach(h=>{let p=l.getMirror(--s);if(p==null)return;a=Math.min(a,p);let m=l.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),O=h.selection&&h.selection.map(l.slice(s+1,p));O&&o++,r.push(new cr(m,g,O))}else r.push(new cr(m))},i);let c=[];for(let h=n;hQJ&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],l=0;return this.items.forEach((a,o)=>{if(o>=e)i.push(a),a.selection&&l++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let d=a.selection&&a.selection.map(n.slice(r));d&&l++;let f=new cr(c.invert(),s,d),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else a.map&&r--},this.items.length,0),new zi(et.from(i.reverse()),l)}};u(zi,"Branch");let Fl=zi;Fl.empty=new Fl(et.empty,0);function MJ(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}u(MJ,"cutOffEvents");const rm=class rm{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new rm(n.getMap().invert(),n,this.selection)}}};u(rm,"Item");let cr=rm;const N$=class N${constructor(e,n,r,i,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=l}};u(N$,"HistoryState");let dr=N$;const BJ=20;function RJ(t,e,n,r){let i=n.getMeta(Il),l;if(i)return i.historyState;n.getMeta(FJ)&&(t=new dr(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Il))return a.getMeta(Il).redo?new dr(t.done.addTransform(n,void 0,r,rp(e)),t.undone,g9(n.mapping.maps),t.prevTime,t.prevComposition):new dr(t.done,t.undone.addTransform(n,void 0,r,rp(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),s=t.prevTime==0||!a&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!VJ(n,t.prevRanges)),c=a?k1(t.prevRanges,n.mapping):g9(n.mapping.maps);return new dr(t.done.addTransform(n,s?e.selection.getBookmark():void 0,r,rp(e)),Fl.empty,c,n.time,o??t.prevComposition)}else return(l=n.getMeta("rebased"))?new dr(t.done.rebased(n,l),t.undone.rebased(n,l),k1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new dr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),k1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}u(RJ,"applyTransaction");function VJ(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let l=0;l=e[l]&&(n=!0)}),n}u(VJ,"isAdjacentTo");function g9(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,l,a)=>e.push(l,a));return e}u(g9,"rangesFor");function k1(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=Il.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let l=NJ(i,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}u(b9,"buildCommand");const ip=b9(!1,!0),qu=b9(!0,!0),y9=u((t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),"deleteSelection");function LJ(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}u(LJ,"atBlockStart");const zJ=u((t,e,n)=>{let r=LJ(t,n);if(!r)return!1;let i=v9(r);if(!i){let a=r.blockRange(),o=a&&Qu(a);return o==null?!1:(e&&e(t.tr.lift(a,o).scrollIntoView()),!0)}let l=i.nodeBefore;if(x9(t,i,e,-1))return!0;if(r.parent.content.size==0&&(mo(l,"end")||ae.isSelectable(l)))for(let a=r.depth;;a--){let o=Vy(t.doc,r.before(a),r.after(a),H.empty);if(o&&o.slice.size1)break}return l.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-l.nodeSize,i.pos).scrollIntoView()),!0):!1},"joinBackward");function mo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}u(mo,"textblockAt");const ZJ=u((t,e,n)=>{let{$head:r,empty:i}=t.selection,l=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;l=v9(r)}let a=l&&l.nodeBefore;return!a||!ae.isSelectable(a)?!1:(e&&e(t.tr.setSelection(ae.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)},"selectNodeBackward");function v9(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}u(v9,"findCutBefore");function XJ(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=XJ(t,n);if(!r)return!1;let i=$9(r);if(!i)return!1;let l=i.nodeAfter;if(x9(t,i,e,1))return!0;if(r.parent.content.size==0&&(mo(l,"start")||ae.isSelectable(l))){let a=Vy(t.doc,r.before(),r.after(),H.empty);if(a&&a.slice.size{let{$head:r,empty:i}=t.selection,l=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof ae,i;if(r){if(n.node.isTextblock||!io(t.doc,n.from))return!1;i=n.from}else if(i=XM(t.doc,n.from,-1),i==null)return!1;if(e){let l=t.tr.join(i);r&&l.setSelection(ae.create(l.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},"joinUp"),WJ=u((t,e)=>{let n=t.selection,r;if(n instanceof ae){if(n.node.isTextblock||!io(t.doc,n.to))return!1;r=n.to}else if(r=XM(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},"joinDown"),E1=u((t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),l=i&&Qu(i);return l==null?!1:(e&&e(t.tr.lift(i,l).scrollIntoView()),!0)},"lift"),YJ=u((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)},"newlineInCode");function T1(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),l=n.indexAfter(-1),a=T1(i.contentMatchAt(l));if(!a||!i.canReplaceWith(l,l,a))return!1;if(e){let o=n.after(),s=t.tr.replaceWith(o,o,a.createAndFill());s.setSelection(de.near(s.doc.resolve(o),1)),e(s.scrollIntoView())}return!0},"exitCode"),KJ=u((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let l=T1(i.parent.contentMatchAt(i.indexAfter()));if(!l||!l.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let l=n.before();if(ro(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Qu(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},"liftEmptyBlock");function GJ(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ae&&e.selection.node.isBlock)return!r.parentOffset||!ro(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,o,s=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){s=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),o=T1(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let g=t&&t(i.parent,s,r);l.unshift(g||(s&&o?{type:o}:null)),a=p;break}else{if(p==1)return!1;l.unshift(null)}let d=e.tr;(e.selection instanceof ke||e.selection instanceof Fn)&&d.deleteSelection();let f=d.mapping.map(r.pos),h=ro(d.doc,f,l.length,l);if(h||(l[0]=o?{type:o}:null,h=ro(d.doc,f,l.length,l)),!h)return!1;if(d.split(f,l.length,l),!s&&c&&r.node(a).type!=o){let p=d.mapping.map(r.before(a)),m=d.doc.resolve(p);o&&r.node(a-1).canReplaceWith(m.index(),m.index()+1,o)&&d.setNodeMarkup(d.mapping.map(r.before(a)),o)}return n&&n(d.scrollIntoView()),!0}}u(GJ,"splitBlockAs");const _J=GJ(),A1=u((t,e)=>{let{$from:n,to:r}=t.selection,i,l=n.sharedDepth(r);return l==0?!1:(i=n.before(l),e&&e(t.tr.setSelection(ae.create(t.doc,i))),!0)},"selectParentNode"),HJ=u((t,e)=>(e&&e(t.tr.setSelection(new Fn(t.doc))),!0),"selectAll");function JJ(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,l=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(l,l+1)||!(i.isTextblock||io(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}u(JJ,"joinMaybeClear");function x9(t,e,n,r){let i=e.nodeBefore,l=e.nodeAfter,a,o,s=i.type.spec.isolating||l.type.spec.isolating;if(!s&&JJ(t,e,n))return!0;let c=!s&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(l.type))&&o.matchType(a[0]||l.type).validEnd){if(n){let p=e.pos+l.nodeSize,m=j.empty;for(let b=a.length-1;b>=0;b--)m=j.from(a[b].create(null,m));m=j.from(i.copy(m));let g=t.tr.step(new Pt(e.pos-1,p,e.pos,p,new H(m,1,0),a.length,!0)),O=g.doc.resolve(p+2*a.length);O.nodeAfter&&O.nodeAfter.type==i.type&&io(g.doc,O.pos)&&g.join(O.pos),n(g.scrollIntoView())}return!0}let d=l.type.spec.isolating||r>0&&s?null:de.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),h=f&&Qu(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(c&&mo(l,"start",!0)&&mo(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=l,O=1;for(;!g.isTextblock;g=g.firstChild)O++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=j.empty;for(let $=m.length-1;$>=0;$--)b=j.from(m[$].copy(b));let y=t.tr.step(new Pt(e.pos-m.length,e.pos+l.nodeSize,e.pos+O,e.pos+l.nodeSize-O,new H(b,m.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}u(x9,"deleteBarrier");function S9(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,l=i.depth;for(;i.node(l).isInline;){if(!l)return!1;l--}return i.node(l).isTextblock?(n&&n(e.tr.setSelection(ke.create(e.doc,t<0?i.start(l):i.end(l)))),!0):!1}}u(S9,"selectTextblockSide");const eee=S9(-1),tee=S9(1);function Q1(t,e=null){return function(n,r){let{$from:i,$to:l}=n.selection,a=i.blockRange(l),o=a&&Ry(a,t,e);return o?(r&&r(n.tr.wrap(a,o).scrollIntoView()),!0):!1}}u(Q1,"wrapIn");function lp(t,e=null){return function(n,r){let i=!1;for(let l=0;l{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(t,e)))if(s.type==t)i=!0;else{let d=n.doc.resolve(c),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let l=n.tr;for(let a=0;a{if(o||!r&&s.isAtom&&s.isInline&&c>=l.pos&&c+s.nodeSize<=a.pos)return!1;o=s.inlineContent&&s.type.allowsMarkType(n)}),o)return!0}return!1}u(nee,"markApplies");function ree(t){let e=[];for(let n=0;n{if(l.isAtom&&l.content.size&&l.isInline&&a>=r.pos&&a+l.nodeSize<=i.pos)return a+1>r.pos&&e.push(new Ru(r,r.doc.resolve(a+1))),r=r.doc.resolve(a+1+l.content.size),!1}),r.posa.doc.rangeHasMark(p.$from.pos,p.$to.pos,t)):f=!d.every(p=>{let m=!1;return h.doc.nodesBetween(p.$from.pos,p.$to.pos,(g,O,b)=>{if(m)return!1;m=!t.isInSet(g.marks)&&!!b&&b.type.allowsMarkType(t)&&!(g.isText&&/^\s*$/.test(g.textBetween(Math.max(0,p.$from.pos-O),Math.min(g.nodeSize,p.$to.pos-O))))}),!m});for(let p=0;p{let l=u(a=>{this[i](a)},"handler");return e.dom.addEventListener(i,l),{name:i,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,l=i.getBoundingClientRect(),a=l.width/i.offsetWidth,o=l.height/i.offsetHeight;if(n){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let O=this.width/2*o;r={left:m.left,right:m.right,top:g-O,bottom:g+O}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!s||s==document.body&&getComputedStyle(s).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=s.getBoundingClientRect(),h=f.width/s.offsetWidth,p=f.height/s.offsetHeight;c=f.left-s.scrollLeft*h,d=f.top-s.scrollTop*p}this.element.style.left=(r.left-c)/a+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,l=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!l){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=jM(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};u(F$,"DropCursorView");let B1=F$;const Or=class Or extends de{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Or.valid(r)?new Or(r):de.near(r)}content(){return H.empty}eq(e){return e instanceof Or&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Or(e.resolve(n.pos))}getBookmark(){return new R1(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!aee(e)||!oee(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Or.valid(e))return e;let i=e.pos,l=null;for(let a=e.depth;;a--){let o=e.node(a);if(n>0?e.indexAfter(a)0){l=o.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let s=e.doc.resolve(i);if(Or.valid(s))return s}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!ae.isSelectable(l)){e=e.doc.resolve(i+l.nodeSize*n),r=!1;continue e}break}l=a,i+=n;let o=e.doc.resolve(i);if(Or.valid(o))return o}return null}}};u(Or,"GapCursor");let gt=Or;gt.prototype.visible=!1,gt.findFrom=gt.findGapCursorFrom,de.jsonID("gapcursor",gt);const im=class im{constructor(e){this.pos=e}map(e){return new im(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return gt.valid(n)?new gt(n):de.near(n)}};u(im,"GapBookmark");let R1=im;function D9(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}u(D9,"needsGap");function aee(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||D9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(aee,"closedBefore");function oee(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||D9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(oee,"closedAfter");function see(){return new jr({props:{decorations:fee,createSelectionBetween(t,e,n){return e.pos==n.pos&>.valid(n)?new gt(n):null},handleClick:cee,handleKeyDown:uee,handleDOMEvents:{beforeinput:dee}}})}u(see,"gapCursor");const uee=p9({ArrowLeft:op("horiz",-1),ArrowRight:op("horiz",1),ArrowUp:op("vert",-1),ArrowDown:op("vert",1)});function op(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,l){let a=r.selection,o=e>0?a.$to:a.$from,s=a.empty;if(a instanceof ke){if(!l.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=r.doc.resolve(e>0?o.after():o.before())}let c=gt.findGapCursorFrom(o,e,s);return c?(i&&i(r.tr.setSelection(new gt(c))),!0):!1}}u(op,"arrow");function cee(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!gt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new gt(r))),!0)}u(cee,"handleClick");function dee(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof gt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=j.empty;for(let a=r.length-1;a>=0;a--)i=j.from(r[a].createAndFill(null,i));let l=t.state.tr.replace(n.pos,n.pos,new H(i,0,0));return l.setSelection(ke.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}u(dee,"beforeinput");function fee(t){if(!(t.selection instanceof gt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ln.create(t.doc,[Ur.widget(t.selection.head,e,{key:"gapcursor"})])}u(fee,"drawGapCursor");const Wu="http://www.w3.org/2000/svg",hee="http://www.w3.org/1999/xlink",V1="ProseMirror-icon";function pee(t){let e=0;for(let n=0;n{l.preventDefault(),r.classList.contains(jt+"-disabled")||n.run(e.state,e.dispatch,e,l)});function i(l){if(n.select){let o=n.select(l);if(r.style.display=o?"":"none",!o)return!1}let a=!0;if(n.enable&&(a=n.enable(l)||!1,I1(r,jt+"-disabled",!a)),n.active){let o=a&&n.active(l)||!1;I1(r,jt+"-active",o)}return!0}return u(i,"update"),{dom:r,update:i}}};u(I$,"MenuItem");let an=I$;function Yu(t,e){return t._props.translate?t._props.translate(e):e}u(Yu,"translate");let Ku={time:0,node:null};function P9(t){Ku.time=Date.now(),Ku.node=t.target}u(P9,"markMenuEvent");function E9(t){return Date.now()-100{a&&a.close()&&(a=null,r.removeEventListener("mousedown",o))},"close");i.addEventListener("mousedown",d=>{d.preventDefault(),P9(d),a?s():(a=this.expand(l,n.dom),r.addEventListener("mousedown",o=u(()=>{E9(l)||s()},"listeningOnClose")))});function c(d){let f=n.update(d);return l.style.display=f?"":"none",f}return u(c,"update"),{dom:l,update:c}}expand(e,n){let r=_t("div",{class:jt+"-dropdown-menu "+(this.options.class||"")},n),i=!1;function l(){return i?!1:(i=!0,e.removeChild(r),!0)}return u(l,"close"),e.appendChild(r),{close:l,node:r}}};u(L$,"Dropdown");let sp=L$;function T9(t,e){let n=[],r=[];for(let i=0;i{let r=!1;for(let i=0;i{s.preventDefault(),P9(s),I1(l,jt+"-submenu-wrap-active",!1),a||r.addEventListener("mousedown",a=u(()=>{E9(l)||(l.classList.remove(jt+"-submenu-wrap-active"),r.removeEventListener("mousedown",a),a=null)},"listeningOnClose"))});function o(s){let c=n.update(s);return l.style.display=c?"":"none",c}return u(o,"update"),{dom:l,update:o}}};u(z$,"DropdownSubmenu");let N1=z$;function Q9(t,e){let n=document.createDocumentFragment(),r=[],i=[];for(let a=0;aP1(t),icon:kn.join}),yee=new an({title:"Lift out of enclosing block",run:E1,select:t=>E1(t),icon:kn.lift}),vee=new an({title:"Select parent node",run:A1,select:t=>A1(t),icon:kn.selectParentNode});let $ee=new an({title:"Undo last change",run:ip,enable:t=>ip(t),icon:kn.undo}),wee=new an({title:"Redo last undone change",run:qu,enable:t=>qu(t),icon:kn.redo});function xee(t,e){let n={run(r,i){return Q1(t,e.attrs)(r,i)},select(r){return Q1(t,e.attrs)(r)}};for(let r in e)n[r]=e[r];return new an(n)}u(xee,"wrapItem");function F1(t,e){let n=lp(t,e.attrs),r={run:n,enable(i){return n(i)},active(i){let{$from:l,to:a,node:o}=i.selection;return o?o.hasMarkup(t,e.attrs):a<=l.end()&&l.parent.hasMarkup(t,e.attrs)}};for(let i in e)r[i]=e[i];return new an(r)}u(F1,"blockTypeItem");function I1(t,e,n){n?t.classList.add(e):t.classList.remove(e)}u(I1,"setClass");const up="ProseMirror-menubar";function See(){if(typeof navigator>"u")return!1;let t=navigator.userAgent;return!/Edge\/\d/.test(t)&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t)}u(See,"isIOS");function Cee(t){return new jr({view(e){return new L1(e,t)}})}u(Cee,"menuBar");const Z$=class Z${constructor(e,n){this.editorView=e,this.options=n,this.spacer=null,this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.scrollHandler=null,this.root=e.root,this.wrapper=_t("div",{class:up+"-wrapper"}),this.menu=this.wrapper.appendChild(_t("div",{class:up})),this.menu.className=up,e.dom.parentNode&&e.dom.parentNode.replaceChild(this.wrapper,e.dom),this.wrapper.appendChild(e.dom);let{dom:r,update:i}=Q9(this.editorView,this.options.content);if(this.contentUpdate=i,this.menu.appendChild(r),this.update(),n.floating&&!See()){this.updateFloat();let l=Pee(this.wrapper);this.scrollHandler=a=>{let o=this.editorView.root;(o.body||o).contains(this.wrapper)?this.updateFloat(a.target.getBoundingClientRect?a.target:void 0):l.forEach(s=>s.removeEventListener("scroll",this.scrollHandler))},l.forEach(a=>a.addEventListener("scroll",this.scrollHandler))}}update(){if(this.editorView.root!=this.root){let{dom:e,update:n}=Q9(this.editorView,this.options.content);this.contentUpdate=n,this.menu.replaceChild(e,this.menu.firstChild),this.root=this.editorView.root}this.contentUpdate(this.editorView.state),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))}updateScrollCursor(){let e=this.editorView.root.getSelection();if(!e.focusNode)return;let n=e.getRangeAt(0).getClientRects(),r=n[kee(e)?0:n.length-1];if(!r)return;let i=this.menu.getBoundingClientRect();if(r.topi.top){let l=Dee(this.wrapper);l&&(l.scrollTop-=i.bottom-r.top)}}updateFloat(e){let n=this.wrapper,r=n.getBoundingClientRect(),i=e?Math.max(0,e.getBoundingClientRect().top):0;if(this.floating)if(r.top>=i||r.bottom(this.editorView.dom.ownerDocument.defaultView||window).innerHeight?"none":"",e&&(this.menu.style.top=i+"px")}else if(r.top=this.menu.offsetHeight+10){this.floating=!0;let l=this.menu.getBoundingClientRect();this.menu.style.left=l.left+"px",this.menu.style.width=l.width+"px",e&&(this.menu.style.top=i+"px"),this.menu.style.position="fixed",this.spacer=_t("div",{class:up+"-spacer",style:`height: ${l.height}px`}),n.insertBefore(this.spacer,this.menu)}}destroy(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)}};u(Z$,"MenuBarView");let L1=Z$;function kee(t){return t.anchorNode==t.focusNode?t.anchorOffset>t.focusOffset:t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}u(kee,"selectionIsInverted");function Dee(t){for(let e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}u(Dee,"findWrappingScrollable");function Pee(t){let e=[t.ownerDocument.defaultView||window];for(let n=t.parentNode;n;n=n.parentNode)e.push(n);return e}u(Pee,"getAllWrapping");const X$=class X${constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?Eee(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}};u(X$,"InputRule");let fr=X$;function Eee(t){return function(e,n,r,i){let l=t;if(n[1]){let a=n[0].lastIndexOf(n[1]);l+=n[0].slice(a+n[1].length),r+=a;let o=r-i;o>0&&(l=n[0].slice(a-o,a)+l,r=i)}return e.tr.insertText(l,r,i)}}u(Eee,"stringHandler");const Tee=500;function Aee({rules:t}){let e=new jr({state:{init(){return null},apply(n,r){let i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,l){return M9(n,r,i,l,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&M9(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}u(Aee,"inputRules");function M9(t,e,n,r,i,l){if(t.composing)return!1;let a=t.state,o=a.doc.resolve(e),s=o.parent.textBetween(Math.max(0,o.parentOffset-Tee),o.parentOffset,null,"\uFFFC")+r;for(let c=0;cm.type.spec.code))continue;if(o.parent.type.spec.code){if(!d.inCode)continue}else if(d.inCode==="only")continue;let f=d.match.exec(s);if(!f||f[0].length{g.isInline&&g.marks.some(O=>O.type.spec.code)&&(m=!0)}),m)continue}let p=d.handler(a,f,h,n);if(p)return d.undoable&&p.setMeta(l,{transform:p,from:e,to:n,text:r}),t.dispatch(p),!0}return!1}u(M9,"run");const Qee=u((t,e)=>{let n=t.plugins;for(let r=0;r=0;s--)a.step(o.steps[s].invert(o.docs[s]));if(l.text){let s=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,s))}else a.delete(l.from,l.to);e(a)}return!0}}return!1},"undoInputRule"),Mee=new fr(/--$/,"\u2014",{inCodeMark:!1}),Bee=new fr(/\.\.\.$/,"\u2026",{inCodeMark:!1}),Ree=new fr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C",{inCodeMark:!1}),Vee=new fr(/"$/,"\u201D",{inCodeMark:!1}),Nee=new fr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),Fee=new fr(/'$/,"\u2019",{inCodeMark:!1}),Iee=[Ree,Vee,Nee,Fee];function z1(t,e,n=null,r){return new fr(t,(i,l,a,o)=>{let s=n instanceof Function?n(l):n,c=i.tr.delete(a,o),d=c.doc.resolve(a),f=d.blockRange(),h=f&&Ry(f,e,s);if(!h)return null;c.wrap(f,h);let p=c.doc.resolve(a-1).nodeBefore;return p&&p.type==e&&io(c.doc,a-1)&&(!r||r(l,p))&&c.join(a-1),c})}u(z1,"wrappingInputRule");function B9(t,e,n=null){return new fr(t,(r,i,l,a)=>{let o=r.doc.resolve(l),s=n instanceof Function?n(i):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e)?r.tr.delete(l,a).setBlockType(l,l,e,s):null})}u(B9,"textblockTypeInputRule");const cp="ProseMirror-prompt";function R9(t){let e=document.body.appendChild(document.createElement("div"));e.className=cp;let n=u(h=>{e.contains(h.target)||r()},"mouseOutside");setTimeout(()=>window.addEventListener("mousedown",n),50);let r=u(()=>{window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},"close"),i=[];for(let h in t.fields)i.push(t.fields[h].render());let l=document.createElement("button");l.type="submit",l.className=cp+"-submit",l.textContent="OK";let a=document.createElement("button");a.type="button",a.className=cp+"-cancel",a.textContent="Cancel",a.addEventListener("click",r);let o=e.appendChild(document.createElement("form"));t.title&&(o.appendChild(document.createElement("h5")).textContent=t.title),i.forEach(h=>{o.appendChild(document.createElement("div")).appendChild(h)});let s=o.appendChild(document.createElement("div"));s.className=cp+"-buttons",s.appendChild(l),s.appendChild(document.createTextNode(" ")),s.appendChild(a);let c=e.getBoundingClientRect();e.style.top=(window.innerHeight-c.height)/2+"px",e.style.left=(window.innerWidth-c.width)/2+"px";let d=u(()=>{let h=Lee(t.fields,i);h&&(r(),t.callback(h))},"submit");o.addEventListener("submit",h=>{h.preventDefault(),d()}),o.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),r()):h.keyCode==13&&!(h.ctrlKey||h.metaKey||h.shiftKey)?(h.preventDefault(),d()):h.keyCode==9&&window.setTimeout(()=>{e.contains(document.activeElement)||r()},500)});let f=o.elements[0];f&&f.focus()}u(R9,"openPrompt");function Lee(t,e){let n=Object.create(null),r=0;for(let i in t){let l=t[i],a=e[r++],o=l.read(a),s=l.validate(o);if(s)return zee(a,s),null;n[i]=l.clean(o)}return n}u(Lee,"getValues");function zee(t,e){let n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout(()=>n.removeChild(r),1500)}u(zee,"reportInvalid");const j$=class j${constructor(e){this.options=e}read(e){return e.value}validateType(e){return null}validate(e){return!e&&this.options.required?"Required field":this.validateType(e)||(this.options.validate?this.options.validate(e):null)}clean(e){return this.options.clean?this.options.clean(e):e}};u(j$,"Field");let Z1=j$;const q$=class q$ extends Z1{render(){let e=document.createElement("input");return e.type="text",e.placeholder=this.options.label,e.value=this.options.value||"",e.autocomplete="off",e}};u(q$,"TextField");let Ll=q$;function V9(t,e){let n=t.selection.$from;for(let r=n.depth;r>=0;r--){let i=n.index(r);if(n.node(r).canReplaceWith(i,i,e))return!0}return!1}u(V9,"canInsert");function Zee(t){return new an({title:"Insert image",label:"Image",enable(e){return V9(e,t)},run(e,n,r){let{from:i,to:l}=e.selection,a=null;e.selection instanceof ae&&e.selection.node.type==t&&(a=e.selection.node.attrs),R9({title:"Insert image",fields:{src:new Ll({label:"Location",required:!0,value:a&&a.src}),title:new Ll({label:"Title",value:a&&a.title}),alt:new Ll({label:"Description",value:a?a.alt:e.doc.textBetween(i,l," ")})},callback(o){r.dispatch(r.state.tr.replaceSelectionWith(t.createAndFill(o))),r.focus()}})}})}u(Zee,"insertImageItem");function N9(t,e){let n={label:e.title,run:t};for(let r in e)n[r]=e[r];return!e.enable&&!e.select&&(n[e.enable?"enable":"select"]=r=>t(r)),new an(n)}u(N9,"cmdItem");function X1(t,e){let{from:n,$from:r,to:i,empty:l}=t.selection;return l?!!e.isInSet(t.storedMarks||r.marks()):t.doc.rangeHasMark(n,i,e)}u(X1,"markActive");function j1(t,e){let n={active(r){return X1(r,t)}};for(let r in e)n[r]=e[r];return N9(Ni(t),n)}u(j1,"markItem");function Xee(t){return new an({title:"Add or remove link",icon:kn.link,active(e){return X1(e,t)},enable(e){return!e.selection.empty},run(e,n,r){if(X1(e,t))return Ni(t)(e,n),!0;R9({title:"Create a link",fields:{href:new Ll({label:"Link target",required:!0}),title:new Ll({label:"Title"})},callback(i){Ni(t,i)(r.state,r.dispatch),r.focus()}})}})}u(Xee,"linkItem");function F9(t,e){return N9(S1(t,e.attrs),e)}u(F9,"wrapListItem");function I9(t){let e={},n;(n=t.marks.strong)&&(e.toggleStrong=j1(n,{title:"Toggle strong style",icon:kn.strong})),(n=t.marks.em)&&(e.toggleEm=j1(n,{title:"Toggle emphasis",icon:kn.em})),(n=t.marks.code)&&(e.toggleCode=j1(n,{title:"Toggle code font",icon:kn.code})),(n=t.marks.link)&&(e.toggleLink=Xee(n));let r;if((r=t.nodes.image)&&(e.insertImage=Zee(r)),(r=t.nodes.bullet_list)&&(e.wrapBulletList=F9(r,{title:"Wrap in bullet list",icon:kn.bulletList})),(r=t.nodes.ordered_list)&&(e.wrapOrderedList=F9(r,{title:"Wrap in ordered list",icon:kn.orderedList})),(r=t.nodes.blockquote)&&(e.wrapBlockQuote=xee(r,{title:"Wrap in block quote",icon:kn.blockquote})),(r=t.nodes.paragraph)&&(e.makeParagraph=F1(r,{title:"Change to paragraph",label:"Plain"})),(r=t.nodes.code_block)&&(e.makeCodeBlock=F1(r,{title:"Change to code block",label:"Code"})),r=t.nodes.heading)for(let l=1;l<=10;l++)e["makeHead"+l]=F1(r,{title:"Change to heading "+l,label:"Level "+l,attrs:{level:l}});if(r=t.nodes.horizontal_rule){let l=r;e.insertHorizontalRule=new an({title:"Insert horizontal rule",label:"Horizontal rule",enable(a){return V9(a,l)},run(a,o){o(a.tr.replaceSelectionWith(l.create()))}})}let i=u(l=>l.filter(a=>a),"cut");return e.insertMenu=new sp(i([e.insertImage,e.insertHorizontalRule]),{label:"Insert"}),e.typeMenu=new sp(i([e.makeParagraph,e.makeCodeBlock,e.makeHead1&&new N1(i([e.makeHead1,e.makeHead2,e.makeHead3,e.makeHead4,e.makeHead5,e.makeHead6]),{label:"Heading"})]),{label:"Type..."}),e.inlineMenu=[i([e.toggleStrong,e.toggleEm,e.toggleCode,e.toggleLink])],e.blockMenu=[i([e.wrapBulletList,e.wrapOrderedList,e.wrapBlockQuote,bee,yee,vee])],e.fullMenu=e.inlineMenu.concat([[e.insertMenu,e.typeMenu]],[[$ee,wee]],e.blockMenu),e}u(I9,"buildMenuItems");const L9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function jee(t,e){let n={},r;function i(l,a){if(e){let o=e[l];if(o===!1)return;o&&(l=o)}n[l]=a}if(u(i,"bind"),i("Mod-z",ip),i("Shift-Mod-z",qu),i("Backspace",Qee),L9||i("Mod-y",qu),i("Alt-ArrowUp",P1),i("Alt-ArrowDown",WJ),i("Mod-BracketLeft",E1),i("Escape",A1),(r=t.marks.strong)&&(i("Mod-b",Ni(r)),i("Mod-B",Ni(r))),(r=t.marks.em)&&(i("Mod-i",Ni(r)),i("Mod-I",Ni(r))),(r=t.marks.code)&&i("Mod-`",Ni(r)),(r=t.nodes.bullet_list)&&i("Shift-Ctrl-8",S1(r)),(r=t.nodes.ordered_list)&&i("Shift-Ctrl-9",S1(r)),(r=t.nodes.blockquote)&&i("Ctrl->",Q1(r)),r=t.nodes.hard_break){let l=r,a=ap(w9,(o,s)=>(s&&s(o.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0));i("Mod-Enter",a),i("Shift-Enter",a),L9&&i("Ctrl-Enter",a)}if((r=t.nodes.list_item)&&(i("Enter",wJ(r)),i("Mod-[",xJ(r)),i("Mod-]",kJ(r))),(r=t.nodes.paragraph)&&i("Shift-Ctrl-0",lp(r)),(r=t.nodes.code_block)&&i("Shift-Ctrl-\\",lp(r)),r=t.nodes.heading)for(let l=1;l<=6;l++)i("Shift-Ctrl-"+l,lp(r,{level:l}));if(r=t.nodes.horizontal_rule){let l=r;i("Mod-_",(a,o)=>(o&&o(a.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0))}return n}u(jee,"buildKeymap");function qee(t){return z1(/^\s*>\s$/,t)}u(qee,"blockQuoteRule");function Wee(t){return z1(/^(\d+)\.\s$/,t,e=>({order:+e[1]}),(e,n)=>n.childCount+n.attrs.order==+e[1])}u(Wee,"orderedListRule");function Yee(t){return z1(/^\s*([-+*])\s$/,t)}u(Yee,"bulletListRule");function Kee(t){return B9(/^```$/,t)}u(Kee,"codeBlockRule");function Uee(t,e){return B9(new RegExp("^(#{1,"+e+"})\\s$"),t,n=>({level:n[1].length}))}u(Uee,"headingRule");function Gee(t){let e=Iee.concat(Bee,Mee),n;return(n=t.nodes.blockquote)&&e.push(qee(n)),(n=t.nodes.ordered_list)&&e.push(Wee(n)),(n=t.nodes.bullet_list)&&e.push(Yee(n)),(n=t.nodes.code_block)&&e.push(Kee(n)),(n=t.nodes.heading)&&e.push(Uee(n,6)),Aee({rules:e})}u(Gee,"buildInputRules");function _ee(t){let e=[Gee(t.schema),h9(jee(t.schema,t.mapKeys)),h9(iee),lee(),see()];return t.menuBar!==!1&&e.push(Cee({floating:t.floatingMenu!==!1,content:t.menuContent||I9(t.schema).fullMenu})),t.history!==!1&&e.push(IJ()),e.concat(new jr({props:{attributes:{class:"ProseMirror-example-setup-style"}}}))}u(_ee,"exampleSetup");const Hee=wp.element.forwardRef(({rawView:t=!0,...e},n)=>{const[r,i]=wp.element.useState(e.value??""),[l,a]=wp.element.useState("visual"),o=wp.element.useRef(null),s=Hr.get("button-group");return wp.element.useEffect(()=>{e.onChange&&e.onChange(r)},[r]),wp.element.useEffect(()=>{const c=new Mh({nodes:yJ(f9.spec.nodes,"paragraph block*","block"),marks:f9.spec.marks}),d=_ee({schema:c,menuContent:I9(c).fullMenu}),f=document.createElement("div"),h=document.createElement("div");h.innerHTML=r,f.appendChild(h);const p=ku.fromSchema(c).parse(h,{preserveWhitespace:!0}),m=jy.create({doc:p,plugins:d});return o.current=new tp(n.current,{state:m,dispatchTransaction:g=>{const O=o.current.state.apply(g);o.current.updateState(O);const b=o.current.dom.innerHTML;i(b)}}),()=>o.current.destroy()},[l]),wp.element.createElement("div",{className:"tf-editor-content"},t&&wp.element.createElement("div",{className:"tf-editor-view-toggle"},wp.element.createElement(s,{label:"Switch view",labelVisuallyHidden:!0,value:l,onChange:c=>{a(c),c==="raw"&&(n.current=null)},choices:{visual:"Visual",raw:"Raw"}})),l==="visual"?wp.element.createElement("div",{className:"tf-editor-visual-view",ref:n}):wp.element.createElement(LQ,{value:r,onChange:i}))});var Jee=Object.defineProperty,ete=u((t,e)=>Jee(t,"name",{value:e,configurable:!0}),"n$7");const tte=ete(t=>{const[e,n]=wp.element.useState(t.value),r=wp.element.useRef(null),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",name:t.name,value:e}),wp.element.createElement(Hee,{ref:r,value:e,onChange:n,rawView:t.rawView??!0}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Editor");var nte=Object.defineProperty,rte=u((t,e)=>nte(t,"name",{value:e,configurable:!0}),"l$5");const ite=rte(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si(t,e),[l,a]=wp.element.useState(t.value);return wp.element.useEffect(()=>{a(t.value)},[t.value]),wp.element.useEffect(()=>{setTimeout(()=>{tinyMCE.init({target:e.current,setup:function(o){o.on("input",()=>a(o.getContent()))}})})},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{ref:e,...r},l),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TinyMce");var lte=Object.defineProperty,ate=u((t,e)=>lte(t,"name",{value:e,configurable:!0}),"t$4"),z9=ate(t=>{const{editor:e}=t;return e==="tinymce"?wp.element.createElement(ite,{...t}):wp.element.createElement(tte,{...t})},"default"),ote=Object.defineProperty,ste=u((t,e)=>ote(t,"name",{value:e,configurable:!0}),"n$6");const ute=ste(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?v0:pp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...t,...a})},"FieldGroupItem");var cte=Object.defineProperty,q1=u((t,e)=>cte(t,"name",{value:e,configurable:!0}),"s$6");const W1=q1(t=>{const[e,n]=wp.element.useState([]),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(On(t.value??"")),o=wp.element.useRef();o.current=l;const s=q1((f,h)=>{a({...l,[f]:h}),e.length!==0&&i(()=>()=>{e.map(p=>p(f))})},"setAttribute");wp.element.useEffect(()=>{t.onChange&&t.onChange(l),r&&(r(),i(!1))},[l]);const c=t.fields??[],d=q1(f=>c.map(h=>h.name??!1).includes(f),"hasField");return wp.element.createElement("div",{className:"tf-field-group"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l)}),c.map((f,h)=>wp.element.createElement("div",{key:h,className:"tf-field-group-item"},wp.element.createElement(ute,{values:l,config:f,onChange:p=>s(f.name,p),data:{getValue:p=>d(p)?o.current[p]??"":t.data.getValue(p)??"",watcher:p=>{n(m=>[...m,g=>p(g)])}}}))))},"FieldGroup");var dte=Object.defineProperty,Z9=u((t,e)=>dte(t,"name",{value:e,configurable:!0}),"p$1");const fte=Z9(t=>{const{api:e}=yr(),n=new FormData;return n.append("file",t),n.append("title",t.name),n.append("caption",t.caption),YU(e.endpoint.media,n)},"postMedia"),X9=Z9(t=>{const{api:e}=yr();return qQ(e.endpoint.media+t)},"getMedia");var hte=Object.defineProperty,j9=u((t,e)=>hte(t,"name",{value:e,configurable:!0}),"s$5");const pte=j9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);if(wp.element.useEffect(()=>{j9(async()=>{const o=await X9(t.id);i(o),n(!0)},"fetch")()},[]),!e||!r)return wp.element.createElement("li",{className:"tf-file-item"},"Loading...");const l=r.source_url,a=l.split("/").pop().split(".").length===2?l.split("/").pop().split(".")[1]:"";return wp.element.createElement("li",{className:"tf-file-item"},r.media_type==="image"&&wp.element.createElement("img",{loading:"lazy",decoding:"async",src:l,alt:r.alt_text,className:"attachment-medium size-medium"}),wp.element.createElement("span",null,`${r.title.rendered}${a!==""?"."+a:""}`),wp.element.createElement(se,{type:"action",onPress:()=>t.remove()},"Remove"))},"FilePreview");var mte=Object.defineProperty,_r=u((t,e)=>mte(t,"name",{value:e,configurable:!0}),"l$4");const gte=_r(t=>{const{mimetypes:e}=yr(),n=wp.element.useRef(null),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(!1),[o,s]=wp.element.useState(t.value?Array.isArray(t.value)?t.value:JSON.parse(t.value):[]),[c,d]=wp.element.useState(!1),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(o),[o]);const m=t.placeholder??"No file selected",g=t.maxUpload??!1,O=_r(()=>(g===!1||o.length(g===!1||o.length{a(!0),d(!1),fte(r[0]).then(C=>s([...o,C.id])).catch(C=>d(C.message)).finally(()=>{i(!1),a(!1)})},"upload"),$=_r(C=>{s([...o.slice(0,C),...o.slice(C+1)])},"removeUpload"),v=_r(()=>t.wp_media===!1||t.wp_media==="false","isWpMediaDisabled"),S=_r(()=>{const{mimeTypes:C}=t,Q=Object.values(e),T=_r(B=>B.includes("/")?B:Q.filter(w=>w.startsWith(`${B}/`)),"filterByMimetypePrefix");return(C?Array.isArray(C)?C.flatMap(T):T(C):Q).join(", ")},"getAllowedTypes"),x=_r(()=>{const C=wp.media({title:"Choose File",multiple:!1,library:{type:S()}});C.on("select",()=>{const Q=C.state().get("selection").first().toJSON();s([...o,Q.id])}),C.open()},"open");return wp.element.createElement("div",{className:"tf-file"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement(gn,null,wp.element.createElement("input",{type:"file",ref:n,accept:S(),onChange:C=>i(C.target.files),...h})),wp.element.createElement("div",{className:"tf-file-container"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(o)}),wp.element.createElement("ul",{className:"tf-file-list"},o.map((C,Q)=>wp.element.createElement(pte,{key:C,id:C,remove:()=>$(Q)}))),wp.element.createElement("div",{className:"tf-file-field"},wp.element.createElement(se,{type:"action",onPress:()=>v()?n.current.click():x(),isDisabled:!b(),"aria-hidden":"true"},t.buttonText??"Choose"),wp.element.createElement("div",{className:"tf-file-text","aria-hidden":"true"},r.length>0?r[0].name:m),v()&&wp.element.createElement(se,{type:"action",onPress:y,isDisabled:!O()},t.uploadText??"Upload"))),c&&wp.element.createElement(KP,{message:c,type:"error",onDismiss:()=>d(!1)}),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"FileUpload");var Ote=Object.defineProperty,dp=u((t,e)=>Ote(t,"name",{value:e,configurable:!0}),"l$3");const bte=dp(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(t.value&&t.value!==""?typeof t.value!="object"?JSON.parse(t.value):t.value:{type:"linear",angle:45,shape:"ellipse",colors:["rgba(0,255,255,1)","rgba(0,255,255,1)"]}),o=wp.element.useRef(),s=wp.element.useRef(),c=wp.element.useRef(),d=wp.element.useRef(),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange({...l,stringValue:m()})},[l]);const m=dp(()=>{switch(l.type){case"linear":return`linear-gradient(${l.angle}deg, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"radial":return`radial-gradient(${l.shape}, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"conic":return`conic-gradient(${l.colors[0]} 0%, ${l.colors[1]} 100%)`}},"generateGradient"),g=dp((b,y)=>{const $=[...l.colors];$[b]=y?.toString("rgba"),O("colors",$)},"updateColor"),O=dp((b,y)=>{a({...l,[b]:y})},"updateValue");return wp.element.createElement("div",{className:"tf-gradient"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement("div",{className:"tf-gradient-container",ref:d},wp.element.createElement("input",{ref:s,type:"text",className:"tf-gradient-input",value:m(),onClick:b=>i(!0),readOnly:!0}),wp.element.createElement("input",{type:"hidden",ref:o,value:JSON.stringify(l),name:t.name??"",...h}),r&&wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:s,placement:"bottom start",style:{width:d?.current?.offsetWidth,minWidth:"fit-content"},className:"tf-gradient-popover"},wp.element.createElement(Os,null,wp.element.createElement($d,{autoFocus:!0},wp.element.createElement("div",{className:"tf-gradient-popover-content"},wp.element.createElement("div",{className:"tf-gradient-preview",ref:c,style:{background:m()}},wp.element.createElement("div",{className:"tf-gradient-colors"},l.colors?.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-gradient-color tf-color-area-thumb",style:{background:l.colors[y]},onClick:()=>n(y)})))),wp.element.createElement("div",{className:"tf-gradient-settings"},wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(eu,{label:"Gradient type",selectedKey:l.type??"linear",onSelectionChange:b=>O("type",b)},wp.element.createElement(Qr,{key:"linear"},"Linear"),wp.element.createElement(Qr,{key:"radial"},"Radial"),wp.element.createElement(Qr,{key:"conic"},"Conical"))),wp.element.createElement("div",null,l.type==="linear"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Rf,{label:"Angle",value:l.angle??45,onChange:b=>O("angle",b)})),l.type==="radial"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(eu,{label:"Shape",selectedKey:l.shape??"ellipse",onSelectionChange:b=>O("shape",b)},wp.element.createElement(Qr,{key:"circle"},"Circle"),wp.element.createElement(Qr,{key:"ellipse"},"Ellipse"))))))))),e!==!1&&wp.element.createElement(Rr,{state:{isOpen:e!==!1,close:()=>n(!1)},triggerRef:c,placement:e===0?"bottom start":"bottom end"},wp.element.createElement(ZQ,{value:l.colors[e],onChange:b=>g(e,b),hasAlpha:!0,onFocusChange:b=>b===!1?n(!1):!1}))),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"Gradient");var yte=Object.defineProperty,q9=u((t,e)=>yte(t,"name",{value:e,configurable:!0}),"a$2");const vte=q9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);return wp.element.useEffect(()=>{q9(async()=>{const l=await X9(t.id);i(l),n(!0)},"fetch")()},[]),!e||!r?wp.element.createElement("div",{className:"tf-gallery-item"},"Loading..."):wp.element.createElement("div",{className:"tf-gallery-item"},wp.element.createElement("img",{src:r.source_url}))},"ImagePreview");var $te=Object.defineProperty,fp=u((t,e)=>$te(t,"name",{value:e,configurable:!0}),"a$1");const wte=fp(t=>{const e=fp(c=>(c!=="[]"?c.split(","):[]).map(d=>d.replaceAll("[","").replaceAll("]","").replaceAll('"',"")),"initValue"),[n,r]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value?e(t.value):[]),{labelProps:i,inputProps:l,descriptionProps:a}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const o=fp(()=>{const c=wp.media({frame:"post",multiple:!0,button:{text:"Use this media"},library:{type:["image"]},state:n.length<1?"gallery":"gallery-edit",selection:s()});c.on({update:d=>{r(d.models.map(f=>f.id))},open:()=>{c.menuView.unset("playlist"),c.menuView.unset("video-playlist")}},void 0),c.open()},"open"),s=fp(()=>{const c=wp.media.query({orderby:"post__in",order:"ASC",type:"image",perPage:-1,post__in:n});return new wp.media.model.Selection(c.models,{props:c.props.toJSON(),multiple:!0})},"getSelection");return wp.element.createElement("div",{className:"tf-gallery"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-gallery__controls"},wp.element.createElement("div",{className:"tf-gallery-preview"},n.map(c=>wp.element.createElement(vte,{key:c,id:c})))),wp.element.createElement("div",{className:"tf-gallery-buttons"},wp.element.createElement(se,{type:"action",onPress:o},n.length<1?"Create gallery":"Edit gallery"),n.length>0&&wp.element.createElement(se,{type:"action",onPress:()=>r([])},"Clear gallery")),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:n.join(","),...l}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Gallery");var xte=Object.defineProperty,Ste=u((t,e)=>xte(t,"name",{value:e,configurable:!0}),"a");const Cte=Ste(t=>wp.element.createElement("input",{type:"hidden",name:t.name,value:t.value,...t.attributes,className:`tf-hidden ${t.class??""} ${t.className??""}`}),"InputHidden");var kte=Object.defineProperty,Uu=u((t,e)=>kte(t,"name",{value:e,configurable:!0}),"i$4");const Dte=Uu(t=>{const e={value:"",_canDelete:!0,_enabled:!0},[n,r]=wp.element.useState(On(t.value??"[]",[]));wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const[i,l]=wp.element.useState(""),a=wp.element.useRef(0),{labelProps:o,fieldProps:s,descriptionProps:c}=$t(t),d=Uu(()=>{r([...n,{...e,value:i}]),l(""),a.current=a.current+1},"addSelectedItem"),f=Uu(m=>{r([...n.slice(0,m),...n.slice(m+1)])},"removeItem"),h=Uu((m,g,O)=>{setTimeout(()=>{r([...n.slice(0,m),{...n[m],[g]:O},...n.slice(m+1)])})},"updateItem"),p=Uu(m=>t.isAsync?m.label:t.choices[m]??m,"getItemText");return t.isAsync&&console.warn("Async mode is not supported yet for the list field"),wp.element.createElement("div",{className:"tf-list"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(n),...s}),wp.element.createElement("div",{className:"tf-list-container"},wp.element.createElement("div",{className:"tf-list-items"},wp.element.createElement("div",{className:"tf-list-header"},t.label&&wp.element.createElement(xe,{labelProps:o,parent:t},t.label),wp.element.createElement("div",{className:"tf-list-header-actions"})),wp.element.createElement("div",{className:"tf-list-items"},n.map((m,g)=>wp.element.createElement("div",{key:m.value,className:"tf-list-item"},wp.element.createElement("div",{className:"tf-list-item-text"},p(m.value)),wp.element.createElement("div",{key:m,className:"tf-list-item-actions"},m._canDelete&&wp.element.createElement(se,{type:"icon-trash",onPress:()=>f(g)}),t.useVisibility&&wp.element.createElement(se,{type:"icon-eye",onPress:()=>h(g,"_enabled",!m._enabled),style:m._enabled?{}:{opacity:.5,filter:"grayscale(60%)"}})))))),wp.element.createElement("div",{className:"tf-list-search"},wp.element.createElement(Sh,{...t,name:null,key:a.current,value:i,description:!1,labelVisuallyHidden:!0,disabledKeys:n.map(m=>m.value),multiple:!1,onChange:m=>{m&&l(m)}}),wp.element.createElement(se,{type:"action",onPress:d,isDisabled:i===""},"Add"))),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"List");var Pte=Object.defineProperty,Ete=u((t,e)=>Pte(t,"name",{value:e,configurable:!0}),"t$3"),Tte=Ete(t=>{const[e,n]=wp.element.useState(t.value??""),r=rl(t.choices??{});return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement(gE,{...t,onChange:n},r.map(i=>wp.element.createElement(OE,{key:i.value??"",...i},i.label??"")))},"default"),Ate=Object.defineProperty,Qte=u((t,e)=>Ate(t,"name",{value:e,configurable:!0}),"m$5");const Mte=Qte(t=>{const[e,n]=wp.element.useState(t.value?q2(t.value):new Set),[r,i]=wp.element.useState(!1),l=b0({...t,selectionMode:"multiple",onSelectionChange:n,selectedKeys:e}),a=wp.element.useRef(),o=wp.element.useRef(),s=wp.element.useRef(),{listBoxProps:c,labelProps:d,descriptionProps:f}=iD(t,l,a);wp.element.useEffect(()=>{t.onChange&&t.onChange([...e])},[e]);const h=wp.element.createElement(Nd,{listBoxRef:a,state:l,items:t.items,...c});return wp.element.createElement("div",{className:"tf-multiple-select",ref:s},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:[...e].join(",")}),t.label&&wp.element.createElement(xe,{labelProps:d,parent:t},t.label),wp.element.createElement(se,{type:"select",ref:o,onPress:()=>i(!r)},wp.element.createElement("span",{className:"tf-multiple-select__value"},e.size>0?e.size===1?e.size+" item selected":e.size+" items selected":t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),r?wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:o,placement:"bottom start",style:{width:s?.current?.offsetWidth}},h):wp.element.createElement(gn,null,h),t.description&&wp.element.createElement(we,{descriptionProps:f,parent:t},t.description))},"MultipleSelect");var Bte=Object.defineProperty,Rte=u((t,e)=>Bte(t,"name",{value:e,configurable:!0}),"t$2"),W9=Rte(t=>t.multiple?wp.element.createElement(Mte,{items:rl(t.choices??{}),...t,onChange:t.onChange},zd):wp.element.createElement(eu,{selectedKey:t.value,onSelectionChange:t.onChange,items:rl(t.choices??{}),...t},zd),"default"),Vte=Object.defineProperty,Y9=u((t,e)=>Vte(t,"name",{value:e,configurable:!0}),"l$2");const Nte=Y9(t=>{const e=t.units??["px"],{labelProps:n,fieldProps:r,descriptionProps:i}=$t(t),[l,a]=wp.element.useState(On(t.value??"",{value:0,unit:e[0]}));wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]);const o=Y9((s,c)=>{a({...l,[c]:s})},"setAttribute");return wp.element.createElement("div",{className:"tf-simple-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l),...r}),wp.element.createElement("div",{className:"tf-simple-dimensions-container"},wp.element.createElement("div",null,wp.element.createElement(Rf,{value:l.value??0,name:"value",label:"Dimension number",labelVisuallyHidden:!0,description:!1,onChange:s=>o(s,"value")})),wp.element.createElement(eu,{label:"Dimension unit",labelVisuallyHidden:!0,description:!1,selectedKey:l.unit??"px",onSelectionChange:s=>o(s,"unit"),placeholder:"unit"},e.map(s=>wp.element.createElement(Qr,{key:s},s)))),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"Dimensions");var Fte=Object.defineProperty,Ite=u((t,e)=>Fte(t,"name",{value:e,configurable:!0}),"l$1");const Lte=Ite(t=>{const e=Cx(t),n=wp.element.useRef(),{inputProps:r}=eI({...t,children:t.label??""},e,n),{focusProps:i}=is(),{labelProps:l,fieldProps:a,descriptionProps:o}=$t(t);return wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]),wp.element.createElement("div",{className:"tf-switch"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement("label",{className:"tf-switch-label"},wp.element.createElement(gn,null,wp.element.createElement("input",{...a,...r,...i,ref:n,name:""})),wp.element.createElement("div",{className:`tf-switch-element${e.isSelected?"-selected":""}`,"aria-hidden":"true"},wp.element.createElement("span",null))),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Switch");var zte=Object.defineProperty,Zte=u((t,e)=>zte(t,"name",{value:e,configurable:!0}),"t$1"),Y1=Zte(t=>{const e=t.valueOn??"on",n=t.valueOff??"off",[r,i]=wp.element.useState(t.value??n);return wp.element.useEffect(()=>t.onChange&&t.onChange(r),[r]),wp.element.useEffect(()=>{[e,n].includes(t.value)&&t.value!==r&&i(t.value)},[t.value]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(Lte,{label:t.label??"",labelVisuallyHidden:t.labelVisuallyHidden??!1,description:t.description??"",value:r===e,onChange:l=>i(l?e:n)}))},"default"),Xte=Object.defineProperty,jte=u((t,e)=>Xte(t,"name",{value:e,configurable:!0}),"s$4");const qte=jte(t=>{const{Header:e,Container:n,Content:r,Title:i}=UP,l=Object.keys(t.tabs??{}).map(d=>({...t.tabs[d],name:d})),[a,o]=wp.element.useState(l[0]?.name??!1),[s,c]=wp.element.useState(On(t.value));return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(s)}),wp.element.createElement(n,null,wp.element.createElement(e,null,l.map(d=>wp.element.createElement(i,{key:d.name,isOpen:d.name===a,onPress:()=>o(d.name)},d.title))),l&&l.map((d,f)=>wp.element.createElement(r,{key:d.name,isActive:d.name===a},wp.element.createElement(W1,{...t,name:null,fields:d.fields,value:s[f]??{},onChange:h=>c({...s,[f]:h})})))))},"Tab");var Wte=Object.defineProperty,Yte=u((t,e)=>Wte(t,"name",{value:e,configurable:!0}),"n$4");const K9=Yte(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-text"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement(zX,{...t,inputProps:l,onChange:n,ref:r,dynamic:t.dynamic??!1}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"TextField");var Kte=Object.defineProperty,Ute=u((t,e)=>Kte(t,"name",{value:e,configurable:!0}),"i$3");const Gte=Ute(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si({...t,inputElementType:"textarea"},e);return wp.element.createElement("div",{className:"tf-text-area"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{...r,maxLength:t.maxlength,minLength:t.minlength,required:t.required,rows:t.rows,ref:e,"data-identifier":t.identifier??""}),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TextArea");var _te=Object.defineProperty,Hte=u((t,e)=>_te(t,"name",{value:e,configurable:!0}),"m$4");const Jte=Hte(t=>{const{locale:e}=Re(),n=WI({...t,value:t.value,onChange:s=>{const{hour:c,minute:d,second:f}=s;t.onChange?.(new Tr(c,d,f))},locale:e,minValue:t.minValue,maxValue:t.maxValue}),r=wp.element.useRef(),{labelProps:i,descriptionProps:l,fieldProps:a,inputProps:o}=pF(t,n,r);return wp.element.createElement("div",{className:"tf-time-wrapper"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{...a,className:"tf-time-field"},n.segments.map((s,c)=>wp.element.createElement(iM,{key:c,segment:s,state:n})),n.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"TimeField");var ene=Object.defineProperty,U9=u((t,e)=>ene(t,"name",{value:e,configurable:!0}),"t");const tne=U9(t=>{const e=U9(o=>{if(!o||typeof o!="string")return new Tr(0,0);if(o instanceof Tr)return o;const[s,c]=o.split(":").map(d=>parseInt(d));return new Tr(s,c)},"convertTime"),n=parseInt(t.hourCycle)??12,[r,i]=wp.element.useState(e(t.value)),l=e(t.minValue??"00:00"),a=e(t.maxValue??"23:59");return wp.element.useEffect(()=>{e(t.value).toString()!==r.toString()&&i(t.value)},[t.value]),wp.element.useEffect(()=>{r.toString()!==t.value.toString()&&t.onChange?.(r.toString())},[r]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-time-picker"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(Jte,{label:t.label??"",description:t.description??"",labelVisuallyHidden:t.labelVisuallyHidden,descriptionVisuallyHidden:t.descriptionVisuallyHidden,value:r,onChange:i,name:t.name??"",hourCycle:n,minValue:l,maxValue:a})))},"TimePicker");var nne=Object.defineProperty,G9=u((t,e)=>nne(t,"name",{value:e,configurable:!0}),"c$3");const K1=G9(t=>{const[e,n]=wp.element.useState(""),[r,i]=wp.element.useState(!1);wp.element.useEffect(()=>{r?t.dispatch({type:"bulkCheck"}):t.dispatch({type:"bulkUncheck"})},[r]);const l=G9(()=>{switch(e){case"enabled":case"disabled":t.dispatch({type:"bulkUpdate",control:"enabled",value:e==="enabled"?"on":"off",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break;case"deletion":t.dispatch({type:"bulkRemove",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break}},"applyAction");return wp.element.createElement("div",{className:"tf-repeater-bulk-actions"},wp.element.createElement(nu,{label:"Select or unselect all items",labelVisuallyHidden:!0,value:r,onChange:i}),wp.element.createElement(W9,{label:"Select bulk action",labelVisuallyHidden:!0,placeholder:"Bulk actions",choices:t.actions,value:e,onChange:n}),e==="deletion"?wp.element.createElement(ws,{title:"Confirmation",label:"Apply",onValidate:l},"Are you sure you want to remove the selected items?"):wp.element.createElement(se,{type:"action",onPress:l},"Apply"))},"BulkActions");var rne=Object.defineProperty,Gu=u((t,e)=>rne(t,"name",{value:e,configurable:!0}),"n$3");const ine=Gu((t,e=!1)=>e?e.map(n=>typeof n=="object"?n.name??!1:n):t.map(n=>n.name??""),"getHeaderFieldsName"),lne=Gu((t,e=!1)=>{const n=ine(t,e);return t.filter(r=>n.includes(r.name)||n.includes(r.name+".label")).map(r=>ane(r,e))},"getHeaderConfig"),ane=Gu((t,e)=>{const n=e?e.find(r=>typeof r=="object"&&r.callback&&r.name===t.name):!1;return{...t,callback:n?one(n):!1}},"formatConfig"),one=Gu(t=>typeof t.callback=="function"?t.callback:typeof t.callback=="string"?J9.repeater.__callbacks[t.callback]??!1:!1,"getCallback"),sne=Gu((t,e)=>!e[t.name]||e[t.name]===""?wp.element.createElement("i",null,"Empty"):t.callback?t.callback({column:t,value:e[t.name]}):typeof e[t.name]=="object"?e[t.name].label===""?JSON.stringify(e[t.name]):e[t.name].label:e[t.name],"renderHeaderValue");var une=Object.defineProperty,cne=u((t,e)=>une(t,"name",{value:e,configurable:!0}),"f$2");const dne=cne(({items:t,fields:e,rowFields:n,renderItem:r,maxLength:i,dispatch:l,headerFields:a=!1,beforeRow:o=!1,afterRow:s=!1,renderAction:c,renderFooterActions:d,useBulk:f})=>{const[h,p]=wp.element.useState(!1),m=lne(e,a);return wp.element.createElement(wp.element.Fragment,null,f&&wp.element.createElement(K1,{actions:{deletion:"Delete"},dispatch:l}),wp.element.createElement("div",{className:"tf-repeater-advanced"},wp.element.createElement("div",{className:"tf-repeater-advanced-header tf-repeater-advanced-label-row"},wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"}),m.map((g,O)=>wp.element.createElement("div",{key:O,className:"tf-repeater-advanced-header-item tf-repeater-advanced-label-row-item"},g.label??"")),wp.element.createElement("div",{key:"arrow",className:"tf-repeater-advanced-label-row-arrow"})),wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-advanced-items"},t&&t.slice(0,i).map((g,O)=>wp.element.createElement("div",{key:g.key??O,className:"tf-repeater-advanced-item","data-open":h===O?"true":"false"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview tf-repeater-advanced-label-row"},f&&wp.element.createElement("div",{className:"tf-repeater-advanced-item-checkbox",onClick:b=>b.stopPropagation()},wp.element.createElement(nu,{label:`Select item ${O+1}`,labelVisuallyHidden:!0,value:g._bulkCheckbox,onChange:b=>l({type:"update",item:O,control:"_bulkCheckbox",value:b})})),wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"},O+1),wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-container"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-fields"},m.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-repeater-advanced-overview-item tf-repeater-advanced-label-row-item"},sne(b,g)))),i!==void 0&&wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-actions"},wp.element.createElement(se,{type:"text-primary",onPress:()=>p(h===O?!1:O)},h===O?"Close":"Edit"),c("clone",O,{type:"text-primary"}),c("delete",O,{buttonProps:{type:"text-danger"}}))),wp.element.createElement(se,{key:"arrow",type:"repeater-overview-open",onPress:()=>p(h===O?!1:O),changeTag:"span",className:"tf-repeater-advanced-label-row-arrow"},wp.element.createElement("div",null))),h===O&&wp.element.createElement("div",{className:"tf-repeater-advanced-row"},o&&o(g,O,l),n.map(b=>wp.element.createElement("div",{key:b.name??O,className:"tf-repeater-advanced-item-field"},r(b,g,O))),s&&s(g,O,l)))))),d())},"Advanced");var fne=Object.defineProperty,hne=u((t,e)=>fne(t,"name",{value:e,configurable:!0}),"f$1");const pne=hne(({items:t,rowFields:e,renderItem:n,maxLength:r,dispatch:i,beforeRow:l=!1,afterRow:a=!1,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-bare-items"},t&&t.slice(0,r).map((c,d)=>wp.element.createElement("div",{key:c.key??d,className:"tf-repeater-bare-row"},l&&l(c,d,i),e.map(f=>wp.element.createElement("div",{key:f.name??d,className:"tf-repeater-bare-item-field"},n(f,c,d))),o("delete",d),a&&a(c,d,i)))),s()),"Bare");var mne=Object.defineProperty,gne=u((t,e)=>mne(t,"name",{value:e,configurable:!0}),"d$1");const _9=gne((t,e,n,r,i,l)=>{const a=n||"Item "+(e+1);if(!HP(a))return a;const o={type:"wrapper",name:`_repeater-title-${r}-${t.key}`,content:n,dependent:{callbackData:{repeater:{props:l,item:t,index:e}},...l.dependent?l.dependent:{}}};return i(o,t,e)},"renderTitle");var One=Object.defineProperty,hp=u((t,e)=>One(t,"name",{value:e,configurable:!0}),"n$2");const bne=hp(({items:t,dispatch:e,rowFields:n,renderItem:r,maxLength:i,title:l=!1,useSwitch:a,useBulk:o,name:s,renderFooterActions:c,renderAction:d,parent:f})=>{const[h,p]=wp.element.useState(0),m=hp(y=>p(y!==h?y:!1),"toggleItem"),g={deletion:"Delete"};a&&(g.enabled="Enabled",g.disabled="Disabled");const O=hp((y,$)=>wp.element.createElement(wp.element.Fragment,null,o?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(nu,{label:`Select item ${$+1}`,labelVisuallyHidden:!0,value:y._bulkCheckbox,onChange:v=>e({type:"update",item:$,control:"_bulkCheckbox",value:v})})):null,a?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(Y1,{label:`Enable item ${$+1}`,labelVisuallyHidden:!0,value:y.enabled,onChange:v=>e({type:"update",item:$,control:"enabled",value:v})})):null),"getHeaderLeft"),b=hp((y,$)=>wp.element.createElement(wp.element.Fragment,null,d("clone",y),wp.element.createElement(se,{type:"action",onPress:()=>m(y)},h!==y?"Edit":"Close"),d("delete",y)),"actions");return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-block-items"},o&&wp.element.createElement(K1,{actions:g,dispatch:e}),t&&t.slice(0,i).map((y,$)=>wp.element.createElement(G2,{key:y.key??$,title:_9(y,$,l,s,r,f),footer:b($,y),isOpen:h===$,className:"tf-repeater-block-item",onChange:v=>v?h!==$?p($):null:h===$?p(!1):null,headerLeft:O(y,$)},n.map(v=>wp.element.createElement("div",{key:v.name??$,className:"tf-repeater-block-item-field"},r(v,y,$)))))),c())},"Block");var yne=Object.defineProperty,vne=u((t,e)=>yne(t,"name",{value:e,configurable:!0}),"c$1");const $ne={deletion:"Delete"},wne=vne(({items:t,fields:e,dispatch:n,rowFields:r,renderItem:i,maxLength:l,useBulk:a,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",null,a&&wp.element.createElement(K1,{actions:$ne,dispatch:n}),wp.element.createElement("table",null,wp.element.createElement("thead",null,wp.element.createElement("tr",null,a&&wp.element.createElement("th",null),e.map((c,d)=>wp.element.createElement("th",{key:d},c.label??"")),l>1&&wp.element.createElement("th",{align:"end"}))),wp.element.createElement("tbody",{className:"tf-repeater-items tf-repeater-table-items"},t&&t.slice(0,l).map((c,d)=>wp.element.createElement("tr",{key:c.key??d},a&&wp.element.createElement("td",{key:`${c.key}-enable`},wp.element.createElement("div",{onClick:f=>f.stopPropagation()},wp.element.createElement(nu,{value:c._bulkCheckbox,onChange:f=>n({type:"update",item:d,control:"_bulkCheckbox",value:f})}))),r.map((f,h)=>wp.element.createElement("td",{key:`${c.key}-${h}`},i(f,c,d))),wp.element.createElement("td",{className:"tf-repeater-row-actions"},wp.element.createElement("div",null,o("clone",d),o("delete",d)))))))),s()),"Table");var xne=Object.defineProperty,Sne=u((t,e)=>xne(t,"name",{value:e,configurable:!0}),"m$1");const Cne=Sne(({items:t,rowFields:e,renderItem:n,renderAction:r,maxLength:i,dispatch:l,name:a,title:o=!1,beforeRow:s=!1,afterRow:c=!1,parent:d,string:f})=>{const{Header:h,Container:p,Content:m,Row:g,RowField:O,RowLabel:b,RowTitle:y,Title:$}=UP,[v,S]=wp.element.useState(0),x=wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-tab-add-item tf-tab-item"},i!==void 0&&wp.element.createElement(se,{type:"text-primary",onPress:()=>l({type:"add"}),isDisabled:i<=t.length},f("add"))),wp.element.createElement("div",{className:"tf-repeater-tab-icon-actions"},r("clone",v,{type:"icon-clone",className:"tf-tab-item",contentVisuallyHidden:!0}),r("delete",v,{label:"Remove",title:"Confirmation",onValidate:()=>{l({type:"remove",item:v}),S(v==0?0:v-1)},buttonProps:{type:"icon-trash",contentVisuallyHidden:!0,className:"tf-tab-item"}})));return wp.element.createElement(p,{className:"tf-repeater-tab-container"},wp.element.createElement(h,{className:"tf-repeater-items tf-repeater-tab-items",actionsClassName:"tf-repeater-tab-actions",actions:x},t&&t.slice(0,i).map((C,Q)=>wp.element.createElement($,{key:C.key??Q,isOpen:v==Q,className:"tf-repeater-tab-item",onPress:()=>S(Q)},_9(C,Q,o,a,n,d)))),t&&t.map((C,Q)=>wp.element.createElement(m,{key:C.key??Q,isActive:v===Q,className:"tf-repeater-tab-content"},e.map((T,B)=>wp.element.createElement(g,{key:T.name??B,className:"tf-repeater-tab-row"},s&&s(C,Q,l),T.type==="title"?wp.element.createElement(y,{className:"tf-repeater-tab-row-title tf-repeater-tab-row-title-section"},n(T,C,Q)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(b,{className:"tf-repeater-tab-row-title"},T.label??""),wp.element.createElement(O,{className:"tf-repeater-tab-item-field"},n(T,C,Q))),c&&c(C,Q,l))))))},"Tab");var Hr={_types:{control:{accordion:JL,"alignment-matrix":az,border:KX,"button-group":ej,checkbox:nu,code:MU,"color-picker":XQ,"conditional-panel":_L,"combo-box":Sh,"date-picker":FG,dimensions:IT,"field-group":W1,file:gte,gradient:bte,gallery:wte,list:Dte,hidden:Cte,number:Rf,repeater:cE,radio:Tte,select:W9,"simple-dimension":Nte,switch:Y1,tab:qte,text:K9,"text-suggestion":LG,wysiwyg:z9,editor:z9,textarea:Gte,"time-picker":tne},element:{button:se,description:we,label:xe,"list-box":Nd,modal:ws,wrapper:kL,tooltip:xL,title:Zd},repeater:{advanced:dne,bare:pne,block:bne,table:wne,tab:Cne}},get(t,e="control"){return this._types[e]?.[t]??(e==="repeater"?"table":!1)},add(t,e,n="control"){this._types[n][t]=e}},kne=Object.defineProperty,H9=u((t,e)=>kne(t,"name",{value:e,configurable:!0}),"i$1");const pp=H9(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Oo),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class;const[a,o]=wp.element.useState(r.value??"");wp.element.useEffect(()=>{r.onChange&&r.onChange(a)},[a]);const s=Hr.get(r.type??"text");if(wp.element.useEffect(()=>{n&&n()},[]),!s)return wp.element.createElement(wp.element.Fragment,null);const c=H9(d=>{o(d),setTimeout(()=>{aa("valueChange",{name:r.name??!1,props:r,value:d,previousValue:a})})},"onChange");return wp.element.createElement(hk,{...l},wp.element.createElement(oE,{visibility:t,data:e},wp.element.createElement(sE,{itemType:r.itemType??"field",name:r.name??!1,setValue:o},d=>wp.element.createElement(nE,{refresh:d,data:e,itemProps:r},f=>wp.element.createElement(s,{...f,value:a,onChange:c,data:e,dynamic:r.dynamic?aI(a,o,r):!1})))))},"Control");var Dne=Object.defineProperty,Pne=u((t,e)=>Dne(t,"name",{value:e,configurable:!0}),"o");const Ene=Pne((t,e)=>({getRow(n){const r=e.getValue(t);return Array.isArray(r)&&r[n]?r[n]:!1},setRow(n,r){const i=e.getValue(t);if(!Array.isArray(i)||!i[n])return!1;i[n]=r,e.setValue(t,i)},getRowValue(n,r){const i=this.getRow(n);return i?i[r]:!1},setRowValue(n,r,i){const l=this.getRow(n);if(!l)return!1;l[r]=i,this.setRow(n,l)}}),"getRepeaterStore");var hr={_values:{},_setValueFromControl(t,e){this._values[t]=e},getAllValues(){return this._values},getValue(t){return this._values[t]??""},setValue(t,e){aa("_refreshFieldValue",{name:t,value:e})},getRepeater(t){return Ene(t,this)}},J9={rerender:t=>aa("_fieldRerender",t),dependent:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}},repeater:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}}},Tne=Object.defineProperty,go=u((t,e)=>Tne(t,"name",{value:e,configurable:!0}),"i");const Oo=wp.element.createContext(null),bo=go((t,e="field")=>e==="element"?tB(t):eB(t),"renderComponent"),eB=go(t=>wp.element.createElement(Oo.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:hr.getValue.bind(hr),portalContainer:t.portalContainer??document.body}},wp.element.createElement(pp,{...t,onChange:e=>{hr._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:hr.getValue.bind(hr)}})),"renderField"),tB=go(t=>wp.element.createElement(Oo.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:hr.getValue.bind(hr),portalContainer:t.portalContainer??document.body}},wp.element.createElement(v0,{...t,onChange:e=>{hr._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:hr.getValue.bind(hr)}})),"renderElement");go(()=>{const{fields:t,elements:e}=yr(),n=[];for(const r in t)n.push(nB(r,t[r],"fields"));for(const r in e)e[r].forEach(i=>{n.push(nB(r,i,"elements"))});Promise.all(n).then(()=>aa("ready",{}))},"init");const nB=go((t,e,n)=>new Promise(r=>{const i=document.getElementById(e.element);if(!i)return r();const l=go(()=>{r(),aa(n==="fields"?"initField":"initElement",{name:t,props:e})},"afterInitialization"),a=n==="fields"?eB({name:t,afterInitialization:l,...e}):tB({name:t,afterInitialization:l,...e});wp.element.createRoot?wp.element.createRoot(i).render(a):wp.element.render(a,i)}),"initItem");var Ane=Object.defineProperty,rB=u((t,e)=>Ane(t,"name",{value:e,configurable:!0}),"r");const Qne=rB(()=>{const t=document.getElementById("tf-example-custom-types"),e=t.getAttribute("data-value"),n=rB(r=>{const{initJSON:i}=cI,[l,a]=wp.element.useState(i(r.value??{}));return wp.element.useEffect(()=>{r.onChange&&r.onChange(l)},[l]),wp.element.createElement("div",{className:"tf-custom-type",style:{display:"flex"}},wp.element.createElement("input",{type:"hidden",name:r.name??"",value:JSON.stringify(l)}),wp.element.createElement("div",null,wp.element.createElement("strong",null,"Character attributes:"),wp.element.createElement("hr",null),bo({label:"First name",type:"text",value:l.firstName??"",onChange:o=>a({...l,firstName:o})}),bo({label:"Last name",type:"text",value:l.lastName,onChange:o=>a({...l,lastName:o})}),wp.element.createElement("hr",null),bo({label:"Avatar",type:"file",maxUpload:1,wp_media:!1,value:l.avatar??"",onChange:o=>a({...l,avatar:o}),mimeTypes:["image"]})))},"MyCustomField");Hr.add("custom-type",n),wp.element.createRoot(t).render(bo({type:"custom-type",name:"custom-field-example",value:e}))},"initExample");var Mne=Object.defineProperty,iB=u((t,e)=>Mne(t,"name",{value:e,configurable:!0}),"n");const Bne=iB(()=>{const t=document.getElementById("tf-example-custom-combobox-layout"),e=iB(r=>bo(r),"Field"),n=wp.element.forwardRef((r,i)=>{if(!r.multiple)throw new Error("This layout only support multiple values");const{add:l,remove:a,values:o}=r.multiple;return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("code",{style:{display:"flex",width:"100%",padding:5,boxSizing:"border-box",flexDirection:"column"}},o.length!==0?wp.element.createElement(wp.element.Fragment,null,"Selected values are:",wp.element.createElement("br",null),wp.element.createElement("ul",null,o.map(s=>wp.element.createElement("li",{key:s.key}," - ",s," ")))):"No value selected"),wp.element.createElement("input",{type:"text",style:{display:"flex",width:"100%"},...r.inputProps,ref:i.current.input}),wp.element.createElement("ul",null,[...r.state.collection].map(s=>wp.element.createElement("li",{key:s.key,style:{display:"flex",border:"solid 1px black",padding:5}},wp.element.createElement(e,{type:"checkbox",label:s.textValue,labelVisuallyHidden:!0,value:o.includes(s.key),onChange:c=>{c!==o[s.key]&&(c===!0?l(s.key):a(o.indexOf(s.key)))}}),s.textValue)),r.state.collection.iterable.length===0&&wp.element.createElement("li",{key:"no-results"},"No results")))});wp.element.createRoot(t).render(bo({label:"Custom combobox",type:"combo-box",name:"custom-combo-box-example",value:"",multiple:!0,onChange:r=>console.log(r),layout:n,choices:{value1:"Example value 1",value2:"Second example value",value3:"An example: third part",value4:"The last example (4)"}}))},"initCombobox");window.addEventListener("load",()=>{const t=document.getElementById("tf-context-select");t.addEventListener("change",()=>{const r=new URL(location.href),i=new URLSearchParams(r.search);i.set("context",t.value),location.replace(location.protocol+"//"+location.host+location.pathname+"?"+i.toString())}),document.getElementById("tf-example-custom-types")&&Qne(),document.getElementById("tf-example-custom-combobox-layout")&&Bne();const e=document.getElementsByClassName("tf-dynamic-value-trigger-js"),n=document.getElementsByClassName("tf-dynamic-value-content-js");if(e.length!==0)for(let r=0;r{jQuery(".tf-dynamic-value-content-js").attr("style","display: none"),n[r].setAttribute("style","")})})})(); +`).scrollIntoView()),!0)},"newlineInCode");function T1(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),l=n.indexAfter(-1),a=T1(i.contentMatchAt(l));if(!a||!i.canReplaceWith(l,l,a))return!1;if(e){let o=n.after(),s=t.tr.replaceWith(o,o,a.createAndFill());s.setSelection(de.near(s.doc.resolve(o),1)),e(s.scrollIntoView())}return!0},"exitCode"),KJ=u((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let l=T1(i.parent.contentMatchAt(i.indexAfter()));if(!l||!l.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let l=n.before();if(ro(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Qu(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},"liftEmptyBlock");function GJ(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ae&&e.selection.node.isBlock)return!r.parentOffset||!ro(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,o,s=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){s=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),o=T1(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let g=t&&t(i.parent,s,r);l.unshift(g||(s&&o?{type:o}:null)),a=p;break}else{if(p==1)return!1;l.unshift(null)}let d=e.tr;(e.selection instanceof ke||e.selection instanceof Fn)&&d.deleteSelection();let f=d.mapping.map(r.pos),h=ro(d.doc,f,l.length,l);if(h||(l[0]=o?{type:o}:null,h=ro(d.doc,f,l.length,l)),!h)return!1;if(d.split(f,l.length,l),!s&&c&&r.node(a).type!=o){let p=d.mapping.map(r.before(a)),m=d.doc.resolve(p);o&&r.node(a-1).canReplaceWith(m.index(),m.index()+1,o)&&d.setNodeMarkup(d.mapping.map(r.before(a)),o)}return n&&n(d.scrollIntoView()),!0}}u(GJ,"splitBlockAs");const _J=GJ(),A1=u((t,e)=>{let{$from:n,to:r}=t.selection,i,l=n.sharedDepth(r);return l==0?!1:(i=n.before(l),e&&e(t.tr.setSelection(ae.create(t.doc,i))),!0)},"selectParentNode"),HJ=u((t,e)=>(e&&e(t.tr.setSelection(new Fn(t.doc))),!0),"selectAll");function JJ(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,l=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(l,l+1)||!(i.isTextblock||io(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}u(JJ,"joinMaybeClear");function x9(t,e,n,r){let i=e.nodeBefore,l=e.nodeAfter,a,o,s=i.type.spec.isolating||l.type.spec.isolating;if(!s&&JJ(t,e,n))return!0;let c=!s&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(l.type))&&o.matchType(a[0]||l.type).validEnd){if(n){let p=e.pos+l.nodeSize,m=j.empty;for(let b=a.length-1;b>=0;b--)m=j.from(a[b].create(null,m));m=j.from(i.copy(m));let g=t.tr.step(new Pt(e.pos-1,p,e.pos,p,new H(m,1,0),a.length,!0)),O=g.doc.resolve(p+2*a.length);O.nodeAfter&&O.nodeAfter.type==i.type&&io(g.doc,O.pos)&&g.join(O.pos),n(g.scrollIntoView())}return!0}let d=l.type.spec.isolating||r>0&&s?null:de.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),h=f&&Qu(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(c&&mo(l,"start",!0)&&mo(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=l,O=1;for(;!g.isTextblock;g=g.firstChild)O++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=j.empty;for(let $=m.length-1;$>=0;$--)b=j.from(m[$].copy(b));let y=t.tr.step(new Pt(e.pos-m.length,e.pos+l.nodeSize,e.pos+O,e.pos+l.nodeSize-O,new H(b,m.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}u(x9,"deleteBarrier");function S9(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,l=i.depth;for(;i.node(l).isInline;){if(!l)return!1;l--}return i.node(l).isTextblock?(n&&n(e.tr.setSelection(ke.create(e.doc,t<0?i.start(l):i.end(l)))),!0):!1}}u(S9,"selectTextblockSide");const eee=S9(-1),tee=S9(1);function Q1(t,e=null){return function(n,r){let{$from:i,$to:l}=n.selection,a=i.blockRange(l),o=a&&Ry(a,t,e);return o?(r&&r(n.tr.wrap(a,o).scrollIntoView()),!0):!1}}u(Q1,"wrapIn");function lp(t,e=null){return function(n,r){let i=!1;for(let l=0;l{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(t,e)))if(s.type==t)i=!0;else{let d=n.doc.resolve(c),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let l=n.tr;for(let a=0;a{if(o||!r&&s.isAtom&&s.isInline&&c>=l.pos&&c+s.nodeSize<=a.pos)return!1;o=s.inlineContent&&s.type.allowsMarkType(n)}),o)return!0}return!1}u(nee,"markApplies");function ree(t){let e=[];for(let n=0;n{if(l.isAtom&&l.content.size&&l.isInline&&a>=r.pos&&a+l.nodeSize<=i.pos)return a+1>r.pos&&e.push(new Ru(r,r.doc.resolve(a+1))),r=r.doc.resolve(a+1+l.content.size),!1}),r.posa.doc.rangeHasMark(p.$from.pos,p.$to.pos,t)):f=!d.every(p=>{let m=!1;return h.doc.nodesBetween(p.$from.pos,p.$to.pos,(g,O,b)=>{if(m)return!1;m=!t.isInSet(g.marks)&&!!b&&b.type.allowsMarkType(t)&&!(g.isText&&/^\s*$/.test(g.textBetween(Math.max(0,p.$from.pos-O),Math.min(g.nodeSize,p.$to.pos-O))))}),!m});for(let p=0;p{let l=u(a=>{this[i](a)},"handler");return e.dom.addEventListener(i,l),{name:i,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,l=i.getBoundingClientRect(),a=l.width/i.offsetWidth,o=l.height/i.offsetHeight;if(n){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let O=this.width/2*o;r={left:m.left,right:m.right,top:g-O,bottom:g+O}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!s||s==document.body&&getComputedStyle(s).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=s.getBoundingClientRect(),h=f.width/s.offsetWidth,p=f.height/s.offsetHeight;c=f.left-s.scrollLeft*h,d=f.top-s.scrollTop*p}this.element.style.left=(r.left-c)/a+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,l=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!l){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=jM(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};u(F$,"DropCursorView");let B1=F$;const Or=class Or extends de{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Or.valid(r)?new Or(r):de.near(r)}content(){return H.empty}eq(e){return e instanceof Or&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Or(e.resolve(n.pos))}getBookmark(){return new R1(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!aee(e)||!oee(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Or.valid(e))return e;let i=e.pos,l=null;for(let a=e.depth;;a--){let o=e.node(a);if(n>0?e.indexAfter(a)0){l=o.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let s=e.doc.resolve(i);if(Or.valid(s))return s}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!ae.isSelectable(l)){e=e.doc.resolve(i+l.nodeSize*n),r=!1;continue e}break}l=a,i+=n;let o=e.doc.resolve(i);if(Or.valid(o))return o}return null}}};u(Or,"GapCursor");let gt=Or;gt.prototype.visible=!1,gt.findFrom=gt.findGapCursorFrom,de.jsonID("gapcursor",gt);const im=class im{constructor(e){this.pos=e}map(e){return new im(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return gt.valid(n)?new gt(n):de.near(n)}};u(im,"GapBookmark");let R1=im;function D9(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}u(D9,"needsGap");function aee(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||D9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(aee,"closedBefore");function oee(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||D9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(oee,"closedAfter");function see(){return new jr({props:{decorations:fee,createSelectionBetween(t,e,n){return e.pos==n.pos&>.valid(n)?new gt(n):null},handleClick:cee,handleKeyDown:uee,handleDOMEvents:{beforeinput:dee}}})}u(see,"gapCursor");const uee=p9({ArrowLeft:op("horiz",-1),ArrowRight:op("horiz",1),ArrowUp:op("vert",-1),ArrowDown:op("vert",1)});function op(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,l){let a=r.selection,o=e>0?a.$to:a.$from,s=a.empty;if(a instanceof ke){if(!l.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=r.doc.resolve(e>0?o.after():o.before())}let c=gt.findGapCursorFrom(o,e,s);return c?(i&&i(r.tr.setSelection(new gt(c))),!0):!1}}u(op,"arrow");function cee(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!gt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new gt(r))),!0)}u(cee,"handleClick");function dee(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof gt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=j.empty;for(let a=r.length-1;a>=0;a--)i=j.from(r[a].createAndFill(null,i));let l=t.state.tr.replace(n.pos,n.pos,new H(i,0,0));return l.setSelection(ke.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}u(dee,"beforeinput");function fee(t){if(!(t.selection instanceof gt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ln.create(t.doc,[Ur.widget(t.selection.head,e,{key:"gapcursor"})])}u(fee,"drawGapCursor");const Wu="http://www.w3.org/2000/svg",hee="http://www.w3.org/1999/xlink",V1="ProseMirror-icon";function pee(t){let e=0;for(let n=0;n{l.preventDefault(),r.classList.contains(jt+"-disabled")||n.run(e.state,e.dispatch,e,l)});function i(l){if(n.select){let o=n.select(l);if(r.style.display=o?"":"none",!o)return!1}let a=!0;if(n.enable&&(a=n.enable(l)||!1,I1(r,jt+"-disabled",!a)),n.active){let o=a&&n.active(l)||!1;I1(r,jt+"-active",o)}return!0}return u(i,"update"),{dom:r,update:i}}};u(I$,"MenuItem");let an=I$;function Yu(t,e){return t._props.translate?t._props.translate(e):e}u(Yu,"translate");let Ku={time:0,node:null};function P9(t){Ku.time=Date.now(),Ku.node=t.target}u(P9,"markMenuEvent");function E9(t){return Date.now()-100{a&&a.close()&&(a=null,r.removeEventListener("mousedown",o))},"close");i.addEventListener("mousedown",d=>{d.preventDefault(),P9(d),a?s():(a=this.expand(l,n.dom),r.addEventListener("mousedown",o=u(()=>{E9(l)||s()},"listeningOnClose")))});function c(d){let f=n.update(d);return l.style.display=f?"":"none",f}return u(c,"update"),{dom:l,update:c}}expand(e,n){let r=_t("div",{class:jt+"-dropdown-menu "+(this.options.class||"")},n),i=!1;function l(){return i?!1:(i=!0,e.removeChild(r),!0)}return u(l,"close"),e.appendChild(r),{close:l,node:r}}};u(L$,"Dropdown");let sp=L$;function T9(t,e){let n=[],r=[];for(let i=0;i{let r=!1;for(let i=0;i{s.preventDefault(),P9(s),I1(l,jt+"-submenu-wrap-active",!1),a||r.addEventListener("mousedown",a=u(()=>{E9(l)||(l.classList.remove(jt+"-submenu-wrap-active"),r.removeEventListener("mousedown",a),a=null)},"listeningOnClose"))});function o(s){let c=n.update(s);return l.style.display=c?"":"none",c}return u(o,"update"),{dom:l,update:o}}};u(z$,"DropdownSubmenu");let N1=z$;function Q9(t,e){let n=document.createDocumentFragment(),r=[],i=[];for(let a=0;aP1(t),icon:kn.join}),yee=new an({title:"Lift out of enclosing block",run:E1,select:t=>E1(t),icon:kn.lift}),vee=new an({title:"Select parent node",run:A1,select:t=>A1(t),icon:kn.selectParentNode});let $ee=new an({title:"Undo last change",run:ip,enable:t=>ip(t),icon:kn.undo}),wee=new an({title:"Redo last undone change",run:qu,enable:t=>qu(t),icon:kn.redo});function xee(t,e){let n={run(r,i){return Q1(t,e.attrs)(r,i)},select(r){return Q1(t,e.attrs)(r)}};for(let r in e)n[r]=e[r];return new an(n)}u(xee,"wrapItem");function F1(t,e){let n=lp(t,e.attrs),r={run:n,enable(i){return n(i)},active(i){let{$from:l,to:a,node:o}=i.selection;return o?o.hasMarkup(t,e.attrs):a<=l.end()&&l.parent.hasMarkup(t,e.attrs)}};for(let i in e)r[i]=e[i];return new an(r)}u(F1,"blockTypeItem");function I1(t,e,n){n?t.classList.add(e):t.classList.remove(e)}u(I1,"setClass");const up="ProseMirror-menubar";function See(){if(typeof navigator>"u")return!1;let t=navigator.userAgent;return!/Edge\/\d/.test(t)&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t)}u(See,"isIOS");function Cee(t){return new jr({view(e){return new L1(e,t)}})}u(Cee,"menuBar");const Z$=class Z${constructor(e,n){this.editorView=e,this.options=n,this.spacer=null,this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.scrollHandler=null,this.root=e.root,this.wrapper=_t("div",{class:up+"-wrapper"}),this.menu=this.wrapper.appendChild(_t("div",{class:up})),this.menu.className=up,e.dom.parentNode&&e.dom.parentNode.replaceChild(this.wrapper,e.dom),this.wrapper.appendChild(e.dom);let{dom:r,update:i}=Q9(this.editorView,this.options.content);if(this.contentUpdate=i,this.menu.appendChild(r),this.update(),n.floating&&!See()){this.updateFloat();let l=Pee(this.wrapper);this.scrollHandler=a=>{let o=this.editorView.root;(o.body||o).contains(this.wrapper)?this.updateFloat(a.target.getBoundingClientRect?a.target:void 0):l.forEach(s=>s.removeEventListener("scroll",this.scrollHandler))},l.forEach(a=>a.addEventListener("scroll",this.scrollHandler))}}update(){if(this.editorView.root!=this.root){let{dom:e,update:n}=Q9(this.editorView,this.options.content);this.contentUpdate=n,this.menu.replaceChild(e,this.menu.firstChild),this.root=this.editorView.root}this.contentUpdate(this.editorView.state),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))}updateScrollCursor(){let e=this.editorView.root.getSelection();if(!e.focusNode)return;let n=e.getRangeAt(0).getClientRects(),r=n[kee(e)?0:n.length-1];if(!r)return;let i=this.menu.getBoundingClientRect();if(r.topi.top){let l=Dee(this.wrapper);l&&(l.scrollTop-=i.bottom-r.top)}}updateFloat(e){let n=this.wrapper,r=n.getBoundingClientRect(),i=e?Math.max(0,e.getBoundingClientRect().top):0;if(this.floating)if(r.top>=i||r.bottom(this.editorView.dom.ownerDocument.defaultView||window).innerHeight?"none":"",e&&(this.menu.style.top=i+"px")}else if(r.top=this.menu.offsetHeight+10){this.floating=!0;let l=this.menu.getBoundingClientRect();this.menu.style.left=l.left+"px",this.menu.style.width=l.width+"px",e&&(this.menu.style.top=i+"px"),this.menu.style.position="fixed",this.spacer=_t("div",{class:up+"-spacer",style:`height: ${l.height}px`}),n.insertBefore(this.spacer,this.menu)}}destroy(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)}};u(Z$,"MenuBarView");let L1=Z$;function kee(t){return t.anchorNode==t.focusNode?t.anchorOffset>t.focusOffset:t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}u(kee,"selectionIsInverted");function Dee(t){for(let e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}u(Dee,"findWrappingScrollable");function Pee(t){let e=[t.ownerDocument.defaultView||window];for(let n=t.parentNode;n;n=n.parentNode)e.push(n);return e}u(Pee,"getAllWrapping");const X$=class X${constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?Eee(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}};u(X$,"InputRule");let fr=X$;function Eee(t){return function(e,n,r,i){let l=t;if(n[1]){let a=n[0].lastIndexOf(n[1]);l+=n[0].slice(a+n[1].length),r+=a;let o=r-i;o>0&&(l=n[0].slice(a-o,a)+l,r=i)}return e.tr.insertText(l,r,i)}}u(Eee,"stringHandler");const Tee=500;function Aee({rules:t}){let e=new jr({state:{init(){return null},apply(n,r){let i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,l){return M9(n,r,i,l,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&M9(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}u(Aee,"inputRules");function M9(t,e,n,r,i,l){if(t.composing)return!1;let a=t.state,o=a.doc.resolve(e),s=o.parent.textBetween(Math.max(0,o.parentOffset-Tee),o.parentOffset,null,"\uFFFC")+r;for(let c=0;cm.type.spec.code))continue;if(o.parent.type.spec.code){if(!d.inCode)continue}else if(d.inCode==="only")continue;let f=d.match.exec(s);if(!f||f[0].length{g.isInline&&g.marks.some(O=>O.type.spec.code)&&(m=!0)}),m)continue}let p=d.handler(a,f,h,n);if(p)return d.undoable&&p.setMeta(l,{transform:p,from:e,to:n,text:r}),t.dispatch(p),!0}return!1}u(M9,"run");const Qee=u((t,e)=>{let n=t.plugins;for(let r=0;r=0;s--)a.step(o.steps[s].invert(o.docs[s]));if(l.text){let s=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,s))}else a.delete(l.from,l.to);e(a)}return!0}}return!1},"undoInputRule"),Mee=new fr(/--$/,"\u2014",{inCodeMark:!1}),Bee=new fr(/\.\.\.$/,"\u2026",{inCodeMark:!1}),Ree=new fr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C",{inCodeMark:!1}),Vee=new fr(/"$/,"\u201D",{inCodeMark:!1}),Nee=new fr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),Fee=new fr(/'$/,"\u2019",{inCodeMark:!1}),Iee=[Ree,Vee,Nee,Fee];function z1(t,e,n=null,r){return new fr(t,(i,l,a,o)=>{let s=n instanceof Function?n(l):n,c=i.tr.delete(a,o),d=c.doc.resolve(a),f=d.blockRange(),h=f&&Ry(f,e,s);if(!h)return null;c.wrap(f,h);let p=c.doc.resolve(a-1).nodeBefore;return p&&p.type==e&&io(c.doc,a-1)&&(!r||r(l,p))&&c.join(a-1),c})}u(z1,"wrappingInputRule");function B9(t,e,n=null){return new fr(t,(r,i,l,a)=>{let o=r.doc.resolve(l),s=n instanceof Function?n(i):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e)?r.tr.delete(l,a).setBlockType(l,l,e,s):null})}u(B9,"textblockTypeInputRule");const cp="ProseMirror-prompt";function R9(t){let e=document.body.appendChild(document.createElement("div"));e.className=cp;let n=u(h=>{e.contains(h.target)||r()},"mouseOutside");setTimeout(()=>window.addEventListener("mousedown",n),50);let r=u(()=>{window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},"close"),i=[];for(let h in t.fields)i.push(t.fields[h].render());let l=document.createElement("button");l.type="submit",l.className=cp+"-submit",l.textContent="OK";let a=document.createElement("button");a.type="button",a.className=cp+"-cancel",a.textContent="Cancel",a.addEventListener("click",r);let o=e.appendChild(document.createElement("form"));t.title&&(o.appendChild(document.createElement("h5")).textContent=t.title),i.forEach(h=>{o.appendChild(document.createElement("div")).appendChild(h)});let s=o.appendChild(document.createElement("div"));s.className=cp+"-buttons",s.appendChild(l),s.appendChild(document.createTextNode(" ")),s.appendChild(a);let c=e.getBoundingClientRect();e.style.top=(window.innerHeight-c.height)/2+"px",e.style.left=(window.innerWidth-c.width)/2+"px";let d=u(()=>{let h=Lee(t.fields,i);h&&(r(),t.callback(h))},"submit");o.addEventListener("submit",h=>{h.preventDefault(),d()}),o.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),r()):h.keyCode==13&&!(h.ctrlKey||h.metaKey||h.shiftKey)?(h.preventDefault(),d()):h.keyCode==9&&window.setTimeout(()=>{e.contains(document.activeElement)||r()},500)});let f=o.elements[0];f&&f.focus()}u(R9,"openPrompt");function Lee(t,e){let n=Object.create(null),r=0;for(let i in t){let l=t[i],a=e[r++],o=l.read(a),s=l.validate(o);if(s)return zee(a,s),null;n[i]=l.clean(o)}return n}u(Lee,"getValues");function zee(t,e){let n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout(()=>n.removeChild(r),1500)}u(zee,"reportInvalid");const j$=class j${constructor(e){this.options=e}read(e){return e.value}validateType(e){return null}validate(e){return!e&&this.options.required?"Required field":this.validateType(e)||(this.options.validate?this.options.validate(e):null)}clean(e){return this.options.clean?this.options.clean(e):e}};u(j$,"Field");let Z1=j$;const q$=class q$ extends Z1{render(){let e=document.createElement("input");return e.type="text",e.placeholder=this.options.label,e.value=this.options.value||"",e.autocomplete="off",e}};u(q$,"TextField");let Ll=q$;function V9(t,e){let n=t.selection.$from;for(let r=n.depth;r>=0;r--){let i=n.index(r);if(n.node(r).canReplaceWith(i,i,e))return!0}return!1}u(V9,"canInsert");function Zee(t){return new an({title:"Insert image",label:"Image",enable(e){return V9(e,t)},run(e,n,r){let{from:i,to:l}=e.selection,a=null;e.selection instanceof ae&&e.selection.node.type==t&&(a=e.selection.node.attrs),R9({title:"Insert image",fields:{src:new Ll({label:"Location",required:!0,value:a&&a.src}),title:new Ll({label:"Title",value:a&&a.title}),alt:new Ll({label:"Description",value:a?a.alt:e.doc.textBetween(i,l," ")})},callback(o){r.dispatch(r.state.tr.replaceSelectionWith(t.createAndFill(o))),r.focus()}})}})}u(Zee,"insertImageItem");function N9(t,e){let n={label:e.title,run:t};for(let r in e)n[r]=e[r];return!e.enable&&!e.select&&(n[e.enable?"enable":"select"]=r=>t(r)),new an(n)}u(N9,"cmdItem");function X1(t,e){let{from:n,$from:r,to:i,empty:l}=t.selection;return l?!!e.isInSet(t.storedMarks||r.marks()):t.doc.rangeHasMark(n,i,e)}u(X1,"markActive");function j1(t,e){let n={active(r){return X1(r,t)}};for(let r in e)n[r]=e[r];return N9(Ni(t),n)}u(j1,"markItem");function Xee(t){return new an({title:"Add or remove link",icon:kn.link,active(e){return X1(e,t)},enable(e){return!e.selection.empty},run(e,n,r){if(X1(e,t))return Ni(t)(e,n),!0;R9({title:"Create a link",fields:{href:new Ll({label:"Link target",required:!0}),title:new Ll({label:"Title"})},callback(i){Ni(t,i)(r.state,r.dispatch),r.focus()}})}})}u(Xee,"linkItem");function F9(t,e){return N9(S1(t,e.attrs),e)}u(F9,"wrapListItem");function I9(t){let e={},n;(n=t.marks.strong)&&(e.toggleStrong=j1(n,{title:"Toggle strong style",icon:kn.strong})),(n=t.marks.em)&&(e.toggleEm=j1(n,{title:"Toggle emphasis",icon:kn.em})),(n=t.marks.code)&&(e.toggleCode=j1(n,{title:"Toggle code font",icon:kn.code})),(n=t.marks.link)&&(e.toggleLink=Xee(n));let r;if((r=t.nodes.image)&&(e.insertImage=Zee(r)),(r=t.nodes.bullet_list)&&(e.wrapBulletList=F9(r,{title:"Wrap in bullet list",icon:kn.bulletList})),(r=t.nodes.ordered_list)&&(e.wrapOrderedList=F9(r,{title:"Wrap in ordered list",icon:kn.orderedList})),(r=t.nodes.blockquote)&&(e.wrapBlockQuote=xee(r,{title:"Wrap in block quote",icon:kn.blockquote})),(r=t.nodes.paragraph)&&(e.makeParagraph=F1(r,{title:"Change to paragraph",label:"Plain"})),(r=t.nodes.code_block)&&(e.makeCodeBlock=F1(r,{title:"Change to code block",label:"Code"})),r=t.nodes.heading)for(let l=1;l<=10;l++)e["makeHead"+l]=F1(r,{title:"Change to heading "+l,label:"Level "+l,attrs:{level:l}});if(r=t.nodes.horizontal_rule){let l=r;e.insertHorizontalRule=new an({title:"Insert horizontal rule",label:"Horizontal rule",enable(a){return V9(a,l)},run(a,o){o(a.tr.replaceSelectionWith(l.create()))}})}let i=u(l=>l.filter(a=>a),"cut");return e.insertMenu=new sp(i([e.insertImage,e.insertHorizontalRule]),{label:"Insert"}),e.typeMenu=new sp(i([e.makeParagraph,e.makeCodeBlock,e.makeHead1&&new N1(i([e.makeHead1,e.makeHead2,e.makeHead3,e.makeHead4,e.makeHead5,e.makeHead6]),{label:"Heading"})]),{label:"Type..."}),e.inlineMenu=[i([e.toggleStrong,e.toggleEm,e.toggleCode,e.toggleLink])],e.blockMenu=[i([e.wrapBulletList,e.wrapOrderedList,e.wrapBlockQuote,bee,yee,vee])],e.fullMenu=e.inlineMenu.concat([[e.insertMenu,e.typeMenu]],[[$ee,wee]],e.blockMenu),e}u(I9,"buildMenuItems");const L9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function jee(t,e){let n={},r;function i(l,a){if(e){let o=e[l];if(o===!1)return;o&&(l=o)}n[l]=a}if(u(i,"bind"),i("Mod-z",ip),i("Shift-Mod-z",qu),i("Backspace",Qee),L9||i("Mod-y",qu),i("Alt-ArrowUp",P1),i("Alt-ArrowDown",WJ),i("Mod-BracketLeft",E1),i("Escape",A1),(r=t.marks.strong)&&(i("Mod-b",Ni(r)),i("Mod-B",Ni(r))),(r=t.marks.em)&&(i("Mod-i",Ni(r)),i("Mod-I",Ni(r))),(r=t.marks.code)&&i("Mod-`",Ni(r)),(r=t.nodes.bullet_list)&&i("Shift-Ctrl-8",S1(r)),(r=t.nodes.ordered_list)&&i("Shift-Ctrl-9",S1(r)),(r=t.nodes.blockquote)&&i("Ctrl->",Q1(r)),r=t.nodes.hard_break){let l=r,a=ap(w9,(o,s)=>(s&&s(o.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0));i("Mod-Enter",a),i("Shift-Enter",a),L9&&i("Ctrl-Enter",a)}if((r=t.nodes.list_item)&&(i("Enter",wJ(r)),i("Mod-[",xJ(r)),i("Mod-]",kJ(r))),(r=t.nodes.paragraph)&&i("Shift-Ctrl-0",lp(r)),(r=t.nodes.code_block)&&i("Shift-Ctrl-\\",lp(r)),r=t.nodes.heading)for(let l=1;l<=6;l++)i("Shift-Ctrl-"+l,lp(r,{level:l}));if(r=t.nodes.horizontal_rule){let l=r;i("Mod-_",(a,o)=>(o&&o(a.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0))}return n}u(jee,"buildKeymap");function qee(t){return z1(/^\s*>\s$/,t)}u(qee,"blockQuoteRule");function Wee(t){return z1(/^(\d+)\.\s$/,t,e=>({order:+e[1]}),(e,n)=>n.childCount+n.attrs.order==+e[1])}u(Wee,"orderedListRule");function Yee(t){return z1(/^\s*([-+*])\s$/,t)}u(Yee,"bulletListRule");function Kee(t){return B9(/^```$/,t)}u(Kee,"codeBlockRule");function Uee(t,e){return B9(new RegExp("^(#{1,"+e+"})\\s$"),t,n=>({level:n[1].length}))}u(Uee,"headingRule");function Gee(t){let e=Iee.concat(Bee,Mee),n;return(n=t.nodes.blockquote)&&e.push(qee(n)),(n=t.nodes.ordered_list)&&e.push(Wee(n)),(n=t.nodes.bullet_list)&&e.push(Yee(n)),(n=t.nodes.code_block)&&e.push(Kee(n)),(n=t.nodes.heading)&&e.push(Uee(n,6)),Aee({rules:e})}u(Gee,"buildInputRules");function _ee(t){let e=[Gee(t.schema),h9(jee(t.schema,t.mapKeys)),h9(iee),lee(),see()];return t.menuBar!==!1&&e.push(Cee({floating:t.floatingMenu!==!1,content:t.menuContent||I9(t.schema).fullMenu})),t.history!==!1&&e.push(IJ()),e.concat(new jr({props:{attributes:{class:"ProseMirror-example-setup-style"}}}))}u(_ee,"exampleSetup");const Hee=wp.element.forwardRef(({rawView:t=!0,...e},n)=>{const[r,i]=wp.element.useState(e.value??""),[l,a]=wp.element.useState("visual"),o=wp.element.useRef(null),s=Hr.get("button-group");return wp.element.useEffect(()=>{e.onChange&&e.onChange(r)},[r]),wp.element.useEffect(()=>{const c=new Mh({nodes:yJ(f9.spec.nodes,"paragraph block*","block"),marks:f9.spec.marks}),d=_ee({schema:c,menuContent:I9(c).fullMenu}),f=document.createElement("div"),h=document.createElement("div");h.innerHTML=r,f.appendChild(h);const p=ku.fromSchema(c).parse(h,{preserveWhitespace:!0}),m=jy.create({doc:p,plugins:d});return o.current=new tp(n.current,{state:m,dispatchTransaction:g=>{const O=o.current.state.apply(g);o.current.updateState(O);const b=o.current.dom.innerHTML;i(b)}}),()=>o.current.destroy()},[l]),wp.element.createElement("div",{className:"tf-editor-content"},t&&wp.element.createElement("div",{className:"tf-editor-view-toggle"},wp.element.createElement(s,{label:"Switch view",labelVisuallyHidden:!0,value:l,onChange:c=>{a(c),c==="raw"&&(n.current=null)},choices:{visual:"Visual",raw:"Raw"}})),l==="visual"?wp.element.createElement("div",{className:"tf-editor-visual-view",ref:n}):wp.element.createElement(LQ,{value:r,onChange:i}))});var Jee=Object.defineProperty,ete=u((t,e)=>Jee(t,"name",{value:e,configurable:!0}),"n$7");const tte=ete(t=>{const[e,n]=wp.element.useState(t.value),r=wp.element.useRef(null),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",name:t.name,value:e}),wp.element.createElement(Hee,{ref:r,value:e,onChange:n,rawView:t.rawView??!0}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Editor");var nte=Object.defineProperty,rte=u((t,e)=>nte(t,"name",{value:e,configurable:!0}),"l$5");const ite=rte(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si(t,e),[l,a]=wp.element.useState(t.value);return wp.element.useEffect(()=>{a(t.value)},[t.value]),wp.element.useEffect(()=>{setTimeout(()=>{tinyMCE.init({target:e.current,setup:function(o){o.on("input",()=>a(o.getContent()))}})})},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{ref:e,...r},l),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TinyMce");var lte=Object.defineProperty,ate=u((t,e)=>lte(t,"name",{value:e,configurable:!0}),"t$4"),z9=ate(t=>{const{editor:e}=t;return e==="tinymce"?wp.element.createElement(ite,{...t}):wp.element.createElement(tte,{...t})},"default"),ote=Object.defineProperty,ste=u((t,e)=>ote(t,"name",{value:e,configurable:!0}),"n$6");const ute=ste(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?v0:pp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...t,...a})},"FieldGroupItem");var cte=Object.defineProperty,q1=u((t,e)=>cte(t,"name",{value:e,configurable:!0}),"s$5");const W1=q1(t=>{const[e,n]=wp.element.useState([]),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(On(t.value??"")),o=wp.element.useRef();o.current=l;const s=q1((f,h)=>{a({...l,[f]:h}),e.length!==0&&i(()=>()=>{e.map(p=>p(f))})},"setAttribute");wp.element.useEffect(()=>{t.onChange&&t.onChange(l),r&&(r(),i(!1))},[l]);const c=t.fields??[],d=q1(f=>c.map(h=>h.name??!1).includes(f),"hasField");return wp.element.createElement("div",{className:"tf-field-group"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l)}),c.map((f,h)=>wp.element.createElement("div",{key:h,className:"tf-field-group-item"},wp.element.createElement(ute,{values:l,config:f,onChange:p=>s(f.name,p),data:{getValue:p=>d(p)?o.current[p]??"":t.data.getValue(p)??"",watcher:p=>{n(m=>[...m,g=>p(g)])}}}))))},"FieldGroup");var dte=Object.defineProperty,Z9=u((t,e)=>dte(t,"name",{value:e,configurable:!0}),"p$1");const fte=Z9(t=>{const{api:e}=yr(),n=new FormData;return n.append("file",t),n.append("title",t.name),n.append("caption",t.caption),YU(e.endpoint.media,n)},"postMedia"),X9=Z9(t=>{const{api:e}=yr();return qQ(e.endpoint.media+t)},"getMedia");var hte=Object.defineProperty,j9=u((t,e)=>hte(t,"name",{value:e,configurable:!0}),"s$4");const pte=j9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);if(wp.element.useEffect(()=>{j9(async()=>{const o=await X9(t.id);i(o),n(!0)},"fetch")()},[]),!e||!r)return wp.element.createElement("li",{className:"tf-file-item"},"Loading...");const l=r.source_url,a=l.split("/").pop().split(".").length===2?l.split("/").pop().split(".")[1]:"";return wp.element.createElement("li",{className:"tf-file-item"},r.media_type==="image"&&wp.element.createElement("img",{loading:"lazy",decoding:"async",src:l,alt:r.alt_text,className:"attachment-medium size-medium"}),wp.element.createElement("span",null,`${r.title.rendered}${a!==""?"."+a:""}`),wp.element.createElement(se,{type:"action",onPress:()=>t.remove()},"Remove"))},"FilePreview");var mte=Object.defineProperty,_r=u((t,e)=>mte(t,"name",{value:e,configurable:!0}),"l$4");const gte=_r(t=>{const{mimetypes:e}=yr(),n=wp.element.useRef(null),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(!1),[o,s]=wp.element.useState(t.value?Array.isArray(t.value)?t.value:JSON.parse(t.value):[]),[c,d]=wp.element.useState(!1),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(o),[o]);const m=t.placeholder??"No file selected",g=t.maxUpload??!1,O=_r(()=>(g===!1||o.length(g===!1||o.length{a(!0),d(!1),fte(r[0]).then(C=>s([...o,C.id])).catch(C=>d(C.message)).finally(()=>{i(!1),a(!1)})},"upload"),$=_r(C=>{s([...o.slice(0,C),...o.slice(C+1)])},"removeUpload"),v=_r(()=>t.wp_media===!1||t.wp_media==="false","isWpMediaDisabled"),S=_r(()=>{const{mimeTypes:C}=t,Q=Object.values(e),T=_r(B=>B.includes("/")?B:Q.filter(w=>w.startsWith(`${B}/`)),"filterByMimetypePrefix");return(C?Array.isArray(C)?C.flatMap(T):T(C):Q).join(", ")},"getAllowedTypes"),x=_r(()=>{const C=wp.media({title:"Choose File",multiple:!1,library:{type:S()}});C.on("select",()=>{const Q=C.state().get("selection").first().toJSON();s([...o,Q.id])}),C.open()},"open");return wp.element.createElement("div",{className:"tf-file"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement(gn,null,wp.element.createElement("input",{type:"file",ref:n,accept:S(),onChange:C=>i(C.target.files),...h})),wp.element.createElement("div",{className:"tf-file-container"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(o)}),wp.element.createElement("ul",{className:"tf-file-list"},o.map((C,Q)=>wp.element.createElement(pte,{key:C,id:C,remove:()=>$(Q)}))),wp.element.createElement("div",{className:"tf-file-field"},wp.element.createElement(se,{type:"action",onPress:()=>v()?n.current.click():x(),isDisabled:!b(),"aria-hidden":"true"},t.buttonText??"Choose"),wp.element.createElement("div",{className:"tf-file-text","aria-hidden":"true"},r.length>0?r[0].name:m),v()&&wp.element.createElement(se,{type:"action",onPress:y,isDisabled:!O()},t.uploadText??"Upload"))),c&&wp.element.createElement(KP,{message:c,type:"error",onDismiss:()=>d(!1)}),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"FileUpload");var Ote=Object.defineProperty,dp=u((t,e)=>Ote(t,"name",{value:e,configurable:!0}),"l$3");const bte=dp(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(t.value&&t.value!==""?typeof t.value!="object"?JSON.parse(t.value):t.value:{type:"linear",angle:45,shape:"ellipse",colors:["rgba(0,255,255,1)","rgba(0,255,255,1)"]}),o=wp.element.useRef(),s=wp.element.useRef(),c=wp.element.useRef(),d=wp.element.useRef(),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange({...l,stringValue:m()})},[l]);const m=dp(()=>{switch(l.type){case"linear":return`linear-gradient(${l.angle}deg, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"radial":return`radial-gradient(${l.shape}, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"conic":return`conic-gradient(${l.colors[0]} 0%, ${l.colors[1]} 100%)`}},"generateGradient"),g=dp((b,y)=>{const $=[...l.colors];$[b]=y?.toString("rgba"),O("colors",$)},"updateColor"),O=dp((b,y)=>{a({...l,[b]:y})},"updateValue");return wp.element.createElement("div",{className:"tf-gradient"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement("div",{className:"tf-gradient-container",ref:d},wp.element.createElement("input",{ref:s,type:"text",className:"tf-gradient-input",value:m(),onClick:b=>i(!0),readOnly:!0}),wp.element.createElement("input",{type:"hidden",ref:o,value:JSON.stringify(l),name:t.name??"",...h}),r&&wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:s,placement:"bottom start",style:{width:d?.current?.offsetWidth,minWidth:"fit-content"},className:"tf-gradient-popover"},wp.element.createElement(Os,null,wp.element.createElement($d,{autoFocus:!0},wp.element.createElement("div",{className:"tf-gradient-popover-content"},wp.element.createElement("div",{className:"tf-gradient-preview",ref:c,style:{background:m()}},wp.element.createElement("div",{className:"tf-gradient-colors"},l.colors?.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-gradient-color tf-color-area-thumb",style:{background:l.colors[y]},onClick:()=>n(y)})))),wp.element.createElement("div",{className:"tf-gradient-settings"},wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(eu,{label:"Gradient type",selectedKey:l.type??"linear",onSelectionChange:b=>O("type",b)},wp.element.createElement(Qr,{key:"linear"},"Linear"),wp.element.createElement(Qr,{key:"radial"},"Radial"),wp.element.createElement(Qr,{key:"conic"},"Conical"))),wp.element.createElement("div",null,l.type==="linear"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Rf,{label:"Angle",value:l.angle??45,onChange:b=>O("angle",b)})),l.type==="radial"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(eu,{label:"Shape",selectedKey:l.shape??"ellipse",onSelectionChange:b=>O("shape",b)},wp.element.createElement(Qr,{key:"circle"},"Circle"),wp.element.createElement(Qr,{key:"ellipse"},"Ellipse"))))))))),e!==!1&&wp.element.createElement(Rr,{state:{isOpen:e!==!1,close:()=>n(!1)},triggerRef:c,placement:e===0?"bottom start":"bottom end"},wp.element.createElement(ZQ,{value:l.colors[e],onChange:b=>g(e,b),hasAlpha:!0,onFocusChange:b=>b===!1?n(!1):!1}))),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"Gradient");var yte=Object.defineProperty,q9=u((t,e)=>yte(t,"name",{value:e,configurable:!0}),"a$2");const vte=q9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);return wp.element.useEffect(()=>{q9(async()=>{const l=await X9(t.id);i(l),n(!0)},"fetch")()},[]),!e||!r?wp.element.createElement("div",{className:"tf-gallery-item"},"Loading..."):wp.element.createElement("div",{className:"tf-gallery-item"},wp.element.createElement("img",{src:r.source_url}))},"ImagePreview");var $te=Object.defineProperty,fp=u((t,e)=>$te(t,"name",{value:e,configurable:!0}),"a$1");const wte=fp(t=>{const e=fp(c=>(c!=="[]"?c.split(","):[]).map(d=>d.replaceAll("[","").replaceAll("]","").replaceAll('"',"")),"initValue"),[n,r]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value?e(t.value):[]),{labelProps:i,inputProps:l,descriptionProps:a}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const o=fp(()=>{const c=wp.media({frame:"post",multiple:!0,button:{text:"Use this media"},library:{type:["image"]},state:n.length<1?"gallery":"gallery-edit",selection:s()});c.on({update:d=>{r(d.models.map(f=>f.id))},open:()=>{c.menuView.unset("playlist"),c.menuView.unset("video-playlist")}},void 0),c.open()},"open"),s=fp(()=>{const c=wp.media.query({orderby:"post__in",order:"ASC",type:"image",perPage:-1,post__in:n});return new wp.media.model.Selection(c.models,{props:c.props.toJSON(),multiple:!0})},"getSelection");return wp.element.createElement("div",{className:"tf-gallery"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-gallery__controls"},wp.element.createElement("div",{className:"tf-gallery-preview"},n.map(c=>wp.element.createElement(vte,{key:c,id:c})))),wp.element.createElement("div",{className:"tf-gallery-buttons"},wp.element.createElement(se,{type:"action",onPress:o},n.length<1?"Create gallery":"Edit gallery"),n.length>0&&wp.element.createElement(se,{type:"action",onPress:()=>r([])},"Clear gallery")),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:n.join(","),...l}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Gallery");var xte=Object.defineProperty,Ste=u((t,e)=>xte(t,"name",{value:e,configurable:!0}),"a");const Cte=Ste(t=>wp.element.createElement("input",{type:"hidden",name:t.name,value:t.value,...t.attributes,className:`tf-hidden ${t.class??""} ${t.className??""}`}),"InputHidden");var kte=Object.defineProperty,Uu=u((t,e)=>kte(t,"name",{value:e,configurable:!0}),"i$4");const Dte=Uu(t=>{const e={value:"",_canDelete:!0,_enabled:!0},[n,r]=wp.element.useState(On(t.value??"[]",[]));wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const[i,l]=wp.element.useState(""),a=wp.element.useRef(0),{labelProps:o,fieldProps:s,descriptionProps:c}=$t(t),d=Uu(()=>{r([...n,{...e,value:i}]),l(""),a.current=a.current+1},"addSelectedItem"),f=Uu(m=>{r([...n.slice(0,m),...n.slice(m+1)])},"removeItem"),h=Uu((m,g,O)=>{setTimeout(()=>{r([...n.slice(0,m),{...n[m],[g]:O},...n.slice(m+1)])})},"updateItem"),p=Uu(m=>t.isAsync?m.label:t.choices[m]??m,"getItemText");return t.isAsync&&console.warn("Async mode is not supported yet for the list field"),wp.element.createElement("div",{className:"tf-list"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(n),...s}),wp.element.createElement("div",{className:"tf-list-container"},wp.element.createElement("div",{className:"tf-list-items"},wp.element.createElement("div",{className:"tf-list-header"},t.label&&wp.element.createElement(xe,{labelProps:o,parent:t},t.label),wp.element.createElement("div",{className:"tf-list-header-actions"})),wp.element.createElement("div",{className:"tf-list-items"},n.map((m,g)=>wp.element.createElement("div",{key:m.value,className:"tf-list-item"},wp.element.createElement("div",{className:"tf-list-item-text"},p(m.value)),wp.element.createElement("div",{key:m,className:"tf-list-item-actions"},m._canDelete&&wp.element.createElement(se,{type:"icon-trash",onPress:()=>f(g)}),t.useVisibility&&wp.element.createElement(se,{type:"icon-eye",onPress:()=>h(g,"_enabled",!m._enabled),style:m._enabled?{}:{opacity:.5,filter:"grayscale(60%)"}})))))),wp.element.createElement("div",{className:"tf-list-search"},wp.element.createElement(Sh,{...t,name:null,key:a.current,value:i,description:!1,labelVisuallyHidden:!0,disabledKeys:n.map(m=>m.value),multiple:!1,onChange:m=>{m&&l(m)}}),wp.element.createElement(se,{type:"action",onPress:d,isDisabled:i===""},"Add"))),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"List");var Pte=Object.defineProperty,Ete=u((t,e)=>Pte(t,"name",{value:e,configurable:!0}),"t$3"),Tte=Ete(t=>{const[e,n]=wp.element.useState(t.value??""),r=rl(t.choices??{});return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement(gE,{...t,onChange:n},r.map(i=>wp.element.createElement(OE,{key:i.value??"",...i},i.label??"")))},"default"),Ate=Object.defineProperty,Qte=u((t,e)=>Ate(t,"name",{value:e,configurable:!0}),"m$5");const Mte=Qte(t=>{const[e,n]=wp.element.useState(t.value?q2(t.value):new Set),[r,i]=wp.element.useState(!1),l=b0({...t,selectionMode:"multiple",onSelectionChange:n,selectedKeys:e}),a=wp.element.useRef(),o=wp.element.useRef(),s=wp.element.useRef(),{listBoxProps:c,labelProps:d,descriptionProps:f}=iD(t,l,a);wp.element.useEffect(()=>{t.onChange&&t.onChange([...e])},[e]);const h=wp.element.createElement(Nd,{listBoxRef:a,state:l,items:t.items,...c});return wp.element.createElement("div",{className:"tf-multiple-select",ref:s},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:[...e].join(",")}),t.label&&wp.element.createElement(xe,{labelProps:d,parent:t},t.label),wp.element.createElement(se,{type:"select",ref:o,onPress:()=>i(!r)},wp.element.createElement("span",{className:"tf-multiple-select__value"},e.size>0?e.size===1?e.size+" item selected":e.size+" items selected":t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),r?wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:o,placement:"bottom start",style:{width:s?.current?.offsetWidth}},h):wp.element.createElement(gn,null,h),t.description&&wp.element.createElement(we,{descriptionProps:f,parent:t},t.description))},"MultipleSelect");var Bte=Object.defineProperty,Rte=u((t,e)=>Bte(t,"name",{value:e,configurable:!0}),"t$2"),W9=Rte(t=>t.multiple?wp.element.createElement(Mte,{items:rl(t.choices??{}),...t,onChange:t.onChange},zd):wp.element.createElement(eu,{selectedKey:t.value,onSelectionChange:t.onChange,items:rl(t.choices??{}),...t},zd),"default"),Vte=Object.defineProperty,Y9=u((t,e)=>Vte(t,"name",{value:e,configurable:!0}),"l$2");const Nte=Y9(t=>{const e=t.units??["px"],{labelProps:n,fieldProps:r,descriptionProps:i}=$t(t),[l,a]=wp.element.useState(On(t.value??"",{value:0,unit:e[0]}));wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]);const o=Y9((s,c)=>{a({...l,[c]:s})},"setAttribute");return wp.element.createElement("div",{className:"tf-simple-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l),...r}),wp.element.createElement("div",{className:"tf-simple-dimensions-container"},wp.element.createElement("div",null,wp.element.createElement(Rf,{value:l.value??0,name:"value",label:"Dimension number",labelVisuallyHidden:!0,description:!1,onChange:s=>o(s,"value")})),wp.element.createElement(eu,{label:"Dimension unit",labelVisuallyHidden:!0,description:!1,selectedKey:l.unit??"px",onSelectionChange:s=>o(s,"unit"),placeholder:"unit"},e.map(s=>wp.element.createElement(Qr,{key:s},s)))),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"Dimensions");var Fte=Object.defineProperty,Ite=u((t,e)=>Fte(t,"name",{value:e,configurable:!0}),"l$1");const Lte=Ite(t=>{const e=Cx(t),n=wp.element.useRef(),{inputProps:r}=eI({...t,children:t.label??""},e,n),{focusProps:i}=is(),{labelProps:l,fieldProps:a,descriptionProps:o}=$t(t);return wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]),wp.element.createElement("div",{className:"tf-switch"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement("label",{className:"tf-switch-label"},wp.element.createElement(gn,null,wp.element.createElement("input",{...a,...r,...i,ref:n,name:""})),wp.element.createElement("div",{className:`tf-switch-element${e.isSelected?"-selected":""}`,"aria-hidden":"true"},wp.element.createElement("span",null))),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Switch");var zte=Object.defineProperty,Zte=u((t,e)=>zte(t,"name",{value:e,configurable:!0}),"t$1"),Y1=Zte(t=>{const e=t.valueOn??"on",n=t.valueOff??"off",[r,i]=wp.element.useState(t.value??n);return wp.element.useEffect(()=>t.onChange&&t.onChange(r),[r]),wp.element.useEffect(()=>{[e,n].includes(t.value)&&t.value!==r&&i(t.value)},[t.value]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(Lte,{label:t.label??"",labelVisuallyHidden:t.labelVisuallyHidden??!1,description:t.description??"",value:r===e,onChange:l=>i(l?e:n)}))},"default"),Xte=Object.defineProperty,jte=u((t,e)=>Xte(t,"name",{value:e,configurable:!0}),"o$2");const qte=jte(t=>{const{Header:e,Container:n,Content:r,Title:i}=UP,l=Object.keys(t.tabs??{}).map(d=>({...t.tabs[d],name:d})),[a,o]=wp.element.useState(l[0]?.name??!1),[s,c]=wp.element.useState(On(t.value));return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(s)}),wp.element.createElement(n,null,wp.element.createElement(e,null,l.map(d=>wp.element.createElement(i,{key:d.name,isOpen:d.name===a,onPress:()=>o(d.name)},d.title))),l&&l.map((d,f)=>wp.element.createElement(r,{key:d.name,isActive:d.name===a},wp.element.createElement(W1,{...t,name:null,fields:d.fields,value:s[d.name]??{},onChange:h=>c({...s,[d.name]:h})})))))},"Tab");var Wte=Object.defineProperty,Yte=u((t,e)=>Wte(t,"name",{value:e,configurable:!0}),"n$4");const K9=Yte(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-text"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement(zX,{...t,inputProps:l,onChange:n,ref:r,dynamic:t.dynamic??!1}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"TextField");var Kte=Object.defineProperty,Ute=u((t,e)=>Kte(t,"name",{value:e,configurable:!0}),"i$3");const Gte=Ute(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si({...t,inputElementType:"textarea"},e);return wp.element.createElement("div",{className:"tf-text-area"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{...r,maxLength:t.maxlength,minLength:t.minlength,required:t.required,rows:t.rows,ref:e,"data-identifier":t.identifier??""}),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TextArea");var _te=Object.defineProperty,Hte=u((t,e)=>_te(t,"name",{value:e,configurable:!0}),"m$4");const Jte=Hte(t=>{const{locale:e}=Re(),n=WI({...t,value:t.value,onChange:s=>{const{hour:c,minute:d,second:f}=s;t.onChange?.(new Tr(c,d,f))},locale:e,minValue:t.minValue,maxValue:t.maxValue}),r=wp.element.useRef(),{labelProps:i,descriptionProps:l,fieldProps:a,inputProps:o}=pF(t,n,r);return wp.element.createElement("div",{className:"tf-time-wrapper"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{...a,className:"tf-time-field"},n.segments.map((s,c)=>wp.element.createElement(iM,{key:c,segment:s,state:n})),n.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"TimeField");var ene=Object.defineProperty,U9=u((t,e)=>ene(t,"name",{value:e,configurable:!0}),"t");const tne=U9(t=>{const e=U9(o=>{if(!o||typeof o!="string")return new Tr(0,0);if(o instanceof Tr)return o;const[s,c]=o.split(":").map(d=>parseInt(d));return new Tr(s,c)},"convertTime"),n=parseInt(t.hourCycle)??12,[r,i]=wp.element.useState(e(t.value)),l=e(t.minValue??"00:00"),a=e(t.maxValue??"23:59");return wp.element.useEffect(()=>{e(t.value).toString()!==r.toString()&&i(t.value)},[t.value]),wp.element.useEffect(()=>{r.toString()!==t.value.toString()&&t.onChange?.(r.toString())},[r]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-time-picker"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(Jte,{label:t.label??"",description:t.description??"",labelVisuallyHidden:t.labelVisuallyHidden,descriptionVisuallyHidden:t.descriptionVisuallyHidden,value:r,onChange:i,name:t.name??"",hourCycle:n,minValue:l,maxValue:a})))},"TimePicker");var nne=Object.defineProperty,G9=u((t,e)=>nne(t,"name",{value:e,configurable:!0}),"c$3");const K1=G9(t=>{const[e,n]=wp.element.useState(""),[r,i]=wp.element.useState(!1);wp.element.useEffect(()=>{r?t.dispatch({type:"bulkCheck"}):t.dispatch({type:"bulkUncheck"})},[r]);const l=G9(()=>{switch(e){case"enabled":case"disabled":t.dispatch({type:"bulkUpdate",control:"enabled",value:e==="enabled"?"on":"off",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break;case"deletion":t.dispatch({type:"bulkRemove",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break}},"applyAction");return wp.element.createElement("div",{className:"tf-repeater-bulk-actions"},wp.element.createElement(nu,{label:"Select or unselect all items",labelVisuallyHidden:!0,value:r,onChange:i}),wp.element.createElement(W9,{label:"Select bulk action",labelVisuallyHidden:!0,placeholder:"Bulk actions",choices:t.actions,value:e,onChange:n}),e==="deletion"?wp.element.createElement(ws,{title:"Confirmation",label:"Apply",onValidate:l},"Are you sure you want to remove the selected items?"):wp.element.createElement(se,{type:"action",onPress:l},"Apply"))},"BulkActions");var rne=Object.defineProperty,Gu=u((t,e)=>rne(t,"name",{value:e,configurable:!0}),"n$3");const ine=Gu((t,e=!1)=>e?e.map(n=>typeof n=="object"?n.name??!1:n):t.map(n=>n.name??""),"getHeaderFieldsName"),lne=Gu((t,e=!1)=>{const n=ine(t,e);return t.filter(r=>n.includes(r.name)||n.includes(r.name+".label")).map(r=>ane(r,e))},"getHeaderConfig"),ane=Gu((t,e)=>{const n=e?e.find(r=>typeof r=="object"&&r.callback&&r.name===t.name):!1;return{...t,callback:n?one(n):!1}},"formatConfig"),one=Gu(t=>typeof t.callback=="function"?t.callback:typeof t.callback=="string"?J9.repeater.__callbacks[t.callback]??!1:!1,"getCallback"),sne=Gu((t,e)=>!e[t.name]||e[t.name]===""?wp.element.createElement("i",null,"Empty"):t.callback?t.callback({column:t,value:e[t.name]}):typeof e[t.name]=="object"?e[t.name].label===""?JSON.stringify(e[t.name]):e[t.name].label:e[t.name],"renderHeaderValue");var une=Object.defineProperty,cne=u((t,e)=>une(t,"name",{value:e,configurable:!0}),"f$2");const dne=cne(({items:t,fields:e,rowFields:n,renderItem:r,maxLength:i,dispatch:l,headerFields:a=!1,beforeRow:o=!1,afterRow:s=!1,renderAction:c,renderFooterActions:d,useBulk:f})=>{const[h,p]=wp.element.useState(!1),m=lne(e,a);return wp.element.createElement(wp.element.Fragment,null,f&&wp.element.createElement(K1,{actions:{deletion:"Delete"},dispatch:l}),wp.element.createElement("div",{className:"tf-repeater-advanced"},wp.element.createElement("div",{className:"tf-repeater-advanced-header tf-repeater-advanced-label-row"},wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"}),m.map((g,O)=>wp.element.createElement("div",{key:O,className:"tf-repeater-advanced-header-item tf-repeater-advanced-label-row-item"},g.label??"")),wp.element.createElement("div",{key:"arrow",className:"tf-repeater-advanced-label-row-arrow"})),wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-advanced-items"},t&&t.slice(0,i).map((g,O)=>wp.element.createElement("div",{key:g.key??O,className:"tf-repeater-advanced-item","data-open":h===O?"true":"false"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview tf-repeater-advanced-label-row"},f&&wp.element.createElement("div",{className:"tf-repeater-advanced-item-checkbox",onClick:b=>b.stopPropagation()},wp.element.createElement(nu,{label:`Select item ${O+1}`,labelVisuallyHidden:!0,value:g._bulkCheckbox,onChange:b=>l({type:"update",item:O,control:"_bulkCheckbox",value:b})})),wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"},O+1),wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-container"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-fields"},m.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-repeater-advanced-overview-item tf-repeater-advanced-label-row-item"},sne(b,g)))),i!==void 0&&wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-actions"},wp.element.createElement(se,{type:"text-primary",onPress:()=>p(h===O?!1:O)},h===O?"Close":"Edit"),c("clone",O,{type:"text-primary"}),c("delete",O,{buttonProps:{type:"text-danger"}}))),wp.element.createElement(se,{key:"arrow",type:"repeater-overview-open",onPress:()=>p(h===O?!1:O),changeTag:"span",className:"tf-repeater-advanced-label-row-arrow"},wp.element.createElement("div",null))),h===O&&wp.element.createElement("div",{className:"tf-repeater-advanced-row"},o&&o(g,O,l),n.map(b=>wp.element.createElement("div",{key:b.name??O,className:"tf-repeater-advanced-item-field"},r(b,g,O))),s&&s(g,O,l)))))),d())},"Advanced");var fne=Object.defineProperty,hne=u((t,e)=>fne(t,"name",{value:e,configurable:!0}),"f$1");const pne=hne(({items:t,rowFields:e,renderItem:n,maxLength:r,dispatch:i,beforeRow:l=!1,afterRow:a=!1,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-bare-items"},t&&t.slice(0,r).map((c,d)=>wp.element.createElement("div",{key:c.key??d,className:"tf-repeater-bare-row"},l&&l(c,d,i),e.map(f=>wp.element.createElement("div",{key:f.name??d,className:"tf-repeater-bare-item-field"},n(f,c,d))),o("delete",d),a&&a(c,d,i)))),s()),"Bare");var mne=Object.defineProperty,gne=u((t,e)=>mne(t,"name",{value:e,configurable:!0}),"d$1");const _9=gne((t,e,n,r,i,l)=>{const a=n||"Item "+(e+1);if(!HP(a))return a;const o={type:"wrapper",name:`_repeater-title-${r}-${t.key}`,content:n,dependent:{callbackData:{repeater:{props:l,item:t,index:e}},...l.dependent?l.dependent:{}}};return i(o,t,e)},"renderTitle");var One=Object.defineProperty,hp=u((t,e)=>One(t,"name",{value:e,configurable:!0}),"n$2");const bne=hp(({items:t,dispatch:e,rowFields:n,renderItem:r,maxLength:i,title:l=!1,useSwitch:a,useBulk:o,name:s,renderFooterActions:c,renderAction:d,parent:f})=>{const[h,p]=wp.element.useState(0),m=hp(y=>p(y!==h?y:!1),"toggleItem"),g={deletion:"Delete"};a&&(g.enabled="Enabled",g.disabled="Disabled");const O=hp((y,$)=>wp.element.createElement(wp.element.Fragment,null,o?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(nu,{label:`Select item ${$+1}`,labelVisuallyHidden:!0,value:y._bulkCheckbox,onChange:v=>e({type:"update",item:$,control:"_bulkCheckbox",value:v})})):null,a?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(Y1,{label:`Enable item ${$+1}`,labelVisuallyHidden:!0,value:y.enabled,onChange:v=>e({type:"update",item:$,control:"enabled",value:v})})):null),"getHeaderLeft"),b=hp((y,$)=>wp.element.createElement(wp.element.Fragment,null,d("clone",y),wp.element.createElement(se,{type:"action",onPress:()=>m(y)},h!==y?"Edit":"Close"),d("delete",y)),"actions");return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-block-items"},o&&wp.element.createElement(K1,{actions:g,dispatch:e}),t&&t.slice(0,i).map((y,$)=>wp.element.createElement(G2,{key:y.key??$,title:_9(y,$,l,s,r,f),footer:b($,y),isOpen:h===$,className:"tf-repeater-block-item",onChange:v=>v?h!==$?p($):null:h===$?p(!1):null,headerLeft:O(y,$)},n.map(v=>wp.element.createElement("div",{key:v.name??$,className:"tf-repeater-block-item-field"},r(v,y,$)))))),c())},"Block");var yne=Object.defineProperty,vne=u((t,e)=>yne(t,"name",{value:e,configurable:!0}),"c$1");const $ne={deletion:"Delete"},wne=vne(({items:t,fields:e,dispatch:n,rowFields:r,renderItem:i,maxLength:l,useBulk:a,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",null,a&&wp.element.createElement(K1,{actions:$ne,dispatch:n}),wp.element.createElement("table",null,wp.element.createElement("thead",null,wp.element.createElement("tr",null,a&&wp.element.createElement("th",null),e.map((c,d)=>wp.element.createElement("th",{key:d},c.label??"")),l>1&&wp.element.createElement("th",{align:"end"}))),wp.element.createElement("tbody",{className:"tf-repeater-items tf-repeater-table-items"},t&&t.slice(0,l).map((c,d)=>wp.element.createElement("tr",{key:c.key??d},a&&wp.element.createElement("td",{key:`${c.key}-enable`},wp.element.createElement("div",{onClick:f=>f.stopPropagation()},wp.element.createElement(nu,{value:c._bulkCheckbox,onChange:f=>n({type:"update",item:d,control:"_bulkCheckbox",value:f})}))),r.map((f,h)=>wp.element.createElement("td",{key:`${c.key}-${h}`},i(f,c,d))),wp.element.createElement("td",{className:"tf-repeater-row-actions"},wp.element.createElement("div",null,o("clone",d),o("delete",d)))))))),s()),"Table");var xne=Object.defineProperty,Sne=u((t,e)=>xne(t,"name",{value:e,configurable:!0}),"m$1");const Cne=Sne(({items:t,rowFields:e,renderItem:n,renderAction:r,maxLength:i,dispatch:l,name:a,title:o=!1,beforeRow:s=!1,afterRow:c=!1,parent:d,string:f})=>{const{Header:h,Container:p,Content:m,Row:g,RowField:O,RowLabel:b,RowTitle:y,Title:$}=UP,[v,S]=wp.element.useState(0),x=wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-tab-add-item tf-tab-item"},i!==void 0&&wp.element.createElement(se,{type:"text-primary",onPress:()=>l({type:"add"}),isDisabled:i<=t.length},f("add"))),wp.element.createElement("div",{className:"tf-repeater-tab-icon-actions"},r("clone",v,{type:"icon-clone",className:"tf-tab-item",contentVisuallyHidden:!0}),r("delete",v,{label:"Remove",title:"Confirmation",onValidate:()=>{l({type:"remove",item:v}),S(v==0?0:v-1)},buttonProps:{type:"icon-trash",contentVisuallyHidden:!0,className:"tf-tab-item"}})));return wp.element.createElement(p,{className:"tf-repeater-tab-container"},wp.element.createElement(h,{className:"tf-repeater-items tf-repeater-tab-items",actionsClassName:"tf-repeater-tab-actions",actions:x},t&&t.slice(0,i).map((C,Q)=>wp.element.createElement($,{key:C.key??Q,isOpen:v==Q,className:"tf-repeater-tab-item",onPress:()=>S(Q)},_9(C,Q,o,a,n,d)))),t&&t.map((C,Q)=>wp.element.createElement(m,{key:C.key??Q,isActive:v===Q,className:"tf-repeater-tab-content"},e.map((T,B)=>wp.element.createElement(g,{key:T.name??B,className:"tf-repeater-tab-row"},s&&s(C,Q,l),T.type==="title"?wp.element.createElement(y,{className:"tf-repeater-tab-row-title tf-repeater-tab-row-title-section"},n(T,C,Q)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(b,{className:"tf-repeater-tab-row-title"},T.label??""),wp.element.createElement(O,{className:"tf-repeater-tab-item-field"},n(T,C,Q))),c&&c(C,Q,l))))))},"Tab");var Hr={_types:{control:{accordion:JL,"alignment-matrix":az,border:KX,"button-group":ej,checkbox:nu,code:MU,"color-picker":XQ,"conditional-panel":_L,"combo-box":Sh,"date-picker":FG,dimensions:IT,"field-group":W1,file:gte,gradient:bte,gallery:wte,list:Dte,hidden:Cte,number:Rf,repeater:cE,radio:Tte,select:W9,"simple-dimension":Nte,switch:Y1,tab:qte,text:K9,"text-suggestion":LG,wysiwyg:z9,editor:z9,textarea:Gte,"time-picker":tne},element:{button:se,description:we,label:xe,"list-box":Nd,modal:ws,wrapper:kL,tooltip:xL,title:Zd},repeater:{advanced:dne,bare:pne,block:bne,table:wne,tab:Cne}},get(t,e="control"){return this._types[e]?.[t]??(e==="repeater"?"table":!1)},add(t,e,n="control"){this._types[n][t]=e}},kne=Object.defineProperty,H9=u((t,e)=>kne(t,"name",{value:e,configurable:!0}),"i$1");const pp=H9(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Oo),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class;const[a,o]=wp.element.useState(r.value??"");wp.element.useEffect(()=>{r.onChange&&r.onChange(a)},[a]);const s=Hr.get(r.type??"text");if(wp.element.useEffect(()=>{n&&n()},[]),!s)return wp.element.createElement(wp.element.Fragment,null);const c=H9(d=>{o(d),setTimeout(()=>{aa("valueChange",{name:r.name??!1,props:r,value:d,previousValue:a})})},"onChange");return wp.element.createElement(hk,{...l},wp.element.createElement(oE,{visibility:t,data:e},wp.element.createElement(sE,{itemType:r.itemType??"field",name:r.name??!1,setValue:o},d=>wp.element.createElement(nE,{refresh:d,data:e,itemProps:r},f=>wp.element.createElement(s,{...f,value:a,onChange:c,data:e,dynamic:r.dynamic?aI(a,o,r):!1})))))},"Control");var Dne=Object.defineProperty,Pne=u((t,e)=>Dne(t,"name",{value:e,configurable:!0}),"o");const Ene=Pne((t,e)=>({getRow(n){const r=e.getValue(t);return Array.isArray(r)&&r[n]?r[n]:!1},setRow(n,r){const i=e.getValue(t);if(!Array.isArray(i)||!i[n])return!1;i[n]=r,e.setValue(t,i)},getRowValue(n,r){const i=this.getRow(n);return i?i[r]:!1},setRowValue(n,r,i){const l=this.getRow(n);if(!l)return!1;l[r]=i,this.setRow(n,l)}}),"getRepeaterStore");var hr={_values:{},_setValueFromControl(t,e){this._values[t]=e},getAllValues(){return this._values},getValue(t){return this._values[t]??""},setValue(t,e){aa("_refreshFieldValue",{name:t,value:e})},getRepeater(t){return Ene(t,this)}},J9={rerender:t=>aa("_fieldRerender",t),dependent:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}},repeater:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}}},Tne=Object.defineProperty,go=u((t,e)=>Tne(t,"name",{value:e,configurable:!0}),"i");const Oo=wp.element.createContext(null),bo=go((t,e="field")=>e==="element"?tB(t):eB(t),"renderComponent"),eB=go(t=>wp.element.createElement(Oo.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:hr.getValue.bind(hr),portalContainer:t.portalContainer??document.body}},wp.element.createElement(pp,{...t,onChange:e=>{hr._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:hr.getValue.bind(hr)}})),"renderField"),tB=go(t=>wp.element.createElement(Oo.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:hr.getValue.bind(hr),portalContainer:t.portalContainer??document.body}},wp.element.createElement(v0,{...t,onChange:e=>{hr._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:hr.getValue.bind(hr)}})),"renderElement");go(()=>{const{fields:t,elements:e}=yr(),n=[];for(const r in t)n.push(nB(r,t[r],"fields"));for(const r in e)e[r].forEach(i=>{n.push(nB(r,i,"elements"))});Promise.all(n).then(()=>aa("ready",{}))},"init");const nB=go((t,e,n)=>new Promise(r=>{const i=document.getElementById(e.element);if(!i)return r();const l=go(()=>{r(),aa(n==="fields"?"initField":"initElement",{name:t,props:e})},"afterInitialization"),a=n==="fields"?eB({name:t,afterInitialization:l,...e}):tB({name:t,afterInitialization:l,...e});wp.element.createRoot?wp.element.createRoot(i).render(a):wp.element.render(a,i)}),"initItem");var Ane=Object.defineProperty,rB=u((t,e)=>Ane(t,"name",{value:e,configurable:!0}),"r");const Qne=rB(()=>{const t=document.getElementById("tf-example-custom-types"),e=t.getAttribute("data-value"),n=rB(r=>{const{initJSON:i}=cI,[l,a]=wp.element.useState(i(r.value??{}));return wp.element.useEffect(()=>{r.onChange&&r.onChange(l)},[l]),wp.element.createElement("div",{className:"tf-custom-type",style:{display:"flex"}},wp.element.createElement("input",{type:"hidden",name:r.name??"",value:JSON.stringify(l)}),wp.element.createElement("div",null,wp.element.createElement("strong",null,"Character attributes:"),wp.element.createElement("hr",null),bo({label:"First name",type:"text",value:l.firstName??"",onChange:o=>a({...l,firstName:o})}),bo({label:"Last name",type:"text",value:l.lastName,onChange:o=>a({...l,lastName:o})}),wp.element.createElement("hr",null),bo({label:"Avatar",type:"file",maxUpload:1,wp_media:!1,value:l.avatar??"",onChange:o=>a({...l,avatar:o}),mimeTypes:["image"]})))},"MyCustomField");Hr.add("custom-type",n),wp.element.createRoot(t).render(bo({type:"custom-type",name:"custom-field-example",value:e}))},"initExample");var Mne=Object.defineProperty,iB=u((t,e)=>Mne(t,"name",{value:e,configurable:!0}),"n");const Bne=iB(()=>{const t=document.getElementById("tf-example-custom-combobox-layout"),e=iB(r=>bo(r),"Field"),n=wp.element.forwardRef((r,i)=>{if(!r.multiple)throw new Error("This layout only support multiple values");const{add:l,remove:a,values:o}=r.multiple;return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("code",{style:{display:"flex",width:"100%",padding:5,boxSizing:"border-box",flexDirection:"column"}},o.length!==0?wp.element.createElement(wp.element.Fragment,null,"Selected values are:",wp.element.createElement("br",null),wp.element.createElement("ul",null,o.map(s=>wp.element.createElement("li",{key:s.key}," - ",s," ")))):"No value selected"),wp.element.createElement("input",{type:"text",style:{display:"flex",width:"100%"},...r.inputProps,ref:i.current.input}),wp.element.createElement("ul",null,[...r.state.collection].map(s=>wp.element.createElement("li",{key:s.key,style:{display:"flex",border:"solid 1px black",padding:5}},wp.element.createElement(e,{type:"checkbox",label:s.textValue,labelVisuallyHidden:!0,value:o.includes(s.key),onChange:c=>{c!==o[s.key]&&(c===!0?l(s.key):a(o.indexOf(s.key)))}}),s.textValue)),r.state.collection.iterable.length===0&&wp.element.createElement("li",{key:"no-results"},"No results")))});wp.element.createRoot(t).render(bo({label:"Custom combobox",type:"combo-box",name:"custom-combo-box-example",value:"",multiple:!0,onChange:r=>console.log(r),layout:n,choices:{value1:"Example value 1",value2:"Second example value",value3:"An example: third part",value4:"The last example (4)"}}))},"initCombobox");window.addEventListener("load",()=>{const t=document.getElementById("tf-context-select");t.addEventListener("change",()=>{const r=new URL(location.href),i=new URLSearchParams(r.search);i.set("context",t.value),location.replace(location.protocol+"//"+location.host+location.pathname+"?"+i.toString())}),document.getElementById("tf-example-custom-types")&&Qne(),document.getElementById("tf-example-custom-combobox-layout")&&Bne();const e=document.getElementsByClassName("tf-dynamic-value-trigger-js"),n=document.getElementsByClassName("tf-dynamic-value-content-js");if(e.length!==0)for(let r=0;r{jQuery(".tf-dynamic-value-content-js").attr("style","display: none"),n[r].setAttribute("style","")})})})(); diff --git a/assets/build/index.min.js b/assets/build/index.min.js index 0ea10396..80192c33 100644 --- a/assets/build/index.min.js +++ b/assets/build/index.min.js @@ -9,7 +9,7 @@ var Mne=Object.defineProperty;var u=(am,Fc)=>Mne(am,"name",{value:Fc,configurabl * { overscroll-behavior: contain; } -}`.trim(),document.head.prepend(r);let i=u(s=>{if(!(s.touches.length===2||e)){if(!t||t===document.documentElement||t===document.body){s.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&s.preventDefault()}},"onTouchMove"),l=u(s=>{let c=s.target,d=s.relatedTarget;if(d&&vm(d))d.focus({preventScroll:!0}),fk(d,vm(c));else if(!d){var f;let h=(f=c.parentElement)===null||f===void 0?void 0:f.closest("[tabindex]");h?.focus({preventScroll:!0})}},"onBlur"),a=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(s){let c=document.activeElement!=null&&vm(document.activeElement);a.call(this,{...s,preventScroll:!0}),(!s||!s.preventScroll)&&fk(this,c)};let o=vr(Gg(document,"touchstart",n,{passive:!1,capture:!0}),Gg(document,"touchmove",i,{passive:!1,capture:!0}),Gg(document,"blur",l,!0));return()=>{o(),r.remove(),HTMLElement.prototype.focus=a}}u(NN,"$49c51c25361d4cd2$var$preventScrollMobileSafari");function Ug(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}u(Ug,"$49c51c25361d4cd2$var$setStyle");function Gg(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}u(Gg,"$49c51c25361d4cd2$var$addEvent");function fk(t,e){e||!cs?hk(t):cs.addEventListener("resize",()=>hk(t),{once:!0})}u(fk,"$49c51c25361d4cd2$var$scrollIntoViewWhenReady");function hk(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=Wc(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect(),l=n.getBoundingClientRect();if(l.topi.top+n.clientHeight){let a=i.bottom;cs&&(a=Math.min(a,cs.offsetTop+cs.height));let o=l.top-i.top-((a-i.top)/2-l.height/2);r.scrollTo({top:Math.max(0,Math.min(r.scrollHeight-r.clientHeight,r.scrollTop+o)),behavior:"smooth"})}}n=r.parentElement}}u(hk,"$49c51c25361d4cd2$var$scrollIntoView");const FN=(0,wp.element.createContext)({});function IN(){var t;return(t=(0,wp.element.useContext)(FN))!==null&&t!==void 0?t:{}}u(IN,"$96b38030c423d352$export$9fc1347d4195ccb3");const _g=wp.element.createContext(null);function LN(t){let{children:e}=t,n=(0,wp.element.useContext)(_g),[r,i]=(0,wp.element.useState)(0),l=(0,wp.element.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(a=>a+1),n&&n.addModal()},removeModal(){i(a=>a-1),n&&n.removeModal()}}),[n,r]);return wp.element.createElement(_g.Provider,{value:l},e)}u(LN,"$f57aed4a881a3485$export$178405afcd8c5eb");function zN(){let t=(0,wp.element.useContext)(_g);return{modalProviderProps:{"aria-hidden":t&&t.modalCount>0?!0:void 0}}}u(zN,"$f57aed4a881a3485$export$d9aaed4c3ece1bc0");function ZN(t){let{modalProviderProps:e}=zN();return wp.element.createElement("div",{"data-overlay-container":!0,...t,...e})}u(ZN,"$f57aed4a881a3485$var$OverlayContainerDOM");function pk(t){return wp.element.createElement(LN,null,wp.element.createElement(ZN,t))}u(pk,"$f57aed4a881a3485$export$bf688221f59024e5");var mk={};mk={dismiss:"\u062A\u062C\u0627\u0647\u0644"};var gk={};gk={dismiss:"\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435"};var Ok={};Ok={dismiss:"Odstranit"};var bk={};bk={dismiss:"Luk"};var yk={};yk={dismiss:"Schlie\xDFen"};var vk={};vk={dismiss:"\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7"};var $k={};$k={dismiss:"Dismiss"};var wk={};wk={dismiss:"Descartar"};var xk={};xk={dismiss:"L\xF5peta"};var Sk={};Sk={dismiss:"Hylk\xE4\xE4"};var Ck={};Ck={dismiss:"Rejeter"};var kk={};kk={dismiss:"\u05D4\u05EA\u05E2\u05DC\u05DD"};var Dk={};Dk={dismiss:"Odbaci"};var Pk={};Pk={dismiss:"Elutas\xEDt\xE1s"};var Ek={};Ek={dismiss:"Ignora"};var Tk={};Tk={dismiss:"\u9589\u3058\u308B"};var Ak={};Ak={dismiss:"\uBB34\uC2DC"};var Qk={};Qk={dismiss:"Atmesti"};var Mk={};Mk={dismiss:"Ner\u0101d\u012Bt"};var Bk={};Bk={dismiss:"Lukk"};var Rk={};Rk={dismiss:"Negeren"};var Vk={};Vk={dismiss:"Zignoruj"};var Nk={};Nk={dismiss:"Descartar"};var Fk={};Fk={dismiss:"Dispensar"};var Ik={};Ik={dismiss:"Revocare"};var Lk={};Lk={dismiss:"\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C"};var zk={};zk={dismiss:"Zru\u0161i\u0165"};var Zk={};Zk={dismiss:"Opusti"};var Xk={};Xk={dismiss:"Odbaci"};var jk={};jk={dismiss:"Avvisa"};var qk={};qk={dismiss:"Kapat"};var Wk={};Wk={dismiss:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438"};var Yk={};Yk={dismiss:"\u53D6\u6D88"};var Kk={};Kk={dismiss:"\u95DC\u9589"};var Uk={};Uk={"ar-AE":mk,"bg-BG":gk,"cs-CZ":Ok,"da-DK":bk,"de-DE":yk,"el-GR":vk,"en-US":$k,"es-ES":wk,"et-EE":xk,"fi-FI":Sk,"fr-FR":Ck,"he-IL":kk,"hr-HR":Dk,"hu-HU":Pk,"it-IT":Ek,"ja-JP":Tk,"ko-KR":Ak,"lt-LT":Qk,"lv-LV":Mk,"nb-NO":Bk,"nl-NL":Rk,"pl-PL":Vk,"pt-BR":Nk,"pt-PT":Fk,"ro-RO":Ik,"ru-RU":Lk,"sk-SK":zk,"sl-SI":Zk,"sr-SP":Xk,"sv-SE":jk,"tr-TR":qk,"uk-UA":Wk,"zh-CN":Yk,"zh-TW":Kk};function XN(t){return t&&t.__esModule?t.default:t}u(XN,"$parcel$interopDefault$7");function ds(t){let{onDismiss:e,...n}=t,r=Yt(XN(Uk),"@react-aria/overlays"),i=Xn(n,r.format("dismiss")),l=u(()=>{e&&e()},"onClick");return wp.element.createElement(gn,null,wp.element.createElement("button",{...i,tabIndex:-1,onClick:l,style:{width:1,height:1}}))}u(ds,"$86ea4cb521eb2e37$export$2317d149ed6f78c4");const jN=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;let fs=new WeakMap,Nt=[];function Hg(t,e){let n=bt(t?.[0]),r=e instanceof n.Element?{root:e}:e;var i;let l=(i=r?.root)!==null&&i!==void 0?i:document.body,a=r?.shouldUseInert&&jN,o=new Set(t),s=new Set,c=u(g=>a&&g instanceof n.HTMLElement?g.inert:g.getAttribute("aria-hidden")==="true","getHidden"),d=u((g,O)=>{a&&g instanceof n.HTMLElement?g.inert=O:O?g.setAttribute("aria-hidden","true"):(g.removeAttribute("aria-hidden"),g instanceof n.HTMLElement&&(g.inert=!1))},"setHidden"),f=u(g=>{for(let $ of g.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))o.add($);let O=u($=>{if(s.has($)||o.has($)||$.parentElement&&s.has($.parentElement)&&$.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let v of o)if($.contains(v))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},"acceptNode"),b=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode:O}),y=O(g);if(y===NodeFilter.FILTER_ACCEPT&&h(g),y!==NodeFilter.FILTER_REJECT){let $=b.nextNode();for(;$!=null;)h($),$=b.nextNode()}},"walk"),h=u(g=>{var O;let b=(O=fs.get(g))!==null&&O!==void 0?O:0;c(g)&&b===0||(b===0&&d(g,!0),s.add(g),fs.set(g,b+1))},"hide");Nt.length&&Nt[Nt.length-1].disconnect(),f(l);let p=new MutationObserver(g=>{for(let O of g)if(O.type==="childList"&&![...o,...s].some(b=>b.contains(O.target)))for(let b of O.addedNodes)(b instanceof HTMLElement||b instanceof SVGElement)&&(b.dataset.liveAnnouncer==="true"||b.dataset.reactAriaTopLayer==="true")?o.add(b):b instanceof Element&&f(b)});p.observe(l,{childList:!0,subtree:!0});let m={visibleNodes:o,hiddenNodes:s,observe(){p.observe(l,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return Nt.push(m),()=>{p.disconnect();for(let g of s){let O=fs.get(g);O!=null&&(O===1?(d(g,!1),fs.delete(g)):fs.set(g,O-1))}m===Nt[Nt.length-1]?(Nt.pop(),Nt.length&&Nt[Nt.length-1].observe()):Nt.splice(Nt.indexOf(m),1)}}u(Hg,"$5e3802645cc19319$export$1c3ebcada18427bf");function qN(t){let e=Nt[Nt.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}u(qN,"$5e3802645cc19319$export$1020fa7f77e17884");function WN(t,e){let{triggerRef:n,popoverRef:r,groupRef:i,isNonModal:l,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o,...s}=t,c=s.trigger==="SubmenuTrigger",{overlayProps:d,underlayProps:f}=ck({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!l||c,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o},i??r),{overlayProps:h,arrowProps:p,placement:m,triggerAnchorPoint:g}=MN({...s,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:l&&!c?e.close:null});return dk({isDisabled:l||!e.isOpen}),(0,wp.element.useEffect)(()=>{if(e.isOpen&&r.current){var O,b;return l?qN((O=i?.current)!==null&&O!==void 0?O:r.current):Hg([(b=i?.current)!==null&&b!==void 0?b:r.current],{shouldUseInert:!0})}},[l,e.isOpen,r,i]),{popoverProps:ne(d,h),arrowProps:p,underlayProps:f,placement:m,triggerAnchorPoint:g}}u(WN,"$f2f8a6077418541e$export$542a6fd13ac93354");const Gk=wp.element.createContext(null);function _k(t){let e=hm(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[i,l]=(0,wp.element.useState)(!1),a=(0,wp.element.useMemo)(()=>({contain:i,setContain:l}),[i,l]),{getContainer:o}=IN();if(!t.portalContainer&&o&&(n=o()),!n)return null;let s=t.children;return t.disableFocusManagement||(s=wp.element.createElement(vd,{restoreFocus:!0,contain:(t.shouldContainFocus||i)&&!r},s)),s=wp.element.createElement(Gk.Provider,{value:a},wp.element.createElement(OR,null,s)),wp.element.createPortal(s,n)}u(_k,"$337b884510726a0d$export$c6fdb837b070b4ff");function Hk(){let t=(0,wp.element.useContext)(Gk),e=t?.setContain;Pe(()=>{e?.(!0)},[e])}u(Hk,"$337b884510726a0d$export$14c98a7594375490");function YN(t,e,n){let{overlayProps:r,underlayProps:i}=ck({...t,isOpen:e.isOpen,onClose:e.close},n);return dk({isDisabled:!e.isOpen}),Hk(),(0,wp.element.useEffect)(()=>{if(e.isOpen&&n.current)return Hg([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:ne(r),underlayProps:i}}u(YN,"$8ac8429251c45e4b$export$dbc0f175b25fb0fb");const Ad=new WeakMap;function KN(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}u(KN,"$b1f0cad8af73213b$var$normalizeKey");function Jk(t,e){let n=Ad.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${KN(e)}`}u(Jk,"$b1f0cad8af73213b$export$9145995848b05025");function Jg(t){return jc()?t.altKey:t.ctrlKey}u(Jg,"$feb5ffebff200149$export$d3e3bd3e26688c04");function Qd(t,e){var n,r;let i=`[data-key="${CSS.escape(String(e))}"]`,l=(n=t.current)===null||n===void 0?void 0:n.dataset.collection;return l&&(i=`[data-collection="${CSS.escape(l)}"]${i}`),(r=t.current)===null||r===void 0?void 0:r.querySelector(i)}u(Qd,"$feb5ffebff200149$export$c3d8340acf92597f");const eD=new WeakMap;function UN(t){let e=Ie();return eD.set(t,e),e}u(UN,"$feb5ffebff200149$export$881eb0d9f3605d9d");function GN(t){return eD.get(t)}u(GN,"$feb5ffebff200149$export$6aeb1680a0ae8741");const _N=1e3;function tD(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,i=(0,wp.element.useRef)({search:"",timeout:void 0}).current,l=u(a=>{let o=HN(a.key);if(!(!o||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target)||i.search.length===0&&o===" ")){if(o===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=o,e.getKeyForSearch!=null){let s=e.getKeyForSearch(i.search,n.focusedKey);s==null&&(s=e.getKeyForSearch(i.search)),s!=null&&(n.setFocusedKey(s),r&&r(s))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},_N)}},"onKeyDown");return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?l:void 0}}}u(tD,"$fb3050f43d946246$export$e32c88dfddc6e1d8");function HN(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}u(HN,"$fb3050f43d946246$var$getStringForKey");function nD(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:l=!1,disallowEmptySelection:a=!1,disallowSelectAll:o=!1,escapeKeyBehavior:s="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:h=!1,isVirtualized:p,scrollRef:m=r,linkBehavior:g="action"}=t,{direction:O}=Re(),b=qc(),y=u(P=>{var R;if(P.altKey&&P.key==="Tab"&&P.preventDefault(),!(!((R=r.current)===null||R===void 0)&&R.contains(P.target)))return;const L=u((Z,ee)=>{if(Z!=null){if(e.isLink(Z)&&g==="selection"&&c&&!Jg(P)){(0,wp.element.flushSync)(()=>{e.setFocusedKey(Z,ee)});let De=Qd(r,Z),qt=e.getItemProps(Z);De&&b.open(De,P,qt.href,qt.routerOptions);return}if(e.setFocusedKey(Z,ee),e.isLink(Z)&&g==="override")return;P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&!Jg(P)&&e.replaceSelection(Z)}},"navigateToKey");switch(P.key){case"ArrowDown":if(n.getKeyBelow){var k,F,N;let Z=e.focusedKey!=null?(k=n.getKeyBelow)===null||k===void 0?void 0:k.call(n,e.focusedKey):(F=n.getFirstKey)===null||F===void 0?void 0:F.call(n);Z==null&&l&&(Z=(N=n.getFirstKey)===null||N===void 0?void 0:N.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowUp":if(n.getKeyAbove){var z,G,le;let Z=e.focusedKey!=null?(z=n.getKeyAbove)===null||z===void 0?void 0:z.call(n,e.focusedKey):(G=n.getLastKey)===null||G===void 0?void 0:G.call(n);Z==null&&l&&(Z=(le=n.getLastKey)===null||le===void 0?void 0:le.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowLeft":if(n.getKeyLeftOf){var ie,me,ve;let Z=e.focusedKey!=null?(ie=n.getKeyLeftOf)===null||ie===void 0?void 0:ie.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(me=n.getFirstKey)===null||me===void 0?void 0:me.call(n,e.focusedKey):(ve=n.getLastKey)===null||ve===void 0?void 0:ve.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var ce,K,W;let Z=e.focusedKey!=null?(ce=n.getKeyRightOf)===null||ce===void 0?void 0:ce.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(K=n.getLastKey)===null||K===void 0?void 0:K.call(n,e.focusedKey):(W=n.getFirstKey)===null||W===void 0?void 0:W.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getFirstKey(e.focusedKey,fa(P));e.setFocusedKey(Z),Z!=null&&(fa(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getLastKey(e.focusedKey,fa(P));e.setFocusedKey(Z),Z!=null&&(fa(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let Z=n.getKeyPageBelow(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let Z=n.getKeyPageAbove(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"a":fa(P)&&e.selectionMode==="multiple"&&o!==!0&&(P.preventDefault(),e.selectAll());break;case"Escape":s==="clearSelection"&&!a&&e.selectedKeys.size!==0&&(P.stopPropagation(),P.preventDefault(),e.clearSelection());break;case"Tab":if(!h){if(P.shiftKey)r.current.focus();else{let Z=ut(r.current,{tabbable:!0}),ee,De;do De=Z.lastChild(),De&&(ee=De);while(De);ee&&!ee.contains(document.activeElement)&&Bt(ee)}break}}},"onKeyDown"),$=(0,wp.element.useRef)({top:0,left:0});un(m,"scroll",p?void 0:()=>{var P,R,L,k;$.current={top:(L=(P=m.current)===null||P===void 0?void 0:P.scrollTop)!==null&&L!==void 0?L:0,left:(k=(R=m.current)===null||R===void 0?void 0:R.scrollLeft)!==null&&k!==void 0?k:0}});let v=u(P=>{if(e.isFocused){P.currentTarget.contains(P.target)||e.setFocused(!1);return}if(P.currentTarget.contains(P.target)){if(e.setFocused(!0),e.focusedKey==null){var R,L;let N=u(G=>{G!=null&&(e.setFocusedKey(G),c&&!e.isSelected(G)&&e.replaceSelection(G))},"navigateToKey"),z=P.relatedTarget;var k,F;z&&P.currentTarget.compareDocumentPosition(z)&Node.DOCUMENT_POSITION_FOLLOWING?N((k=e.lastSelectedKey)!==null&&k!==void 0?k:(R=n.getLastKey)===null||R===void 0?void 0:R.call(n)):N((F=e.firstSelectedKey)!==null&&F!==void 0?F:(L=n.getFirstKey)===null||L===void 0?void 0:L.call(n))}else!p&&m.current&&(m.current.scrollTop=$.current.top,m.current.scrollLeft=$.current.left);if(e.focusedKey!=null&&m.current){let N=Qd(r,e.focusedKey);N instanceof HTMLElement&&(!N.contains(document.activeElement)&&!f&&Bt(N),zo()==="keyboard"&&Yc(N,{containingElement:r.current}))}}},"onFocus"),S=u(P=>{P.currentTarget.contains(P.relatedTarget)||e.setFocused(!1)},"onBlur"),x=(0,wp.element.useRef)(!1);un(r,WB,f?P=>{let{detail:R}=P;P.stopPropagation(),e.setFocused(!0),R?.focusStrategy==="first"&&(x.current=!0)}:void 0);let C=Me(()=>{var P,R;let L=(R=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&R!==void 0?R:null;if(L==null){let k=Ke();Fw(r.current),Tg(k,null),e.collection.size>0&&(x.current=!1)}else e.setFocusedKey(L),x.current=!1});t3(()=>{x.current&&C()},[e.collection,C]);let Q=Me(()=>{e.collection.size>0&&(x.current=!1)});t3(()=>{Q()},[e.focusedKey,Q]),un(r,qB,f?P=>{var R;P.stopPropagation(),e.setFocused(!1),!((R=P.detail)===null||R===void 0)&&R.clearFocusKey&&e.setFocusedKey(null)}:void 0);const T=(0,wp.element.useRef)(i),B=(0,wp.element.useRef)(!1);(0,wp.element.useEffect)(()=>{if(T.current){var P,R;let F=null;var L;i==="first"&&(F=(L=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&L!==void 0?L:null);var k;i==="last"&&(F=(k=(R=n.getLastKey)===null||R===void 0?void 0:R.call(n))!==null&&k!==void 0?k:null);let N=e.selectedKeys;if(N.size){for(let z of N)if(e.canSelectItem(z)){F=z;break}}e.setFocused(!0),e.setFocusedKey(F),F==null&&!f&&r.current&&Ui(r.current),e.collection.size>0&&(T.current=!1,B.current=!0)}});let w=(0,wp.element.useRef)(e.focusedKey),M=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==w.current||B.current)&&m.current&&r.current){let P=zo(),R=Qd(r,e.focusedKey);if(!(R instanceof HTMLElement))return;(P==="keyboard"||B.current)&&(M.current&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame(()=>{m.current&&(i3(m.current,R),P!=="virtual"&&Yc(R,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&w.current!=null&&r.current&&Ui(r.current),w.current=e.focusedKey,B.current=!1}),(0,wp.element.useEffect)(()=>()=>{M.current&&cancelAnimationFrame(M.current)},[]),un(r,"react-aria-focus-scope-restore",P=>{P.preventDefault(),e.setFocused(!0)});let A={onKeyDown:y,onFocus:v,onBlur:S,onMouseDown(P){m.current===P.target&&P.preventDefault()}},{typeSelectProps:E}=tD({keyboardDelegate:n,selectionManager:e});d||(A=ne(E,A));let I;f||(I=e.focusedKey==null?0:-1);let D=UN(e.collection);return{collectionProps:ne(A,{tabIndex:I,"data-collection":D})}}u(nD,"$ae20dd8cbca75726$export$d6daf82dcd84e87c");function JN(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:l,shouldUseVirtualFocus:a,focus:o,isDisabled:s,onAction:c,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,h=qc();e=Ie(e);let p=u(k=>{if(k.pointerType==="keyboard"&&Jg(k))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&i.current){let F=n.getItemProps(r);h.open(i.current,k,F.href,F.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):k&&k.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||k&&(fa(k)||k.pointerType==="touch"||k.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}},"onSelect");(0,wp.element.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(a?Fw(i.current):o?o():document.activeElement!==i.current&&i.current&&Ui(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,a]),s=s||n.isDisabled(r);let m={};!a&&!s?m={tabIndex:r===n.focusedKey?0:-1,onFocus(k){k.target===i.current&&n.setFocusedKey(r)}}:s&&(m.onMouseDown=k=>{k.preventDefault()});let g=n.isLink(r)&&f==="override",O=c&&t.UNSTABLE_itemBehavior==="action",b=n.isLink(r)&&f!=="selection"&&f!=="none",y=!s&&n.canSelectItem(r)&&!g&&!O,$=(c||b)&&!s,v=$&&(n.selectionBehavior==="replace"?!y:!y||n.isEmpty),S=$&&y&&n.selectionBehavior==="replace",x=v||S,C=(0,wp.element.useRef)(null),Q=x&&y,T=(0,wp.element.useRef)(!1),B=(0,wp.element.useRef)(!1),w=n.getItemProps(r),M=u(k=>{if(c){var F;c(),(F=i.current)===null||F===void 0||F.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}b&&i.current&&h.open(i.current,k,w.href,w.routerOptions)},"performAction"),A={ref:i};if(l?(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,k.pointerType==="keyboard"&&(!x||iD())&&p(k)},d?(A.onPressUp=v?void 0:k=>{k.pointerType==="mouse"&&y&&p(k)},A.onPress=v?M:k=>{k.pointerType!=="keyboard"&&k.pointerType!=="mouse"&&y&&p(k)}):A.onPress=k=>{if(v||S&&k.pointerType!=="mouse"){if(k.pointerType==="keyboard"&&!rD())return;M(k)}else k.pointerType!=="keyboard"&&y&&p(k)}):(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,B.current=v,y&&(k.pointerType==="mouse"&&!v||k.pointerType==="keyboard"&&(!$||iD()))&&p(k)},A.onPress=k=>{(k.pointerType==="touch"||k.pointerType==="pen"||k.pointerType==="virtual"||k.pointerType==="keyboard"&&x&&rD()||k.pointerType==="mouse"&&B.current)&&(x?M(k):y&&p(k))}),m["data-collection"]=GN(n.collection),m["data-key"]=r,A.preventFocusOnPress=a,a&&(A=ne(A,{onPressStart(k){k.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(k){k.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),w)for(let k of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])w[k]&&(A[k]=vr(A[k],w[k]));let{pressProps:E,isPressed:I}=jn(A),D=S?k=>{C.current==="mouse"&&(k.stopPropagation(),k.preventDefault(),M(k))}:void 0,{longPressProps:P}=P3({isDisabled:!Q,onLongPress(k){k.pointerType==="touch"&&(p(k),n.setSelectionBehavior("toggle"))}}),R=u(k=>{C.current==="touch"&&T.current&&k.preventDefault()},"onDragStartCapture"),L=f!=="none"&&n.isLink(r)?k=>{qi.isOpening||k.preventDefault()}:void 0;return{itemProps:ne(m,y||v||a&&!s?E:{},Q?P:{},{onDoubleClick:D,onDragStartCapture:R,onClick:L,id:e},a?{onMouseDown:k=>k.preventDefault()}:void 0),isPressed:I,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:s,allowsSelection:y,hasAction:x}}u(JN,"$880e95eb8b93ba9a$export$ecf600387e221c37");function rD(){let t=window.event;return t?.key==="Enter"}u(rD,"$880e95eb8b93ba9a$var$isActionKey");function iD(){let t=window.event;return t?.key===" "||t?.code==="Space"}u(iD,"$880e95eb8b93ba9a$var$isSelectionKey");const vv=class vv{getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?Qd(this.ref,e):null;if(!r)return null;let i=n.getBoundingClientRect(),l=r.getBoundingClientRect();return{x:l.left-i.left-n.clientLeft+n.scrollLeft,y:l.top-i.top-n.clientTop+n.scrollTop,width:l.width,height:l.height}}getContentSize(){let e=this.ref.current;var n,r;return{width:(n=e?.scrollWidth)!==null&&n!==void 0?n:0,height:(r=e?.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let e=this.ref.current;var n,r,i,l;return{x:(n=e?.scrollLeft)!==null&&n!==void 0?n:0,y:(r=e?.scrollTop)!==null&&r!==void 0?r:0,width:(i=e?.clientWidth)!==null&&i!==void 0?i:0,height:(l=e?.clientHeight)!==null&&l!==void 0?l:0}}constructor(e){this.ref=e}};u(vv,"$657e4dc4a6e88df0$export$8f5ed9ff9f511381");let Md=vv;const $v=class $v{isDisabled(e){var n;return this.disabledBehavior==="all"&&(((n=e.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,n){let r=e;for(;r!=null;){let i=this.collection.getItem(r);if(i?.type==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(e){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(e){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(e,n,r){let i=e,l=this.layoutDelegate.getItemRect(i);if(!l||i==null)return null;let a=l;do{if(i=n(i),i==null)break;l=this.layoutDelegate.getItemRect(i)}while(l&&r(a,l)&&i!=null);return i}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,n){return n?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!da(n))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let l=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let l=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!da(n))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let l=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xl||new hs({collection:n,disabledKeys:r,disabledBehavior:s,ref:i,collator:o,layoutDelegate:a}),[l,a,n,r,i,o,s]),{collectionProps:d}=nD({...t,ref:i,selectionManager:e,keyboardDelegate:c});return{listProps:d}}u(eF,"$982254629710d113$export$b95089534ab7c1fd");function lD(t,e,n){let r=yt(t,{labelable:!0}),i=t.selectionBehavior||"toggle",l=t.linkBehavior||(i==="replace"?"action":"override");i==="toggle"&&l==="action"&&(l="override");let{listProps:a}=eF({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:l}),{focusWithinProps:o}=Wt({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),s=Ie(t.id);Ad.set(e,{id:s,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:l,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:c,fieldProps:d}=Cd({...t,id:s,labelElementType:"span"});return{labelProps:c,listBoxProps:ne(r,o,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...ne(d,a)})}}u(lD,"$c132121280ec012d$export$50eacbbf140a3141");function aD(t){return null}u(aD,"$c1d7fb2ec91bae71$var$Item"),aD.getCollectionNode=u(function*(e,n){let{childItems:r,title:i,children:l}=e,a=e.title||e.children,o=e.textValue||(typeof a=="string"?a:"")||e["aria-label"]||"";!o&&!n?.suppressTextValueWarning&&process.env.NODE_ENV!=="production"&&console.warn(" with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:e,rendered:a,textValue:o,"aria-label":e["aria-label"],hasChildNodes:tF(e),*childNodes(){if(r)for(let s of r)yield{type:"item",value:s};else if(i){let s=[];wp.element.Children.forEach(l,c=>{s.push({type:"item",element:c})}),yield*s}}}},"getCollectionNode");function tF(t){return t.hasChildItems!=null?t.hasChildItems:!!(t.childItems||t.title&&wp.element.Children.count(t.children)>0)}u(tF,"$c1d7fb2ec91bae71$var$hasChildItems");let Qr=aD;function oD(t){return null}u(oD,"$9fc4852771d079eb$var$Section"),oD.getCollectionNode=u(function*(e){let{children:n,title:r,items:i}=e;yield{type:"section",props:e,hasChildNodes:!0,rendered:r,"aria-label":e["aria-label"],*childNodes(){if(typeof n=="function"){if(!i)throw new Error("props.children was a function but props.items is missing");for(let l of i)yield{type:"item",value:l,renderer:n}}else{let l=[];wp.element.Children.forEach(n,a=>{l.push({type:"item",element:a})}),yield*l}}}},"getCollectionNode");let nF=oD;const wv=class wv{build(e,n){return this.context=n,sD(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(wp.element.isValidElement(n)&&n.type===wp.element.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let l of r)yield*this.getFullNode({value:l,index:i},{renderer:n}),i++}else{let i=[];wp.element.Children.forEach(n,a=>{a&&i.push(a)});let l=0;for(let a of i){let o=this.getFullNode({element:a,index:l},{});for(let s of o)l++,yield s}}}getKey(e,n,r,i){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let l=n.value;if(l!=null){var a;let o=(a=l.key)!==null&&a!==void 0?a:l.id;if(o==null)throw new Error("No key found for item");return o}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,i){if(wp.element.isValidElement(e.element)&&e.element.type===wp.element.Fragment){let O=[];wp.element.Children.forEach(e.element.props.children,y=>{O.push(y)});var l;let b=(l=e.index)!==null&&l!==void 0?l:0;for(const y of O)yield*this.getFullNode({element:y,index:b++},n,r,i);return}let a=e.element;if(!a&&e.value&&n&&n.renderer){let O=this.cache.get(e.value);if(O&&(!O.shouldInvalidate||!O.shouldInvalidate(this.context))){O.index=e.index,O.parentKey=i?i.key:null,yield O;return}a=n.renderer(e.value)}if(wp.element.isValidElement(a)){let O=a.type;if(typeof O!="function"&&typeof O.getCollectionNode!="function"){let v=a.type;throw new Error(`Unknown element <${v}> in collection.`)}let b=O.getCollectionNode(a.props,this.context);var o;let y=(o=e.index)!==null&&o!==void 0?o:0,$=b.next();for(;!$.done&&$.value;){let v=$.value;e.index=y;var s;let S=(s=v.key)!==null&&s!==void 0?s:null;S==null&&(S=v.element?null:this.getKey(a,e,n,r));let C=[...this.getFullNode({...v,key:S,index:y,wrapper:rF(e.wrapper,v.wrapper)},this.getChildState(n,v),r?`${r}${a.key}`:a.key,i)];for(let Q of C){var c,d;Q.value=(d=(c=v.value)!==null&&c!==void 0?c:e.value)!==null&&d!==void 0?d:null,Q.value&&this.cache.set(Q.value,Q);var f;if(e.type&&Q.type!==e.type)throw new Error(`Unsupported type <${t0(Q.type)}> in <${t0((f=i?.type)!==null&&f!==void 0?f:"unknown parent type")}>. Only <${t0(e.type)}> is supported.`);y++,yield Q}$=b.next(C)}return}if(e.key==null||e.type==null)return;let h=this;var p,m;let g={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:(p=e.value)!==null&&p!==void 0?p:null,level:i?i.level+1:0,index:e.index,rendered:e.rendered,textValue:(m=e.textValue)!==null&&m!==void 0?m:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:sD(function*(){if(!e.hasChildNodes||!e.childNodes)return;let O=0;for(let b of e.childNodes()){b.key!=null&&(b.key=`${g.key}${b.key}`);let y=h.getFullNode({...b,index:O},h.getChildState(n,b),g.key,g);for(let $ of y)O++,yield $}})};yield g}constructor(){this.cache=new WeakMap}};u(wv,"$eb2240fc39a57fa5$export$bf788dd355e3a401");let e0=wv;function sD(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}u(sD,"$eb2240fc39a57fa5$var$iterable");function rF(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}u(rF,"$eb2240fc39a57fa5$var$compose");function t0(t){return t[0].toUpperCase()+t.slice(1)}u(t0,"$eb2240fc39a57fa5$var$capitalize");function iF(t,e,n){let r=(0,wp.element.useMemo)(()=>new e0,[]),{children:i,items:l,collection:a}=t;return(0,wp.element.useMemo)(()=>{if(a)return a;let s=r.build({children:i,items:l},n);return e(s)},[r,i,l,a,n,e])}u(iF,"$7613b1592d41b092$export$6cd28814d92fa9c9");function Bd(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}u(Bd,"$c5a24bc478652b5f$export$1005530eda016c13");function lF(t){return aF(t,0)}u(lF,"$c5a24bc478652b5f$export$fbdeaa6a76694f71");function aF(t,e){if(e<0)return;let n=0;for(let r of t){if(n===e)return r;n++}}u(aF,"$c5a24bc478652b5f$export$5f3398f8733f90e2");function n0(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...uD(t,e),e],i=[...uD(t,n),n],l=r.slice(0,i.length).findIndex((a,o)=>a!==i[o]);return l!==-1?(e=r[l],n=i[l],e.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===e)>=0,-1)}u(n0,"$c5a24bc478652b5f$export$8c434b3a7a4dad6");function uD(t,e){let n=[],r=e;for(;r?.parentKey!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}u(uD,"$c5a24bc478652b5f$var$getAncestors");const cD=new WeakMap;function dD(t){let e=cD.get(t);if(e!=null)return e;let n=0,r=u(i=>{for(let l of i)l.type==="section"?r(Bd(l,t)):l.type==="item"&&n++},"countItems");return r(t),cD.set(t,n),n}u(dD,"$453cc9f0df89c0a5$export$77d5aafae4e095b2");function oF(t,e,n){var r,i;let{key:l}=t,a=Ad.get(e);var o;let s=(o=t.isDisabled)!==null&&o!==void 0?o:e.selectionManager.isDisabled(l);var c;let d=(c=t.isSelected)!==null&&c!==void 0?c:e.selectionManager.isSelected(l);var f;let h=(f=t.shouldSelectOnPressUp)!==null&&f!==void 0?f:a?.shouldSelectOnPressUp;var p;let m=(p=t.shouldFocusOnHover)!==null&&p!==void 0?p:a?.shouldFocusOnHover;var g;let O=(g=t.shouldUseVirtualFocus)!==null&&g!==void 0?g:a?.shouldUseVirtualFocus;var b;let y=(b=t.isVirtualized)!==null&&b!==void 0?b:a?.isVirtualized,$=ca(),v=ca(),S={role:"option","aria-disabled":s||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?d:void 0};wr()&&gm()||(S["aria-label"]=t["aria-label"],S["aria-labelledby"]=$,S["aria-describedby"]=v);let x=e.collection.getItem(l);if(y){let P=Number(x?.index);S["aria-posinset"]=Number.isNaN(P)?void 0:P+1,S["aria-setsize"]=dD(e.collection)}let C=a?.onAction?()=>{var P;return a==null||(P=a.onAction)===null||P===void 0?void 0:P.call(a,l)}:void 0,Q=Jk(e,l),{itemProps:T,isPressed:B,isFocused:w,hasAction:M,allowsSelection:A}=JN({selectionManager:e.selectionManager,key:l,ref:n,shouldSelectOnPressUp:h,allowsDifferentPressOrigin:h&&m,isVirtualized:y,shouldUseVirtualFocus:O,isDisabled:s,onAction:C||!(x==null||(r=x.props)===null||r===void 0)&&r.onAction?vr(x==null||(i=x.props)===null||i===void 0?void 0:i.onAction,C):void 0,linkBehavior:a?.linkBehavior,UNSTABLE_itemBehavior:a?.UNSTABLE_itemBehavior,id:Q}),{hoverProps:E}=yR({isDisabled:s||!m,onHoverStart(){td()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l))}}),I=yt(x?.props);delete I.id;let D=FB(x?.props);return{optionProps:{...S,...ne(I,T,E,D),id:Q},labelProps:{id:$},descriptionProps:{id:v},isFocused:w,isFocusVisible:w&&e.selectionManager.isFocused&&td(),isSelected:d,isDisabled:s,isPressed:B,allowsSelection:A,hasAction:M}}u(oF,"$293f70390ea03370$export$497855f14858aa34");function sF(t){let{heading:e,"aria-label":n}=t,r=Ie();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}u(sF,"$af383d3bef1cfdc9$export$c3f9f39876e4bc7");var fD={};fD={longPressMessage:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u0627\u064B \u0623\u0648 \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 Alt + \u0627\u0644\u0633\u0647\u0645 \u0644\u0623\u0633\u0641\u0644 \u0644\u0641\u062A\u062D \u0627\u0644\u0642\u0627\u0626\u0645\u0629"};var hD={};hD={longPressMessage:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E \u0438\u043B\u0438 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Alt+ \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u0434\u043E\u043B\u0443, \u0437\u0430 \u0434\u0430 \u043E\u0442\u0432\u043E\u0440\u0438\u0442\u0435 \u043C\u0435\u043D\u044E\u0442\u043E"};var pD={};pD={longPressMessage:"Dlouh\xFDm stiskem nebo stisknut\xEDm kl\xE1ves Alt + \u0161ipka dol\u016F otev\u0159ete nab\xEDdku"};var mD={};mD={longPressMessage:"Langt tryk eller tryk p\xE5 Alt + pil ned for at \xE5bne menuen"};var gD={};gD={longPressMessage:"Dr\xFCcken Sie lange oder dr\xFCcken Sie Alt + Nach-unten, um das Men\xFC zu \xF6ffnen"};var OD={};OD={longPressMessage:"\u03A0\u03B9\u03AD\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03AE \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 Alt + \u03BA\u03AC\u03C4\u03C9 \u03B2\u03AD\u03BB\u03BF\u03C2 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B1\u03BD\u03BF\u03AF\u03BE\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BC\u03B5\u03BD\u03BF\u03CD"};var bD={};bD={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var yD={};yD={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xFA"};var vD={};vD={longPressMessage:"Men\xFC\xFC avamiseks vajutage pikalt v\xF5i vajutage klahve Alt + allanool"};var $D={};$D={longPressMessage:"Avaa valikko painamalla pohjassa tai n\xE4pp\xE4inyhdistelm\xE4ll\xE4 Alt + Alanuoli"};var wD={};wD={longPressMessage:"Appuyez de mani\xE8re prolong\xE9e ou appuyez sur Alt\xA0+\xA0Fl\xE8che vers le bas pour ouvrir le menu."};var xD={};xD={longPressMessage:"\u05DC\u05D7\u05E5 \u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05D0\u05D5 \u05D4\u05E7\u05E9 Alt + ArrowDown \u05DB\u05D3\u05D9 \u05DC\u05E4\u05EA\u05D5\u05D7 \u05D0\u05EA \u05D4\u05EA\u05E4\u05E8\u05D9\u05D8"};var SD={};SD={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var CD={};CD={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele ny\xEDl gombot a men\xFC megnyit\xE1s\xE1hoz"};var kD={};kD={longPressMessage:"Premere a lungo o premere Alt + Freccia gi\xF9 per aprire il menu"};var DD={};DD={longPressMessage:"\u9577\u62BC\u3057\u307E\u305F\u306F Alt+\u4E0B\u77E2\u5370\u30AD\u30FC\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u958B\u304F"};var PD={};PD={longPressMessage:"\uAE38\uAC8C \uB204\uB974\uAC70\uB098 Alt + \uC544\uB798\uCABD \uD654\uC0B4\uD45C\uB97C \uB20C\uB7EC \uBA54\uB274 \uC5F4\uAE30"};var ED={};ED={longPressMessage:"Nor\u0117dami atidaryti meniu, nuspaud\u0119 palaikykite arba paspauskite \u201EAlt + ArrowDown\u201C."};var TD={};TD={longPressMessage:"Lai atv\u0113rtu izv\u0113lni, turiet nospiestu vai nospiediet tausti\u0146u kombin\u0101ciju Alt + lejupv\u0113rst\u0101 bulti\u0146a"};var AD={};AD={longPressMessage:"Langt trykk eller trykk Alt + PilNed for \xE5 \xE5pne menyen"};var QD={};QD={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var MD={};MD={longPressMessage:"Naci\u015Bnij i przytrzymaj lub naci\u015Bnij klawisze Alt + Strza\u0142ka w d\xF3\u0142, aby otworzy\u0107 menu"};var BD={};BD={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var RD={};RD={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var VD={};VD={longPressMessage:"Ap\u0103sa\u021Bi lung sau ap\u0103sa\u021Bi pe Alt + s\u0103geat\u0103 \xEEn jos pentru a deschide meniul"};var ND={};ND={longPressMessage:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0438\u043B\u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 Alt + \u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E"};var FD={};FD={longPressMessage:"Ponuku otvor\xEDte dlh\xFDm stla\u010Den\xEDm alebo stla\u010Den\xEDm kl\xE1vesu Alt + kl\xE1vesu so \u0161\xEDpkou nadol"};var ID={};ID={longPressMessage:"Za odprtje menija pritisnite in dr\u017Eite gumb ali pritisnite Alt+pu\u0161\u010Dica navzdol"};var LD={};LD={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var zD={};zD={longPressMessage:"H\xE5ll nedtryckt eller tryck p\xE5 Alt + pil ned\xE5t f\xF6r att \xF6ppna menyn"};var ZD={};ZD={longPressMessage:"Men\xFCy\xFC a\xE7mak i\xE7in uzun bas\u0131n veya Alt + A\u015Fa\u011F\u0131 Ok tu\u015Funa bas\u0131n"};var XD={};XD={longPressMessage:"\u0414\u043E\u0432\u0433\u043E \u0430\u0431\u043E \u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E \u043D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u043A\u043E\u043C\u0431\u0456\u043D\u0430\u0446\u0456\u044E \u043A\u043B\u0430\u0432\u0456\u0448 Alt \u0456 \u0441\u0442\u0440\u0456\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0449\u043E\u0431 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u043C\u0435\u043D\u044E"};var jD={};jD={longPressMessage:"\u957F\u6309\u6216\u6309 Alt + \u5411\u4E0B\u65B9\u5411\u952E\u4EE5\u6253\u5F00\u83DC\u5355"};var qD={};qD={longPressMessage:"\u9577\u6309\u6216\u6309 Alt+\u5411\u4E0B\u9375\u4EE5\u958B\u555F\u529F\u80FD\u8868"};var WD={};WD={"ar-AE":fD,"bg-BG":hD,"cs-CZ":pD,"da-DK":mD,"de-DE":gD,"el-GR":OD,"en-US":bD,"es-ES":yD,"et-EE":vD,"fi-FI":$D,"fr-FR":wD,"he-IL":xD,"hr-HR":SD,"hu-HU":CD,"it-IT":kD,"ja-JP":DD,"ko-KR":PD,"lt-LT":ED,"lv-LV":TD,"nb-NO":AD,"nl-NL":QD,"pl-PL":MD,"pt-BR":BD,"pt-PT":RD,"ro-RO":VD,"ru-RU":ND,"sk-SK":FD,"sl-SI":ID,"sr-SP":LD,"sv-SE":zD,"tr-TR":ZD,"uk-UA":XD,"zh-CN":jD,"zh-TW":qD};function uF(t){return t&&t.__esModule?t.default:t}u(uF,"$parcel$interopDefault$6");function YD(t,e,n){let{type:r="menu",isDisabled:i,trigger:l="press"}=t,a=Ie(),{triggerProps:o,overlayProps:s}=us({type:r},e,n),c=u(p=>{if(!i&&!(l==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(l==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},"onKeyDown"),d=Yt(uF(WD),"@react-aria/menu"),{longPressProps:f}=P3({isDisabled:i||l!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),h={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!i&&(Bt(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!i&&(Bt(p.target),e.toggle())}};return delete o.onPress,{menuTriggerProps:{...o,...l==="press"?h:f,id:a,onKeyDown:c},menuProps:{...s,"aria-labelledby":a,autoFocus:e.focusStrategy||!0,onClose:e.close}}}u(YD,"$168583247155ddda$export$dc9c12ed27dd1b49");function cF(t){return t&&t.__esModule?t.default:t}u(cF,"$parcel$interopDefault$5");function KD(t,e){let{buttonRef:n,popoverRef:r,inputRef:i,listBoxRef:l,keyboardDelegate:a,layoutDelegate:o,shouldFocusWrap:s,isReadOnly:c,isDisabled:d}=t,f=(0,wp.element.useRef)(null);n=n??f;let h=Yt(cF(tk),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:m}=YD({type:"listbox",isDisabled:d||c},e,n);Ad.set(e,{id:m.id});let{collection:g}=e,{disabledKeys:O}=e.selectionManager,b=(0,wp.element.useMemo)(()=>a||new hs({collection:g,disabledKeys:O,ref:l,layoutDelegate:o}),[a,o,g,O,l]),{collectionProps:y}=nD({selectionManager:e.selectionManager,keyboardDelegate:b,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:s,ref:i,isVirtualized:!0}),$=qc(),v=u(W=>{if(!W.nativeEvent.isComposing)switch(W.key){case"Enter":case"Tab":if(e.isOpen&&W.key==="Enter"&&W.preventDefault(),e.isOpen&&l.current&&e.selectionManager.focusedKey!=null){let Z=e.collection.getItem(e.selectionManager.focusedKey);if(Z?.props.href){let ee=l.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);W.key==="Enter"&&ee instanceof HTMLAnchorElement&&$.open(ee,W,Z.props.href,Z.props.routerOptions),e.close();break}else if(Z?.props.onAction){Z.props.onAction(),e.close();break}}e.commit();break;case"Escape":(e.selectedKey!==null||e.inputValue===""||t.allowsCustomValue)&&W.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},"onKeyDown"),S=u(W=>{var Z;let ee=n?.current&&n.current===W.relatedTarget,De=(Z=r.current)===null||Z===void 0?void 0:Z.contains(W.relatedTarget);ee||De||(t.onBlur&&t.onBlur(W),e.setFocused(!1))},"onBlur"),x=u(W=>{e.isFocused||(t.onFocus&&t.onFocus(W),e.setFocused(!0))},"onFocus"),{isInvalid:C,validationErrors:Q,validationDetails:T}=e.displayValidation,{labelProps:B,inputProps:w,descriptionProps:M,errorMessageProps:A}=si({...t,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:vr(e.isOpen&&y.onKeyDown,v,t.onKeyDown),onBlur:S,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:x,autoComplete:"off",validate:void 0,[Ar]:e},i),E=u(W=>{if(W.pointerType==="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(null,"manual")}},"onPress"),I=u(W=>{if(W.pointerType!=="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(W.pointerType==="keyboard"||W.pointerType==="virtual"?"first":null,"manual")}},"onPressStart"),D=Xn({id:p.id,"aria-label":h.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),P=Xn({id:m.id,"aria-label":h.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),R=(0,wp.element.useRef)(0),L=u(W=>{if(d||c)return;if(W.timeStamp-R.current<500){var Z;W.preventDefault(),(Z=i.current)===null||Z===void 0||Z.focus();return}let ee=W.target.getBoundingClientRect(),De=W.changedTouches[0],qt=Math.ceil(ee.left+.5*ee.width),ni=Math.ceil(ee.top+.5*ee.height);if(De.clientX===qt&&De.clientY===ni){var yr;W.preventDefault(),(yr=i.current)===null||yr===void 0||yr.focus(),e.toggle(null,"manual"),R.current=W.timeStamp}},"onTouchEnd"),k=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0;var F;let N=(F=k?.parentKey)!==null&&F!==void 0?F:null;var z;let G=(z=e.selectionManager.focusedKey)!==null&&z!==void 0?z:null,le=(0,wp.element.useRef)(N),ie=(0,wp.element.useRef)(G);(0,wp.element.useEffect)(()=>{if(jc()&&k!=null&&G!=null&&G!==ie.current){let Z=e.selectionManager.isSelected(G),ee=N!=null?e.collection.getItem(N):null,De=ee?.["aria-label"]||(typeof ee?.rendered=="string"?ee.rendered:"")||"";var W;let qt=h.format("focusAnnouncement",{isGroupChange:(W=ee&&N!==le.current)!==null&&W!==void 0?W:!1,groupTitle:De,groupCount:ee?[...Bd(ee,e.collection)].length:0,optionText:k["aria-label"]||k.textValue||"",isSelected:Z});xa(qt)}le.current=N,ie.current=G});let me=dD(e.collection),ve=(0,wp.element.useRef)(me),ce=(0,wp.element.useRef)(e.isOpen);(0,wp.element.useEffect)(()=>{let W=e.isOpen!==ce.current&&(e.selectionManager.focusedKey==null||jc());if(e.isOpen&&(W||me!==ve.current)){let Z=h.format("countAnnouncement",{optionCount:me});xa(Z)}ve.current=me,ce.current=e.isOpen});let K=(0,wp.element.useRef)(e.selectedKey);return(0,wp.element.useEffect)(()=>{if(jc()&&e.isFocused&&e.selectedItem&&e.selectedKey!==K.current){let W=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",Z=h.format("selectedAnnouncement",{optionText:W});xa(Z)}K.current=e.selectedKey}),(0,wp.element.useEffect)(()=>{if(e.isOpen)return Hg([i.current,r.current].filter(W=>W!=null))},[e.isOpen,i,r]),ym(()=>{!k&&i.current&&Ke(he(i.current))===i.current&&Tg(i.current,null)},[k]),un(l,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:B,buttonProps:{...p,...D,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:E,onPressStart:I,isDisabled:d||c},inputProps:ne(w,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?m.id:void 0,"aria-autocomplete":"list","aria-activedescendant":k?Jk(e,k.key):void 0,onTouchEnd:L,autoCorrect:"off",spellCheck:"false"}),listBoxProps:ne(m,P,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),descriptionProps:M,errorMessageProps:A,isInvalid:C,validationErrors:Q,validationDetails:T}}u(KD,"$c350ade66beef0af$export$8c18d1b4f7232bbf");var UD={};UD={calendar:"\u0627\u0644\u062A\u0642\u0648\u064A\u0645",day:"\u064A\u0648\u0645",dayPeriod:"\u0635/\u0645",endDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621",era:"\u0627\u0644\u0639\u0635\u0631",hour:"\u0627\u0644\u0633\u0627\u0639\u0627\u062A",minute:"\u0627\u0644\u062F\u0642\u0627\u0626\u0642",month:"\u0627\u0644\u0634\u0647\u0631",second:"\u0627\u0644\u062B\u0648\u0627\u0646\u064A",selectedDateDescription:t=>`\u062A\u0627\u0631\u064A\u062E \u0645\u062D\u062F\u062F: ${t.date}`,selectedRangeDescription:t=>`\u0627\u0644\u0645\u062F\u0649 \u0627\u0644\u0632\u0645\u0646\u064A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.startDate} \u0625\u0644\u0649 ${t.endDate}`,selectedTimeDescription:t=>`\u0627\u0644\u0648\u0642\u062A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.time}`,startDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621",timeZoneName:"\u0627\u0644\u062A\u0648\u0642\u064A\u062A",weekday:"\u0627\u0644\u064A\u0648\u0645",year:"\u0627\u0644\u0633\u0646\u0629"};var GD={};GD={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D",dayPeriod:"\u043F\u0440.\u043E\u0431./\u0441\u043B.\u043E\u0431.",endDate:"\u041A\u0440\u0430\u0439\u043D\u0430 \u0434\u0430\u0442\u0430",era:"\u0435\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u0434\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u043E \u0432\u0440\u0435\u043C\u0435: ${t.time}`,startDate:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430 \u0434\u0430\u0442\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0435\u043D \u043E\u0442 \u0441\u0435\u0434\u043C\u0438\u0446\u0430\u0442\u0430",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var _D={};_D={calendar:"Kalend\xE1\u0159",day:"den",dayPeriod:"\u010D\xE1st dne",endDate:"Kone\u010Dn\xE9 datum",era:"letopo\u010Det",hour:"hodina",minute:"minuta",month:"m\u011Bs\xEDc",second:"sekunda",selectedDateDescription:t=>`Vybran\xE9 datum: ${t.date}`,selectedRangeDescription:t=>`Vybran\xE9 obdob\xED: ${t.startDate} a\u017E ${t.endDate}`,selectedTimeDescription:t=>`Vybran\xFD \u010Das: ${t.time}`,startDate:"Po\u010D\xE1te\u010Dn\xED datum",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"den v t\xFDdnu",year:"rok"};var HD={};HD={calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xE6ra",hour:"time",minute:"minut",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt interval: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tidspunkt: ${t.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xE5r"};var JD={};JD={calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xE4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:t=>`Ausgew\xE4hltes Datum: ${t.date}`,selectedRangeDescription:t=>`Ausgew\xE4hlter Bereich: ${t.startDate} bis ${t.endDate}`,selectedTimeDescription:t=>`Ausgew\xE4hlte Zeit: ${t.time}`,startDate:"Startdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"};var e2={};e2={calendar:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BB\u03CC\u03B3\u03B9\u03BF",day:"\u03B7\u03BC\u03AD\u03C1\u03B1",dayPeriod:"\u03C0.\u03BC./\u03BC.\u03BC.",endDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2",era:"\u03C0\u03B5\u03C1\u03AF\u03BF\u03B4\u03BF\u03C2",hour:"\u03CE\u03C1\u03B1",minute:"\u03BB\u03B5\u03C0\u03C4\u03CC",month:"\u03BC\u03AE\u03BD\u03B1\u03C2",second:"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03BF",selectedDateDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1: ${t.date}`,selectedRangeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03BF \u03B5\u03CD\u03C1\u03BF\u03C2: ${t.startDate} \u03AD\u03C9\u03C2 ${t.endDate}`,selectedTimeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03CE\u03C1\u03B1: ${t.time}`,startDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2",timeZoneName:"\u03B6\u03CE\u03BD\u03B7 \u03CE\u03C1\u03B1\u03C2",weekday:"\u03BA\u03B1\u03B8\u03B7\u03BC\u03B5\u03C1\u03B9\u03BD\u03AE",year:"\u03AD\u03C4\u03BF\u03C2"};var t2={};t2={era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:t=>`Selected Date: ${t.date}`,selectedRangeDescription:t=>`Selected Range: ${t.startDate} to ${t.endDate}`,selectedTimeDescription:t=>`Selected Time: ${t.time}`};var n2={};n2={calendar:"Calendario",day:"d\xEDa",dayPeriod:"a.\xA0m./p.\xA0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:t=>`Fecha seleccionada: ${t.date}`,selectedRangeDescription:t=>`Rango seleccionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora seleccionada: ${t.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xEDa de la semana",year:"a\xF1o"};var r2={};r2={calendar:"Kalender",day:"p\xE4ev",dayPeriod:"enne/p\xE4rast l\xF5unat",endDate:"L\xF5ppkuup\xE4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:t=>`Valitud kuup\xE4ev: ${t.date}`,selectedRangeDescription:t=>`Valitud vahemik: ${t.startDate} kuni ${t.endDate}`,selectedTimeDescription:t=>`Valitud aeg: ${t.time}`,startDate:"Alguskuup\xE4ev",timeZoneName:"ajav\xF6\xF6nd",weekday:"n\xE4dalap\xE4ev",year:"aasta"};var i2={};i2={calendar:"Kalenteri",day:"p\xE4iv\xE4",dayPeriod:"vuorokaudenaika",endDate:"P\xE4\xE4ttymisp\xE4iv\xE4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:t=>`Valittu p\xE4iv\xE4m\xE4\xE4r\xE4: ${t.date}`,selectedRangeDescription:t=>`Valittu aikav\xE4li: ${t.startDate} \u2013 ${t.endDate}`,selectedTimeDescription:t=>`Valittu aika: ${t.time}`,startDate:"Alkamisp\xE4iv\xE4",timeZoneName:"aikavy\xF6hyke",weekday:"viikonp\xE4iv\xE4",year:"vuosi"};var l2={};l2={calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xE8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:t=>`Date s\xE9lectionn\xE9e\xA0: ${t.date}`,selectedRangeDescription:t=>`Plage s\xE9lectionn\xE9e\xA0: ${t.startDate} au ${t.endDate}`,selectedTimeDescription:t=>`Heure choisie\xA0: ${t.time}`,startDate:"Date de d\xE9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xE9e"};var a2={};a2={calendar:"\u05DC\u05D5\u05D7 \u05E9\u05E0\u05D4",day:"\u05D9\u05D5\u05DD",dayPeriod:"\u05DC\u05E4\u05E0\u05D4\u05F4\u05E6/\u05D0\u05D7\u05D4\u05F4\u05E6",endDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05E1\u05D9\u05D5\u05DD",era:"\u05EA\u05E7\u05D5\u05E4\u05D4",hour:"\u05E9\u05E2\u05D4",minute:"\u05D3\u05E7\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",second:"\u05E9\u05E0\u05D9\u05D9\u05D4",selectedDateDescription:t=>`\u05EA\u05D0\u05E8\u05D9\u05DA \u05E0\u05D1\u05D7\u05E8: ${t.date}`,selectedRangeDescription:t=>`\u05D8\u05D5\u05D5\u05D7 \u05E0\u05D1\u05D7\u05E8: ${t.startDate} \u05E2\u05D3 ${t.endDate}`,selectedTimeDescription:t=>`\u05D6\u05DE\u05DF \u05E0\u05D1\u05D7\u05E8: ${t.time}`,startDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05EA\u05D7\u05DC\u05D4",timeZoneName:"\u05D0\u05D6\u05D5\u05E8 \u05D6\u05DE\u05DF",weekday:"\u05D9\u05D5\u05DD \u05D1\u05E9\u05D1\u05D5\u05E2",year:"\u05E9\u05E0\u05D4"};var o2={};o2={calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum zavr\u0161etka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:t=>`Odabrani datum: ${t.date}`,selectedRangeDescription:t=>`Odabrani raspon: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Odabrano vrijeme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"};var s2={};s2={calendar:"Napt\xE1r",day:"nap",dayPeriod:"napszak",endDate:"Befejez\u0151 d\xE1tum",era:"\xE9ra",hour:"\xF3ra",minute:"perc",month:"h\xF3nap",second:"m\xE1sodperc",selectedDateDescription:t=>`Kijel\xF6lt d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Kijel\xF6lt tartom\xE1ny: ${t.startDate}\u2013${t.endDate}`,selectedTimeDescription:t=>`Kijel\xF6lt id\u0151: ${t.time}`,startDate:"Kezd\u0151 d\xE1tum",timeZoneName:"id\u0151z\xF3na",weekday:"h\xE9t napja",year:"\xE9v"};var u2={};u2={calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:t=>`Data selezionata: ${t.date}`,selectedRangeDescription:t=>`Intervallo selezionato: da ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Ora selezionata: ${t.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"};var c2={};c2={calendar:"\u30AB\u30EC\u30F3\u30C0\u30FC",day:"\u65E5",dayPeriod:"\u5348\u524D/\u5348\u5F8C",endDate:"\u7D42\u4E86\u65E5",era:"\u6642\u4EE3",hour:"\u6642",minute:"\u5206",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u629E\u3057\u305F\u65E5\u4ED8 : ${t.date}`,selectedRangeDescription:t=>`\u9078\u629E\u7BC4\u56F2 : ${t.startDate} \u304B\u3089 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u629E\u3057\u305F\u6642\u9593 : ${t.time}`,startDate:"\u958B\u59CB\u65E5",timeZoneName:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3",weekday:"\u66DC\u65E5",year:"\u5E74"};var d2={};d2={calendar:"\uB2EC\uB825",day:"\uC77C",dayPeriod:"\uC624\uC804/\uC624\uD6C4",endDate:"\uC885\uB8CC\uC77C",era:"\uC5F0\uD638",hour:"\uC2DC",minute:"\uBD84",month:"\uC6D4",second:"\uCD08",selectedDateDescription:t=>`\uC120\uD0DD \uC77C\uC790: ${t.date}`,selectedRangeDescription:t=>`\uC120\uD0DD \uBC94\uC704: ${t.startDate} ~ ${t.endDate}`,selectedTimeDescription:t=>`\uC120\uD0DD \uC2DC\uAC04: ${t.time}`,startDate:"\uC2DC\uC791\uC77C",timeZoneName:"\uC2DC\uAC04\uB300",weekday:"\uC694\uC77C",year:"\uB144"};var f2={};f2={calendar:"Kalendorius",day:"diena",dayPeriod:"iki piet\u0173 / po piet\u0173",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minut\u0117",month:"m\u0117nuo",second:"sekund\u0117",selectedDateDescription:t=>`Pasirinkta data: ${t.date}`,selectedRangeDescription:t=>`Pasirinktas intervalas: nuo ${t.startDate} iki ${t.endDate}`,selectedTimeDescription:t=>`Pasirinktas laikas: ${t.time}`,startDate:"Prad\u017Eios data",timeZoneName:"laiko juosta",weekday:"savait\u0117s diena",year:"metai"};var h2={};h2={calendar:"Kalend\u0101rs",day:"diena",dayPeriod:"priek\u0161pusdien\u0101/p\u0113cpusdien\u0101",endDate:"Beigu datums",era:"\u0113ra",hour:"stundas",minute:"min\u016Btes",month:"m\u0113nesis",second:"sekundes",selectedDateDescription:t=>`Atlas\u012Btais datums: ${t.date}`,selectedRangeDescription:t=>`Atlas\u012Btais diapazons: no ${t.startDate} l\u012Bdz ${t.endDate}`,selectedTimeDescription:t=>`Atlas\u012Btais laiks: ${t.time}`,startDate:"S\u0101kuma datums",timeZoneName:"laika josla",weekday:"ned\u0113\u013Cas diena",year:"gads"};var p2={};p2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt omr\xE5de: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tid: ${t.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xE5r"};var m2={};m2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:t=>`Geselecteerde datum: ${t.date}`,selectedRangeDescription:t=>`Geselecteerd bereik: ${t.startDate} tot ${t.endDate}`,selectedTimeDescription:t=>`Geselecteerde tijd: ${t.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"};var g2={};g2={calendar:"Kalendarz",day:"dzie\u0144",dayPeriod:"rano / po po\u0142udniu / wieczorem",endDate:"Data ko\u0144cowa",era:"era",hour:"godzina",minute:"minuta",month:"miesi\u0105c",second:"sekunda",selectedDateDescription:t=>`Wybrana data: ${t.date}`,selectedRangeDescription:t=>`Wybrany zakres: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Wybrany czas: ${t.time}`,startDate:"Data pocz\u0105tkowa",timeZoneName:"strefa czasowa",weekday:"dzie\u0144 tygodnia",year:"rok"};var O2={};O2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var b2={};b2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xE9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data de In\xEDcio",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var y2={};y2={calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dat\u0103 final",era:"er\u0103",hour:"or\u0103",minute:"minut",month:"lun\u0103",second:"secund\u0103",selectedDateDescription:t=>`Dat\u0103 selectat\u0103: ${t.date}`,selectedRangeDescription:t=>`Interval selectat: de la ${t.startDate} p\xE2n\u0103 la ${t.endDate}`,selectedTimeDescription:t=>`Ora selectat\u0103: ${t.time}`,startDate:"Dat\u0103 \xEEnceput",timeZoneName:"fus orar",weekday:"ziua din s\u0103pt\u0103m\xE2n\u0103",year:"an"};var v2={};v2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C",day:"\u0434\u0435\u043D\u044C",dayPeriod:"AM/PM",endDate:"\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",era:"\u044D\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u044F\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: \u0441 ${t.startDate} \u043F\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u043D\u0435\u0434\u0435\u043B\u0438",year:"\u0433\u043E\u0434"};var $2={};$2={calendar:"Kalend\xE1r",day:"de\u0148",dayPeriod:"AM/PM",endDate:"D\xE1tum ukon\u010Denia",era:"letopo\u010Det",hour:"hodina",minute:"min\xFAta",month:"mesiac",second:"sekunda",selectedDateDescription:t=>`Vybrat\xFD d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Vybrat\xFD rozsah: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Vybrat\xFD \u010Das: ${t.time}`,startDate:"D\xE1tum za\u010Datia",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"de\u0148 t\xFD\u017Ed\u0148a",year:"rok"};var w2={};w2={calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:t=>`Izbrani datum: ${t.date}`,selectedRangeDescription:t=>`Izbrano obmo\u010Dje: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izbrani \u010Das: ${t.time}`,startDate:"Datum za\u010Detka",timeZoneName:"\u010Dasovni pas",weekday:"dan v tednu",year:"leto"};var x2={};x2={calendar:"Kalendar",day:"\u0434\u0430\u043D",dayPeriod:"\u043F\u0440\u0435 \u043F\u043E\u0434\u043D\u0435/\u043F\u043E \u043F\u043E\u0434\u043D\u0435",endDate:"Datum zavr\u0161etka",era:"\u0435\u0440\u0430",hour:"\u0441\u0430\u0442",minute:"\u043C\u0438\u043D\u0443\u0442",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434",selectedDateDescription:t=>`Izabrani datum: ${t.date}`,selectedRangeDescription:t=>`Izabrani opseg: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izabrano vreme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"\u0432\u0440\u0435\u043C\u0435\u043D\u0441\u043A\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0430\u043D \u0443 \u043D\u0435\u0434\u0435\u0459\u0438",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var S2={};S2={calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xE5nad",second:"sekund",selectedDateDescription:t=>`Valt datum: ${t.date}`,selectedRangeDescription:t=>`Valt intervall: ${t.startDate} till ${t.endDate}`,selectedTimeDescription:t=>`Vald tid: ${t.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xE5r"};var C2={};C2={calendar:"Takvim",day:"g\xFCn",dayPeriod:"\xD6\xD6/\xD6S",endDate:"Biti\u015F Tarihi",era:"\xE7a\u011F",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:t=>`Se\xE7ilen Tarih: ${t.date}`,selectedRangeDescription:t=>`Se\xE7ilen Aral\u0131k: ${t.startDate} - ${t.endDate}`,selectedTimeDescription:t=>`Se\xE7ilen Zaman: ${t.time}`,startDate:"Ba\u015Flang\u0131\xE7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftan\u0131n g\xFCn\xFC",year:"y\u0131l"};var k2={};k2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D\u044C",dayPeriod:"\u0434\u043F/\u043F\u043F",endDate:"\u0414\u0430\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F",era:"\u0435\u0440\u0430",hour:"\u0433\u043E\u0434\u0438\u043D\u0430",minute:"\u0445\u0432\u0438\u043B\u0438\u043D\u0430",month:"\u043C\u0456\u0441\u044F\u0446\u044C",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u2014 ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0447\u0430\u0441: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0438\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u0442\u0438\u0436\u043D\u044F",year:"\u0440\u0456\u043A"};var D2={};D2={calendar:"\u65E5\u5386",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7ED3\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9009\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9009\u5B9A\u7684\u8303\u56F4\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9009\u5B9A\u7684\u65F6\u95F4\uFF1A${t.time}`,startDate:"\u5F00\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var P2={};P2={calendar:"\u65E5\u66C6",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7D50\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9078\u5B9A\u7684\u7BC4\u570D\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u5B9A\u7684\u6642\u9593\uFF1A${t.time}`,startDate:"\u958B\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var ps={};ps={"ar-AE":UD,"bg-BG":GD,"cs-CZ":_D,"da-DK":HD,"de-DE":JD,"el-GR":e2,"en-US":t2,"es-ES":n2,"et-EE":r2,"fi-FI":i2,"fr-FR":l2,"he-IL":a2,"hr-HR":o2,"hu-HU":s2,"it-IT":u2,"ja-JP":c2,"ko-KR":d2,"lt-LT":f2,"lv-LV":h2,"nb-NO":p2,"nl-NL":m2,"pl-PL":g2,"pt-BR":O2,"pt-PT":b2,"ro-RO":y2,"ru-RU":v2,"sk-SK":$2,"sl-SI":w2,"sr-SP":x2,"sv-SE":S2,"tr-TR":C2,"uk-UA":k2,"zh-CN":D2,"zh-TW":P2};function r0(t,e,n){let{direction:r}=Re(),i=(0,wp.element.useMemo)(()=>wd(e),[e]),l=u(s=>{if(s.currentTarget.contains(s.target)&&(s.altKey&&(s.key==="ArrowDown"||s.key==="ArrowUp")&&"setOpen"in t&&(s.preventDefault(),s.stopPropagation(),t.setOpen(!0)),!n))switch(s.key){case"ArrowLeft":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=E2(e.current,c.getBoundingClientRect().left,-1);d&&d.focus()}}else i.focusPrevious();break;case"ArrowRight":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=E2(e.current,c.getBoundingClientRect().left,1);d&&d.focus()}}else i.focusNext();break}},"onKeyDown"),a=u(()=>{var s;if(!e.current)return;let c=(s=window.event)===null||s===void 0?void 0:s.target,d=ut(e.current,{tabbable:!0});if(c&&(d.currentNode=c,c=d.previousNode()),!c){let f;do f=d.lastChild(),f&&(c=f);while(f)}for(;c?.hasAttribute("data-placeholder");){let f=d.previousNode();if(f&&f.hasAttribute("data-placeholder"))c=f;else break}c&&c.focus()},"focusLast"),{pressProps:o}=jn({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(s){s.pointerType==="mouse"&&a()},onPress(s){(s.pointerType==="touch"||s.pointerType==="pen")&&a()}});return ne(o,{onKeyDown:l})}u(r0,"$3dfb0f96be0d6a08$export$4a931266a3838b86");function E2(t,e,n){let r=ut(t,{tabbable:!0}),i=r.nextNode(),l=null,a=1/0;for(;i;){let s=i.getBoundingClientRect().left-e,c=Math.abs(s);Math.sign(s)===n&&c{var w;e.confirmPlaceholder(),e.value!==f.current&&e.commitValidation(),(w=t.onBlur)===null||w===void 0||w.call(t,B)},onFocusWithinChange:t.onFocusChange}),p=Yt(dF(ps),"@react-aria/datepicker"),m=e.maxGranularity==="hour"?"selectedTimeDescription":"selectedDateDescription",g=e.maxGranularity==="hour"?"time":"date",O=e.value?p.format(m,{[g]:e.formatValue({month:"long"})}):"",b=Fo(O),y=t[ms]==="presentation"?s["aria-describedby"]:[b["aria-describedby"],s["aria-describedby"]].filter(Boolean).join(" ")||void 0,$=t[A2],v=(0,wp.element.useMemo)(()=>$||wd(n),[$,n]),S=r0(e,n,t[ms]==="presentation");T2.set(e,{ariaLabel:t["aria-label"],ariaLabelledBy:[o.id,t["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:y,focusManager:v});let x=(0,wp.element.useRef)(t.autoFocus),C;t[ms]==="presentation"?C={role:"presentation"}:C=ne(s,{role:"group","aria-disabled":t.isDisabled||void 0,"aria-describedby":y}),(0,wp.element.useEffect)(()=>{x.current&&v.focusFirst(),x.current=!1},[v]),Sr(t.inputRef,e.defaultValue,e.setValue),as({...t,focus(){v.focusFirst()}},e,t.inputRef);let Q={type:"hidden",name:t.name,form:t.form,value:((r=e.value)===null||r===void 0?void 0:r.toString())||"",disabled:t.isDisabled};t.validationBehavior==="native"&&(Q.type="text",Q.hidden=!0,Q.required=t.isRequired,Q.onChange=()=>{});let T=yt(t);return{labelProps:{...o,onClick:()=>{v.focusFirst()}},fieldProps:ne(T,C,S,h,{onKeyDown(B){t.onKeyDown&&t.onKeyDown(B)},onKeyUp(B){t.onKeyUp&&t.onKeyUp(B)},style:{unicodeBidi:"isolate"}}),inputProps:Q,descriptionProps:c,errorMessageProps:d,isInvalid:i,validationErrors:l,validationDetails:a}}u(Q2,"$16f0b7bb276bc17e$export$5591b0b878c1a989");function fF(t,e,n){var r;let i=Q2(t,e,n);return i.inputProps.value=((r=e.timeValue)===null||r===void 0?void 0:r.toString())||"",i}u(fF,"$16f0b7bb276bc17e$export$4c842f6a241dc825");function hF(t){return t&&t.__esModule?t.default:t}u(hF,"$parcel$interopDefault$3");function pF(t,e,n){let r=Ie(),i=Ie(),l=Ie(),a=Yt(hF(ps),"@react-aria/datepicker"),{isInvalid:o,validationErrors:s,validationDetails:c}=e.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:h,errorMessageProps:p}=$t({...t,labelElementType:"span",isInvalid:o,errorMessage:t.errorMessage||s}),m=r0(e,n),g=f["aria-labelledby"]||f.id,{locale:O}=Re(),b=e.formatValue(O,{month:"long"}),y=b?a.format("selectedDateDescription",{date:b}):"",$=Fo(y),v=[$["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,S=yt(t),x=(0,wp.element.useMemo)(()=>wd(n),[n]),C=(0,wp.element.useRef)(!1),{focusWithinProps:Q}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:T=>{let B=document.getElementById(i);if(!B?.contains(T.relatedTarget)){var w,M;C.current=!1,(w=t.onBlur)===null||w===void 0||w.call(t,T),(M=t.onFocusChange)===null||M===void 0||M.call(t,!1)}},onFocusWithin:T=>{if(!C.current){var B,w;C.current=!0,(B=t.onFocus)===null||B===void 0||B.call(t,T),(w=t.onFocusChange)===null||w===void 0||w.call(t,!0)}}});return{groupProps:ne(S,m,f,$,Q,{role:"group","aria-disabled":t.isDisabled||null,"aria-labelledby":g,"aria-describedby":v,onKeyDown(T){e.isOpen||t.onKeyDown&&t.onKeyDown(T)},onKeyUp(T){e.isOpen||t.onKeyUp&&t.onKeyUp(T)}}),labelProps:{...d,onClick:()=>{x.focusFirst()}},fieldProps:{...f,id:l,[ms]:"presentation","aria-describedby":v,value:e.value,defaultValue:e.defaultValue,onChange:e.setValue,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,granularity:t.granularity,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior,[Ar]:e,autoFocus:t.autoFocus,name:t.name,form:t.form},descriptionProps:h,errorMessageProps:p,buttonProps:{...$,id:r,"aria-haspopup":"dialog","aria-label":a.format("calendar"),"aria-labelledby":`${r} ${g}`,"aria-describedby":v,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:i,"aria-labelledby":`${r} ${g}`},calendarProps:{autoFocus:!0,value:e.dateValue,onChange:e.setDateValue,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,defaultFocusedValue:e.dateValue?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:o,validationErrors:s,validationDetails:c}}u(pF,"$6057a3d2a53a12fd$export$42df105a73306d51");function mF(t){return t&&t.__esModule?t.default:t}u(mF,"$parcel$interopDefault$2");function gF(){let{locale:t}=Re(),e=B3(mF(ps),"@react-aria/datepicker");return(0,wp.element.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new i0(t,e)}},[t,e])}u(gF,"$3aeceb3a64eb8358$export$d42c60378c8168f8");const xv=class xv{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,n){this.locale=e,this.dictionary=n}};u(xv,"$3aeceb3a64eb8358$var$DisplayNamesPolyfill");let i0=xv;function OF(t,e,n){let r=(0,wp.element.useRef)(""),{locale:i,direction:l}=Re(),a=gF(),{ariaLabel:o,ariaLabelledBy:s,ariaDescribedBy:c,focusManager:d}=T2.get(e),f=t.isPlaceholder?"":t.text,h=(0,wp.element.useMemo)(()=>e.dateFormatter.resolvedOptions(),[e.dateFormatter]),p=qn({month:"long",timeZone:h.timeZone}),m=qn({hour:"numeric",hour12:h.hour12,timeZone:h.timeZone});if(t.type==="month"&&!t.isPlaceholder){let k=p.format(e.dateValue);f=k!==f?`${f} \u2013 ${k}`:k}else t.type==="hour"&&!t.isPlaceholder&&(f=m.format(e.dateValue));let{spinButtonProps:g}=jg({value:t.value,textValue:f,minValue:t.minValue,maxValue:t.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly||!t.isEditable,isRequired:e.isRequired,onIncrement:()=>{r.current="",e.increment(t.type)},onDecrement:()=>{r.current="",e.decrement(t.type)},onIncrementPage:()=>{r.current="",e.incrementPage(t.type)},onDecrementPage:()=>{r.current="",e.decrementPage(t.type)},onIncrementToMax:()=>{r.current="",t.maxValue!==void 0&&e.setSegment(t.type,t.maxValue)},onDecrementToMin:()=>{r.current="",t.minValue!==void 0&&e.setSegment(t.type,t.minValue)}}),O=(0,wp.element.useMemo)(()=>new es(i,{maximumFractionDigits:0}),[i]),b=u(()=>{if(t.text===t.placeholder&&d.focusPrevious(),O.isValidPartialNumber(t.text)&&!e.isReadOnly&&!t.isPlaceholder){let k=t.text.slice(0,-1),F=O.parse(k);k=F===0?"":k,k.length===0||F===0?e.clearSegment(t.type):e.setSegment(t.type,F),r.current=k}else t.type==="dayPeriod"&&e.clearSegment(t.type)},"backspace"),y=u(k=>{if(k.key==="a"&&(wr()?k.metaKey:k.ctrlKey)&&k.preventDefault(),!(k.ctrlKey||k.metaKey||k.shiftKey||k.altKey))switch(k.key){case"Backspace":case"Delete":k.preventDefault(),k.stopPropagation(),b();break}},"onKeyDown"),{startsWith:$}=Cg({sensitivity:"base"}),v=qn({hour:"numeric",hour12:!0}),S=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(0),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),x=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(12),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),C=qn({year:"numeric",era:"narrow",timeZone:"UTC"}),Q=(0,wp.element.useMemo)(()=>{if(t.type!=="era")return[];let k=Ne(new Fe(1,1,1),e.calendar),F=e.calendar.getEras().map(z=>{let G=k.set({year:1,month:1,day:1,era:z}).toDate("UTC"),ie=C.formatToParts(G).find(me=>me.type==="era").value;return{era:z,formatted:ie}}),N=bF(F.map(z=>z.formatted));if(N)for(let z of F)z.formatted=z.formatted.slice(N);return F},[C,e.calendar,t.type]),T=u(k=>{if(e.isDisabled||e.isReadOnly)return;let F=r.current+k;switch(t.type){case"dayPeriod":if($(S,k))e.setSegment("dayPeriod",0);else if($(x,k))e.setSegment("dayPeriod",12);else break;d.focusNext();break;case"era":{let N=Q.find(z=>$(z.formatted,k));N&&(e.setSegment("era",N.era),d.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!O.isValidPartialNumber(F))return;let N=O.parse(F),z=N,G=t.minValue===0;if(t.type==="hour"&&e.dateFormatter.resolvedOptions().hour12){switch(e.dateFormatter.resolvedOptions().hourCycle){case"h11":N>11&&(z=O.parse(k));break;case"h12":G=!1,N>12&&(z=O.parse(k));break}t.value!==void 0&&t.value>=12&&N>1&&(N+=12)}else t.maxValue!==void 0&&N>t.maxValue&&(z=O.parse(k));if(isNaN(N))return;let le=z!==0||G;le&&e.setSegment(t.type,z),t.maxValue!==void 0&&(+(N+"0")>t.maxValue||F.length>=String(t.maxValue).length)?(r.current="",le&&d.focusNext()):r.current=F;break}}},"onInput"),B=u(()=>{r.current="",n.current&&Yc(n.current,{containingElement:Wc(n.current)});let k=window.getSelection();k?.collapse(n.current)},"onFocus"),w=(0,wp.element.useRef)(typeof document<"u"?document:null);un(w,"selectionchange",()=>{var k;let F=window.getSelection();F?.anchorNode&&(!((k=n.current)===null||k===void 0)&&k.contains(F?.anchorNode))&&F.collapse(n.current)});let M=(0,wp.element.useRef)("");un(n,"beforeinput",k=>{if(n.current)switch(k.preventDefault(),k.inputType){case"deleteContentBackward":case"deleteContentForward":O.isValidPartialNumber(t.text)&&!e.isReadOnly&&b();break;case"insertCompositionText":M.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:k.data!=null&&T(k.data);break}}),un(n,"input",k=>{let{inputType:F,data:N}=k;switch(F){case"insertCompositionText":n.current&&(n.current.textContent=M.current),N!=null&&($(S,N)||$(x,N))&&T(N);break}}),Pe(()=>{let k=n.current;return()=>{document.activeElement===k&&(d.focusPrevious()||d.focusNext())}},[n,d]);let A=ji()||t.type==="timeZoneName"?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{},E=(0,wp.element.useMemo)(()=>e.segments.find(k=>k.isEditable),[e.segments]);t!==E&&!e.isInvalid&&(c=void 0);let I=Ie(),D=!e.isDisabled&&!e.isReadOnly&&t.isEditable,P=t.type==="literal"?"":a.of(t.type),R=Xn({"aria-label":`${P}${o?`, ${o}`:""}${s?", ":""}`,"aria-labelledby":s});if(t.type==="literal")return{segmentProps:{"aria-hidden":!0}};let L={caretColor:"transparent"};if(l==="rtl"){L.unicodeBidi="embed";let k=h[t.type];(k==="numeric"||k==="2-digit")&&(L.direction="ltr")}return{segmentProps:ne(g,R,{id:I,...A,"aria-invalid":e.isInvalid?"true":void 0,"aria-describedby":c,"aria-readonly":e.isReadOnly||!t.isEditable?"true":void 0,"data-placeholder":t.isPlaceholder||void 0,contentEditable:D,suppressContentEditableWarning:D,spellCheck:D?"false":void 0,autoCorrect:D?"off":void 0,[parseInt(wp.element.version,10)>=17?"enterKeyHint":"enterkeyhint"]:D?"next":void 0,inputMode:e.isDisabled||t.type==="dayPeriod"||t.type==="era"||!D?void 0:"numeric",tabIndex:e.isDisabled?void 0:0,onKeyDown:y,onFocus:B,style:L,onPointerDown(k){k.stopPropagation()},onMouseDown(k){k.stopPropagation()}})}}u(OF,"$32489daedd52963e$export$1315d136e6f7581");function bF(t){t.sort();let e=t[0],n=t[t.length-1];for(let r=0;rwd(n,{accept:k=>k.id!==C}),[n,C]),M={[A2]:w,[ms]:"presentation","aria-describedby":B,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,granularity:t.granularity,shouldForceLeadingZeros:t.shouldForceLeadingZeros,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior},A=yt(t),E=(0,wp.element.useRef)(!1),{focusWithinProps:I}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:k=>{let F=document.getElementById(Q);if(!F?.contains(k.relatedTarget)){var N,z;E.current=!1,(N=t.onBlur)===null||N===void 0||N.call(t,k),(z=t.onFocusChange)===null||z===void 0||z.call(t,!1)}},onFocusWithin:k=>{if(!E.current){var F,N;E.current=!0,(F=t.onFocus)===null||F===void 0||F.call(t,k),(N=t.onFocusChange)===null||N===void 0||N.call(t,!0)}}}),D=(0,wp.element.useRef)(tl),P=(0,wp.element.useRef)(tl);var R,L;return{groupProps:ne(A,T,p,v,I,{role:"group","aria-disabled":t.isDisabled||null,"aria-describedby":B,onKeyDown(k){e.isOpen||t.onKeyDown&&t.onKeyDown(k)},onKeyUp(k){e.isOpen||t.onKeyUp&&t.onKeyUp(k)}}),labelProps:{...h,onClick:()=>{w.focusFirst()}},buttonProps:{...v,id:C,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${C} ${O}`,"aria-describedby":B,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:Q,"aria-labelledby":`${C} ${O}`},startFieldProps:{...S,...M,value:(R=(r=e.value)===null||r===void 0?void 0:r.start)!==null&&R!==void 0?R:null,defaultValue:(i=e.defaultValue)===null||i===void 0?void 0:i.start,onChange:k=>e.setDateTime("start",k),autoFocus:t.autoFocus,name:t.startName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){D.current=k,e.updateValidation(Sd(k,P.current))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},endFieldProps:{...x,...M,value:(L=(l=e.value)===null||l===void 0?void 0:l.end)!==null&&L!==void 0?L:null,defaultValue:(a=e.defaultValue)===null||a===void 0?void 0:a.end,onChange:k=>e.setDateTime("end",k),name:t.endName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){P.current=k,e.updateValidation(Sd(D.current,k))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},descriptionProps:m,errorMessageProps:g,calendarProps:{autoFocus:!0,value:!((o=e.dateRange)===null||o===void 0)&&o.start&&e.dateRange.end?e.dateRange:null,onChange:e.setDateRange,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,allowsNonContiguousRanges:t.allowsNonContiguousRanges,defaultFocusedValue:e.dateRange?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:c,validationErrors:d,validationDetails:f}}u(M2,"$887cac91b7cc8801$export$12fd5f0e9f4bb192");function vF(t,e){let{role:n="dialog"}=t,r=ca();r=t["aria-label"]?void 0:r;let i=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{if(e.current&&!e.current.contains(document.activeElement)){Ui(e.current);let l=setTimeout(()=>{(document.activeElement===e.current||document.activeElement===document.body)&&(i.current=!0,e.current&&(e.current.blur(),Ui(e.current)),i.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),Hk(),{dialogProps:{...yt(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{i.current&&l.stopPropagation()}},titleProps:{id:r}}}u(vF,"$40df3f8667284809$export$d55e7ee900f34e93");var l0=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};function B2(){throw new Error("setTimeout has not been defined")}u(B2,"defaultSetTimout");function R2(){throw new Error("clearTimeout has not been defined")}u(R2,"defaultClearTimeout");var ui=B2,ci=R2;typeof l0.setTimeout=="function"&&(ui=setTimeout),typeof l0.clearTimeout=="function"&&(ci=clearTimeout);function V2(t){if(ui===setTimeout)return setTimeout(t,0);if((ui===B2||!ui)&&setTimeout)return ui=setTimeout,setTimeout(t,0);try{return ui(t,0)}catch{try{return ui.call(null,t,0)}catch{return ui.call(this,t,0)}}}u(V2,"runTimeout");function $F(t){if(ci===clearTimeout)return clearTimeout(t);if((ci===R2||!ci)&&clearTimeout)return ci=clearTimeout,clearTimeout(t);try{return ci(t)}catch{try{return ci.call(null,t)}catch{return ci.call(this,t)}}}u($F,"runClearTimeout");var Mr=[],Ea=!1,nl,Rd=-1;function wF(){!Ea||!nl||(Ea=!1,nl.length?Mr=nl.concat(Mr):Rd=-1,Mr.length&&N2())}u(wF,"cleanUpNextTick");function N2(){if(!Ea){var t=V2(wF);Ea=!0;for(var e=Mr.length;e;){for(nl=Mr,Mr=[];++Rd1)for(var n=1;n{I.stopPropagation(),e.setSelectedValue(r)},"onChange"),{pressProps:y,isPressed:$}=jn({onPressStart:o,onPressEnd:s,onPressChange:c,onPress:d,onPressUp:f,onClick:h,isDisabled:p}),{pressProps:v,isPressed:S}=jn({onPressStart:o,onPressEnd:s,onPressChange:c,onPressUp:f,onClick:h,isDisabled:p,onPress(I){var D;d?.(I),e.setSelectedValue(r),(D=n.current)===null||D===void 0||D.focus()}}),{focusableProps:x}=Xo(ne(t,{onFocus:()=>e.setLastFocusedValue(r)}),n),C=ne(y,x),Q=yt(t,{labelable:!0}),T=-1;e.selectedValue!=null?e.selectedValue===r&&(T=0):(e.lastFocusedValue===r||e.lastFocusedValue==null)&&(T=0),p&&(T=void 0);let{name:B,form:w,descriptionId:M,errorMessageId:A,validationBehavior:E}=I2.get(e);return Sr(n,e.defaultSelectedValue,e.setSelectedValue),as({validationBehavior:E},e,n),{labelProps:ne(v,(0,wp.element.useMemo)(()=>({onClick:I=>I.preventDefault(),onMouseDown:I=>I.preventDefault()}),[])),inputProps:ne(Q,{...C,type:"radio",name:B,form:w,tabIndex:T,disabled:p,required:e.isRequired&&E==="native",checked:O,value:r,onChange:b,"aria-describedby":[t["aria-describedby"],e.isInvalid?A:null,M].filter(Boolean).join(" ")||void 0}),isDisabled:p,isSelected:O,isPressed:$||S}}u(L2,"$0d5c49892c1215da$export$37b0961d2f4751e2");function z2(t,e){let{name:n,form:r,isReadOnly:i,isRequired:l,isDisabled:a,orientation:o="vertical",validationBehavior:s="aria"}=t,{direction:c}=Re(),{isInvalid:d,validationErrors:f,validationDetails:h}=e.displayValidation,{labelProps:p,fieldProps:m,descriptionProps:g,errorMessageProps:O}=$t({...t,labelElementType:"span",isInvalid:e.isInvalid,errorMessage:t.errorMessage||f}),b=yt(t,{labelable:!0}),{focusWithinProps:y}=Wt({onBlurWithin(S){var x;(x=t.onBlur)===null||x===void 0||x.call(t,S),e.selectedValue||e.setLastFocusedValue(null)},onFocusWithin:t.onFocus,onFocusWithinChange:t.onFocusChange}),$=u(S=>{let x;switch(S.key){case"ArrowRight":c==="rtl"&&o!=="vertical"?x="prev":x="next";break;case"ArrowLeft":c==="rtl"&&o!=="vertical"?x="next":x="prev";break;case"ArrowDown":x="next";break;case"ArrowUp":x="prev";break;default:return}S.preventDefault();let C=ut(S.currentTarget,{from:S.target,accept:T=>T instanceof bt(T).HTMLInputElement&&T.type==="radio"}),Q;x==="next"?(Q=C.nextNode(),Q||(C.currentNode=S.currentTarget,Q=C.firstChild())):(Q=C.previousNode(),Q||(C.currentNode=S.currentTarget,Q=C.lastChild())),Q&&(Q.focus(),e.setSelectedValue(Q.value))},"onKeyDown"),v=Ie(n);return I2.set(e,{name:v,form:r,descriptionId:g.id,errorMessageId:O.id,validationBehavior:s}),{radioGroupProps:ne(b,{role:"radiogroup",onKeyDown:$,"aria-invalid":e.isInvalid||void 0,"aria-errormessage":t["aria-errormessage"],"aria-readonly":i||void 0,"aria-required":l||void 0,"aria-disabled":a||void 0,"aria-orientation":o,...m,...y}),labelProps:p,descriptionProps:g,errorMessageProps:O,isInvalid:d,validationErrors:f,validationDetails:h}}u(z2,"$430f30ed08ec25fa$export$62b9571f283ff5c2");const o0=new WeakMap;function KF(t,e,n){let{keyboardDelegate:r,isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s="aria"}=t,c=Sg({usage:"search",sensitivity:"base"}),d=(0,wp.element.useMemo)(()=>r||new hs(e.collection,e.disabledKeys,n,c),[r,e.collection,e.disabledKeys,c,n]),{menuTriggerProps:f,menuProps:h}=YD({isDisabled:i,type:"listbox"},e,n),p=u(T=>{if(e.selectionManager.selectionMode!=="multiple")switch(T.key){case"ArrowLeft":{var B,w;T.preventDefault();let E=e.selectedKey!=null?(B=d.getKeyAbove)===null||B===void 0?void 0:B.call(d,e.selectedKey):(w=d.getFirstKey)===null||w===void 0?void 0:w.call(d);E&&e.setSelectedKey(E);break}case"ArrowRight":{var M,A;T.preventDefault();let E=e.selectedKey!=null?(M=d.getKeyBelow)===null||M===void 0?void 0:M.call(d,e.selectedKey):(A=d.getFirstKey)===null||A===void 0?void 0:A.call(d);E&&e.setSelectedKey(E);break}}},"onKeyDown"),{typeSelectProps:m}=tD({keyboardDelegate:d,selectionManager:e.selectionManager,onTypeSelect(T){e.setSelectedKey(T)}}),{isInvalid:g,validationErrors:O,validationDetails:b}=e.displayValidation,{labelProps:y,fieldProps:$,descriptionProps:v,errorMessageProps:S}=$t({...t,labelElementType:"span",isInvalid:g,errorMessage:t.errorMessage||O});m.onKeyDown=m.onKeyDownCapture,delete m.onKeyDownCapture,e.selectionManager.selectionMode==="multiple"&&(m={});let x=yt(t,{labelable:!0}),C=ne(m,f,$),Q=Ie();return o0.set(e,{isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s}),{labelProps:{...y,onClick:()=>{if(!t.isDisabled){var T;(T=n.current)===null||T===void 0||T.focus(),Bm("keyboard")}}},triggerProps:ne(x,{...C,isDisabled:i,onKeyDown:vr(C.onKeyDown,p,t.onKeyDown),onKeyUp:t.onKeyUp,"aria-labelledby":[Q,C["aria-labelledby"],C["aria-label"]&&!C["aria-labelledby"]?C.id:null].filter(Boolean).join(" "),onFocus(T){e.isFocused||(t.onFocus&&t.onFocus(T),t.onFocusChange&&t.onFocusChange(!0),e.setFocused(!0))},onBlur(T){e.isOpen||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:Q},menuProps:{...h,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[$["aria-labelledby"],C["aria-label"]&&!$["aria-labelledby"]?C.id:null].filter(Boolean).join(" ")},descriptionProps:v,errorMessageProps:S,isInvalid:g,validationErrors:O,validationDetails:b,hiddenSelectProps:{isDisabled:i,name:a,label:t.label,state:e,triggerRef:n,form:o}}}u(KF,"$58aed456727eb0f3$export$e64b2f635402ca43");function UF(t,e,n){let r=o0.get(e)||{},{autoComplete:i,name:l=r.name,form:a=r.form,isDisabled:o=r.isDisabled}=t,{validationBehavior:s,isRequired:c}=r,{visuallyHiddenProps:d}=Dd({style:{position:"fixed",top:0,left:0}});Sr(t.selectRef,e.defaultValue,e.setValue),as({validationBehavior:s,focus:()=>{var m;return(m=n.current)===null||m===void 0?void 0:m.focus()}},e,t.selectRef);let f=e.setValue,h=(0,wp.element.useCallback)(m=>{m.target.multiple?f(Array.from(m.target.selectedOptions,g=>g.value)):f(m.currentTarget.value)},[f]);var p;return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:i,disabled:o,multiple:e.selectionManager.selectionMode==="multiple",required:s==="native"&&c,name:l,form:a,value:(p=e.value)!==null&&p!==void 0?p:"",onChange:h,onInput:h}}}u(UF,"$bdd25dc72710631f$export$f809e80f58e251d1");function GF(t){let{state:e,triggerRef:n,label:r,name:i,form:l,isDisabled:a}=t,o=(0,wp.element.useRef)(null),s=(0,wp.element.useRef)(null),{containerProps:c,selectProps:d}=UF({...t,selectRef:e.collection.size<=300?o:s},e,n);if(e.collection.size<=300)return wp.element.createElement("div",{...c,"data-testid":"hidden-select-container"},wp.element.createElement("label",null,r,wp.element.createElement("select",{...d,ref:o},wp.element.createElement("option",null),[...e.collection.getKeys()].map(f=>{let h=e.collection.getItem(f);if(h&&h.type==="item")return wp.element.createElement("option",{key:h.key,value:h.key},h.textValue)}))));if(i){let f=o0.get(e)||{},{validationBehavior:h}=f,p=Array.isArray(e.value)?e.value:[e.value];p.length===0&&(p=[null]);let m=p.map((g,O)=>{let b={type:"hidden",autoComplete:d.autoComplete,name:i,form:l,disabled:a,value:g??""};return h==="native"?wp.element.createElement("input",{key:O,...b,ref:O===0?s:null,style:{display:"none"},type:"text",required:O===0?d.required:!1,onChange:()=>{}}):wp.element.createElement("input",{key:O,...b,ref:O===0?s:null})});return wp.element.createElement(wp.element.Fragment,null,m)}return null}u(GF,"$bdd25dc72710631f$export$cbd84cdb2e668835");function _F(t){let e=yt(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}u(_F,"$f4b273590fab9f93$export$52210f68a14655d0");function HF(t,e,n){let{labelProps:r,inputProps:i,isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}=Cx(t,e,n);return{labelProps:r,inputProps:{...i,role:"switch",checked:l},isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}}u(HF,"$b418ec0c85c52f27$export$d853f7095ae95f88");var JF=Object.defineProperty,Z2=u((t,e)=>JF(t,"name",{value:e,configurable:!0}),"l$l");const eI=Z2((t,e=!1)=>{if(e===!1)return`[[${t}]]`;let n="";for(const r in e){const i=e[r];n+=`::${r}=${typeof i=="object"?JSON.stringify(i):i}`}return`[[${t}${n}]]`},"dynamicValueToString"),X2=Z2(t=>{if(typeof t!="string")return!1;const e=t.replace("[[","").replace("]]","").split("::");return e.length===0?!1:e.reduce((n,r,i)=>{if(i===0)return n;const l=r.split("=");return{...n,fields:{...n.fields,[l[0]]:l[1]}}},{type:e[0],settings:{}})},"stringToDynamicValue");var tI=Object.defineProperty,s0=u((t,e)=>tI(t,"name",{value:e,configurable:!0}),"r$d");const nI=["color-picker","conditional-panel","date-picker","number","text"],j2=/\[\[((?:(?!\]\]).)+\]?)\]\]/g,q2=s0(t=>typeof t=="string"?Array.from(t.matchAll(j2),e=>e[1]):[],"getDynamicStrings"),u0={"color-picker":{mode:{default:"replace",supported:["replace"]},types:["color"]},"conditional-panel":{mode:{default:"replace",supported:["replace","insert"],types:["text","date","color","number"]},types:["color"]},"date-picker":{mode:{default:"replace",supported:["replace"]},types:["date"]},number:{mode:{default:"replace",supported:["replace"]},types:["number"]},text:{mode:{default:"insert",supported:["insert","replace"]},types:["text","date","color","number"]}},rI=s0((t,e)=>u0[t].mode.supported.includes(e)?e:u0[t].mode.default,"getMode"),iI=s0((t,e,{dynamic:n,type:r})=>{const i=Zn().dynamics;return nI.includes(r)?{getTypes:()=>n.types??u0[r].types,getMode:()=>rI(r,n.mode??!1),getCategories:()=>n.categories??Object.keys(i.categories),getList:()=>i.values,getAll:()=>q2(t).map(X2),getLabel:l=>i.values[l]?i.values[l].label:l,stringify:eI,parse:X2,hasValues:()=>q2(t).length!==0,setValue:l=>e(l)}:!1},"dynamicValuesAPI");var lI=Object.defineProperty,di=u((t,e)=>lI(t,"name",{value:e,configurable:!0}),"e$5");const fi=di(()=>(Date.now()*1e3+Math.random()*1e3).toString(16).replace(/\./g,"").padEnd(14,"0"),"uniqid"),On=di((t,e=!1)=>{if(Array.isArray(t)||typeof t=="object")return t;if(t===""&&e)return e;try{return JSON.parse(t)}catch{return{}}},"initJSON"),W2=di(t=>t instanceof Set?t:Array.isArray(t)?new Set(t):t.startsWith("[")&&t.endsWith("]")?On(t,new Set):new Set(t.split(",")),"initSet"),il=di(t=>Object.keys(t).map(e=>t[e].choices?{...t[e],key:t[e].name,label:t[e].name,choices:Object.keys(t[e].choices).map(n=>({value:n,label:t[e].choices[n]}))}:{value:e,label:t[e]}),"getOptions"),Y2=di((t,e)=>e.filter(n=>n.value===t)[0]??!1,"getOption"),aI=di((t,e)=>JSON.stringify(t)===JSON.stringify(e),"areSameObjects"),c0=di(t=>JSON.parse(JSON.stringify(t)),"deepCopy"),oI=di(()=>({dispatcher:K2,init:U2}),"getRepeaterHelpers");var sI=Object.freeze({__proto__:null,areSameObjects:aI,deepCopy:c0,getOption:Y2,getOptions:il,getRepeaterHelpers:oI,initJSON:On,initSet:W2,uniqid:fi}),uI=Object.defineProperty,d0=u((t,e)=>uI(t,"name",{value:e,configurable:!0}),"a$i");const K2=d0((t,e,n)=>(r,i)=>{switch(i.callback&&setTimeout(i.callback),i.type){case"add":return r.length>=e?r:[...r,{key:fi(),...i.data??t}];case"insert":return r.length>=e?r:[...r.slice(0,i.position),{key:fi(),...i.data??t},...r.slice(i.position)];case"remove":return[...r.slice(0,i.item),...r.slice(i.item+1)];case"update":return r[i.item][i.control]=i.value,[...r];case"clone":return r.length>=e?r:[...r,{...f0(i.item,n),key:fi()}];case"clear":return[];case"bulkCheck":return r.map(l=>({...l,_bulkCheckbox:!0}));case"bulkUncheck":return r.map(l=>({...l,_bulkCheckbox:!1}));case"bulkUpdate":return r.map(l=>l._bulkCheckbox===!0?{...l,[i.control]:i.value}:l);case"bulkRemove":return r.filter(l=>l._bulkCheckbox!==!0);default:return r}},"repeaterDispatcher"),f0=d0((t,e)=>{if(typeof e?.clone?.exclude!="object")return t;const n={...t};return Object.keys(e.clone.exclude).map(r=>{const i=e.clone.exclude[r];i===!0&&delete n[r],typeof i=="object"&&(n[r]=Array.isArray(n[r])?n[r].map(l=>f0(l,{clone:{exclude:i}})):f0(n[r],{clone:{exclude:i}}))}),n},"formatClone"),U2=d0((t,e)=>{try{const n=Array.isArray(t)?t:JSON.parse(t);return Array.isArray(n)?n:[e]}catch{return[{key:fi(),...e}]}},"initDispatcher"),se=wp.element.forwardRef(({children:t,...e},n)=>{const r=wp.element.useRef(),i=n??r,l=e.content??t,a=e.buttonType??"button",o=e.layout?e.layout?`tf-button-${e.layout}`:"":e.type?`tf-button-${e.type}`:"",{buttonProps:s}=SV(e,n),c=e.context?`tf-button-is-${e.context}`:"",d=`tf-button ${o} ${c} ${e.className??""}`,f=e.changeTag&&e.changeTag=="span"?"span":"button";return wp.element.createElement(f,{className:d,style:e.style,...s,onClick:h=>{s.onClick(h),Xi("buttonPressed",{name:e.name??!1,props:e,event:h})},ref:i,type:a},e.contentVisuallyHidden?wp.element.createElement(gn,null,l):l)});var cI=Object.defineProperty,dI=u((t,e)=>cI(t,"name",{value:e,configurable:!0}),"i$q");const we=dI(({descriptionProps:t,parent:e,children:n,...r})=>{const i=e?.descriptionVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("div",{className:"tf-description",...t},l))},"Description");var fI=Object.defineProperty,hI=u((t,e)=>fI(t,"name",{value:e,configurable:!0}),"t$d");const gs=hI(({title:t,children:e,...n})=>{const r=wp.element.useRef(),{dialogProps:i}=vF(n,r);return wp.element.createElement("div",{className:"tf-dialog",...i,ref:r},t&&wp.element.createElement(zd,{level:4},t),wp.element.createElement("div",{className:"tf-dialog-content"},e))},"Dialog");var pI=Object.defineProperty,G2=u((t,e)=>pI(t,"name",{value:e,configurable:!0}),"l$j");const _2=G2(t=>{const[e,n]=wp.element.useState(!0);wp.element.useEffect(()=>{t.isOpen!==e&&n(t.isOpen)},[t.isOpen]);const r=G2(()=>{n(!e),t.onChange&&t.onChange(!e)},"toggle");let i="tf-panel";return i+=` tf-panel-${e?"open":"closed"}`,i+=t.className?` ${t.className}`:"",i+=t.class?` ${t.class}`:"",i+=t.footer?"":" tf-panel-no-footer",wp.element.createElement("div",{className:i,"data-status":e?"open":"closed"},wp.element.createElement(se,{className:"tf-panel-header",type:"action",onClick:r},wp.element.createElement("div",{className:"tf-panel-header-left"},t.headerLeft?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerLeft):null,t.title?wp.element.createElement("div",{className:"tf-panel-header-title"},wp.element.isValidElement(t.title)?t.title:wp.element.createElement("strong",null,t.title)):null),wp.element.createElement("div",{className:"tf-panel-header-right"},t.headerRight?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerRight):null,wp.element.createElement("span",{className:"tf-panel-arrow"}))),e||t?.behavior==="hide"?wp.element.createElement("div",{className:"tf-panel-content"},t.children):null,t.footer?wp.element.createElement("div",{className:"tf-panel-footer"},t.footer):null)},"ExpandablePanel");var mI=Object.defineProperty,gI=u((t,e)=>mI(t,"name",{value:e,configurable:!0}),"t$c");const xe=gI(({labelProps:t,parent:e,children:n,...r})=>{const i=e?.labelVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("label",{className:"tf-label",...t,htmlFor:e?.name??""},l))},"Label");var OI=Object.defineProperty,bI=u((t,e)=>OI(t,"name",{value:e,configurable:!0}),"i$p");const h0=bI(({item:t,state:e})=>{const n=wp.element.useRef(),{optionProps:r,isSelected:i,isFocused:l,isDisabled:a}=oF({key:t.key},e,n),{focusProps:o}=rs();let s="tf-list-box-option";return i&&(s=s+=" tf-list-box-option-selected"),a&&(s=s+=" tf-list-box-option-disabled"),l&&(s=s+=" tf-list-box-option-focus"),wp.element.createElement("li",{...ne(r,o),ref:n,className:s},t.rendered)},"Option");var yI=Object.defineProperty,vI=u((t,e)=>yI(t,"name",{value:e,configurable:!0}),"a$f");const $I=vI(({section:t,state:e})=>{const{itemProps:n,headingProps:r,groupProps:i}=sF({heading:t.rendered,"aria-label":t["aria-label"]}),{separatorProps:l}=_F({elementType:"li"}),a=t.key===e.collection.getFirstKey();return wp.element.createElement(wp.element.Fragment,null,!a&&wp.element.createElement("li",{className:"tf-list-box-section-separator",...l}),wp.element.createElement("li",{className:"tf-list-box-section",...n},t.rendered&&wp.element.createElement("span",{...r},t.rendered),wp.element.createElement("ul",{...i},[...t.childNodes].map(o=>wp.element.createElement(h0,{key:o.key??o.name,item:o,state:e})))))},"Section");var wI=Object.defineProperty,xI=u((t,e)=>wI(t,"name",{value:e,configurable:!0}),"l$i");const Vd=xI(t=>{const e=wp.element.useRef(),{listBoxRef:n=e,state:r}=t,{listBoxProps:i}=lD(t,r,n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("ul",{...i,ref:n,className:"tf-list-box"},["loading","filtering"].includes(t?.loadingState)?wp.element.createElement(h0,{key:"_loading",state:r,item:{rendered:"Loading...",isDisabled:!0},shouldUseVirtualFocus:!0}):[...r.collection].map(l=>l.type==="section"?wp.element.createElement($I,{key:l.key??l.level,section:l,state:r,shouldUseVirtualFocus:!0}):wp.element.createElement(h0,{key:l.key??l.name,item:l,state:r,shouldUseVirtualFocus:!0}))),wp.element.createElement(ds,{onDismiss:r.close}))},"ListBox");var SI=Object.defineProperty,CI=u((t,e)=>SI(t,"name",{value:e,configurable:!0}),"a$d");const kI=CI(({state:t,children:e,...n})=>{const r=wp.element.useContext(Zl),i=wp.element.useRef(null),{modalProps:l,underlayProps:a}=YN(n,t,i);return wp.element.createElement(_k,{portalContainer:r.portalContainer},wp.element.createElement("div",{className:r.wrapper},wp.element.createElement("div",{className:"tf-modal",...a,style:{zIndex:1e6}},wp.element.createElement("div",{className:"tf-modal-container",ref:i,...l},e))))},"Modal");function Aa(t,e,n){return e!=null&&t.compare(e)<0||n!=null&&t.compare(n)>0}u(Aa,"$f62d864046160412$export$eac50920cf2fd59a");function p0(t,e,n,r,i){let l={};for(let o in e)l[o]=Math.floor(e[o]/2),l[o]>0&&e[o]%2===0&&l[o]--;let a=ll(t,e,n).subtract(l);return Os(t,a,e,n,r,i)}u(p0,"$f62d864046160412$export$f4a51ff076cc9a09");function ll(t,e,n,r,i){let l=t;return e.years?l=NR(t):e.months?l=_i(t):e.weeks&&(l=Yo(t,n)),Os(t,l,e,n,r,i)}u(ll,"$f62d864046160412$export$144a00ba6044eb9");function m0(t,e,n,r,i){let l={...e};l.days?l.days--:l.weeks?l.weeks--:l.months?l.months--:l.years&&l.years--;let a=ll(t,e,n).subtract(l);return Os(t,a,e,n,r,i)}u(m0,"$f62d864046160412$export$530edbfc915b2b04");function Os(t,e,n,r,i,l){if(i&&t.compare(i)>=0){let a=Xm(e,ll(vt(i),n,r));a&&(e=a)}if(l&&t.compare(l)<=0){let a=Zm(e,m0(vt(l),n,r));a&&(e=a)}return e}u(Os,"$f62d864046160412$export$5bb865b12696a77d");function hi(t,e,n){if(e){let r=Xm(t,vt(e));r&&(t=r)}if(n){let r=Zm(t,vt(n));r&&(t=r)}return t}u(hi,"$f62d864046160412$export$4f5203c0d889109e");function H2(t,e,n){if(!n)return t;for(;t.compare(e)>=0&&n(t);)t=t.subtract({days:1});return t.compare(e)>=0?t:null}u(H2,"$f62d864046160412$export$a1d3911297b952d7");function J2(t){let e=(0,wp.element.useMemo)(()=>new Rt(t.locale),[t.locale]),n=(0,wp.element.useMemo)(()=>e.resolvedOptions(),[e]),{locale:r,createCalendar:i,visibleDuration:l={months:1},minValue:a,maxValue:o,selectionAlignment:s,isDateUnavailable:c,pageBehavior:d="visible",firstDayOfWeek:f}=t,h=(0,wp.element.useMemo)(()=>i(n.calendar),[i,n.calendar]);var p;let[m,g]=je(t.value,(p=t.defaultValue)!==null&&p!==void 0?p:null,t.onChange),O=(0,wp.element.useMemo)(()=>m?Ne(vt(m),h):null,[m,h]),b=(0,wp.element.useMemo)(()=>m&&"timeZone"in m?m.timeZone:n.timeZone,[m,n.timeZone]),y=(0,wp.element.useMemo)(()=>t.focusedValue?hi(Ne(vt(t.focusedValue),h),a,o):void 0,[t.focusedValue,h,a,o]),$=(0,wp.element.useMemo)(()=>hi(t.defaultFocusedValue?Ne(vt(t.defaultFocusedValue),h):O||Ne(Cr(b),h),a,o),[t.defaultFocusedValue,O,b,h,a,o]),[v,S]=je(y,$,t.onFocusChange),[x,C]=(0,wp.element.useState)(()=>{switch(s){case"start":return ll(v,l,r,a,o);case"end":return m0(v,l,r,a,o);case"center":default:return p0(v,l,r,a,o)}}),[Q,T]=(0,wp.element.useState)(t.autoFocus||!1),B=(0,wp.element.useMemo)(()=>{let F={...l};return F.days?F.days--:F.days=-1,x.add(F)},[x,l]),[w,M]=(0,wp.element.useState)(h);if(!od(h,w)){let F=Ne(v,h);C(p0(F,l,r,a,o)),S(F),M(h)}Aa(v,a,o)?S(hi(v,a,o)):v.compare(x)<0?C(m0(v,l,r,a,o)):v.compare(B)>0&&C(ll(v,l,r,a,o));function A(F){F=hi(F,a,o),S(F)}u(A,"focusCell");function E(F){if(!t.isDisabled&&!t.isReadOnly){let N=F;if(N===null){g(null);return}if(N=hi(N,a,o),N=H2(N,x,c),!N)return;N=Ne(N,m?.calendar||new tt),m&&"hour"in m?g(m.set(N)):g(N)}}u(E,"setValue");let I=(0,wp.element.useMemo)(()=>O?c&&c(O)?!0:Aa(O,a,o):!1,[O,c,a,o]),D=t.isInvalid||t.validationState==="invalid"||I,P=D?"invalid":null,R=(0,wp.element.useMemo)(()=>d==="visible"?l:g0(l),[d,l]);var L,k;return{isDisabled:(L=t.isDisabled)!==null&&L!==void 0?L:!1,isReadOnly:(k=t.isReadOnly)!==null&&k!==void 0?k:!1,value:O,setValue:E,visibleRange:{start:x,end:B},minValue:a,maxValue:o,focusedDate:v,timeZone:b,validationState:P,isValueInvalid:D,setFocusedDate(F){A(F),T(!0)},focusNextDay(){A(v.add({days:1}))},focusPreviousDay(){A(v.subtract({days:1}))},focusNextRow(){l.days?this.focusNextPage():(l.weeks||l.months||l.years)&&A(v.add({weeks:1}))},focusPreviousRow(){l.days?this.focusPreviousPage():(l.weeks||l.months||l.years)&&A(v.subtract({weeks:1}))},focusNextPage(){let F=x.add(R);S(hi(v.add(R),a,o)),C(ll(Os(v,F,R,r,a,o),R,r))},focusPreviousPage(){let F=x.subtract(R);S(hi(v.subtract(R),a,o)),C(ll(Os(v,F,R,r,a,o),R,r))},focusSectionStart(){l.days?A(x):l.weeks?A(Yo(v,r)):(l.months||l.years)&&A(_i(v))},focusSectionEnd(){l.days?A(B):l.weeks?A(LR(v,r)):(l.months||l.years)&&A(Oa(v))},focusNextSection(F){if(!F&&!l.days){A(v.add(g0(l)));return}l.days?this.focusNextPage():l.weeks?A(v.add({months:1})):(l.months||l.years)&&A(v.add({years:1}))},focusPreviousSection(F){if(!F&&!l.days){A(v.subtract(g0(l)));return}l.days?this.focusPreviousPage():l.weeks?A(v.subtract({months:1})):(l.months||l.years)&&A(v.subtract({years:1}))},selectFocusedDate(){c&&c(v)||E(v)},selectDate(F){E(F)},isFocused:Q,setFocused:T,isInvalid(F){return Aa(F,a,o)},isSelected(F){return O!=null&&Ue(F,O)&&!this.isCellDisabled(F)&&!this.isCellUnavailable(F)},isCellFocused(F){return Q&&v&&Ue(F,v)},isCellDisabled(F){return t.isDisabled||F.compare(x)<0||F.compare(B)>0||this.isInvalid(F)},isCellUnavailable(F){return t.isDateUnavailable?t.isDateUnavailable(F):!1},isPreviousVisibleRangeInvalid(){let F=x.subtract({days:1});return Ue(F,x)||this.isInvalid(F)},isNextVisibleRangeInvalid(){let F=B.add({days:1});return Ue(F,B)||this.isInvalid(F)},getDatesInWeek(F,N=x){let z=N.add({weeks:F}),G=[];z=Yo(z,r,f);let le=Im(z,r,f);for(let ie=0;ie0&&(m="start")}let g=(0,wp.element.useRef)(null),[O,b]=(0,wp.element.useState)(null),y=(0,wp.element.useMemo)(()=>Xm(o,O?.start),[o,O]),$=(0,wp.element.useMemo)(()=>Zm(s,O?.end),[s,O]),v=J2({...c,value:d&&d.start,createCalendar:i,locale:l,visibleDuration:a,minValue:y,maxValue:$,selectionAlignment:t.selectionAlignment||m}),S=u(P=>{if(P&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const R=tP(P,v,-1),L=tP(P,v,1);g.current={start:R,end:L},b(g.current)}else g.current=null,b(null)},"updateAvailableRange"),[x,C]=(0,wp.element.useState)(v.visibleRange);(!Fm(v.visibleRange.start,x.start)||!Fm(v.visibleRange.end,x.end))&&(S(h),C(v.visibleRange));let Q=u(P=>{P?(p(P),S(P)):(p(null),S(null))},"setAnchorDate"),T=h?O0(h,v.focusedDate):d&&O0(d.start,d.end),B=u(P=>{if(t.isReadOnly)return;const R=hi(P,y,$),L=H2(R,v.visibleRange.start,t.isDateUnavailable);if(L)if(!h)Q(L);else{let k=O0(h,L);k&&f({start:eP(k.start,d?.start),end:eP(k.end,d?.end)}),Q(null)}},"selectDate"),[w,M]=(0,wp.element.useState)(!1),{isDateUnavailable:A}=t,E=(0,wp.element.useMemo)(()=>!d||h?!1:A&&(A(d.start)||A(d.end))?!0:Aa(d.start,o,s)||Aa(d.end,o,s),[A,d,h,o,s]),I=t.isInvalid||t.validationState==="invalid"||E;return{...v,value:d,setValue:f,anchorDate:h,setAnchorDate:Q,highlightedRange:T,validationState:I?"invalid":null,isValueInvalid:I,selectFocusedDate(){B(v.focusedDate)},selectDate:B,highlightDate(P){h&&v.setFocusedDate(P)},isSelected(P){return!!(T&&P.compare(T.start)>=0&&P.compare(T.end)<=0&&!v.isCellDisabled(P)&&!v.isCellUnavailable(P))},isInvalid(P){var R,L;return v.isInvalid(P)||Aa(P,(R=g.current)===null||R===void 0?void 0:R.start,(L=g.current)===null||L===void 0?void 0:L.end)},isDragging:w,setDragging:M}}u(DI,"$9a36b6ba2fb1a7c5$export$9a987164d97ecc90");function O0(t,e){return!t||!e?null:(e.compare(t)<0&&([t,e]=[e,t]),{start:vt(t),end:vt(e)})}u(O0,"$9a36b6ba2fb1a7c5$var$makeRange");function eP(t,e){return t=Ne(t,e?.calendar||new tt),e&&"hour"in e?e.set(t):t}u(eP,"$9a36b6ba2fb1a7c5$var$convertValue");function tP(t,e,n){let r=t.add({days:n});for(;(n<0?r.compare(e.visibleRange.start)>=0:r.compare(e.visibleRange.end)<=0)&&!e.isCellUnavailable(r);)r=r.add({days:n});if(e.isCellUnavailable(r))return r.add({days:-n})}u(tP,"$9a36b6ba2fb1a7c5$var$nextUnavailableDate");const Sv=class Sv{*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(e){let n=this.keyMap.get(e);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return n?.childNodes||[]}constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=u(o=>{if(this.keyMap.set(o.key,o),o.childNodes&&o.type==="section")for(let s of o.childNodes)n(s)},"visit");for(let o of e)n(o);let r=null,i=0,l=0;for(let[o,s]of this.keyMap)r?(r.nextKey=o,s.prevKey=r.key):(this.firstKey=o,s.prevKey=void 0),s.type==="item"&&(s.index=i++),(s.type==="section"||s.type==="item")&&l++,r=s,r.nextKey=void 0;this._size=l;var a;this.lastKey=(a=r?.key)!==null&&a!==void 0?a:null}};u(Sv,"$a02d57049d202695$export$d085fb9e920b5ca7");let bs=Sv;const Op=class Op extends Set{constructor(e,n,r){super(e),e instanceof Op?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};u(Op,"$e40ea825a81a3709$export$52baac22726c72bf");let En=Op;function PI(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}u(PI,"$7af3f5b51489e0b5$var$equalSets");function EI(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:l="all"}=t,a=(0,wp.element.useRef)(!1),[,o]=(0,wp.element.useState)(!1),s=(0,wp.element.useRef)(null),c=(0,wp.element.useRef)(null),[,d]=(0,wp.element.useState)(null),f=(0,wp.element.useMemo)(()=>nP(t.selectedKeys),[t.selectedKeys]),h=(0,wp.element.useMemo)(()=>nP(t.defaultSelectedKeys,new En),[t.defaultSelectedKeys]),[p,m]=je(f,h,t.onSelectionChange),g=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[O,b]=(0,wp.element.useState)(i);i==="replace"&&O==="toggle"&&typeof p=="object"&&p.size===0&&b("replace");let y=(0,wp.element.useRef)(i);return(0,wp.element.useEffect)(()=>{i!==y.current&&(b(i),y.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:O,setSelectionBehavior:b,get isFocused(){return a.current},setFocused($){a.current=$,o($)},get focusedKey(){return s.current},get childFocusStrategy(){return c.current},setFocusedKey($,v="first"){s.current=$,c.current=v,d($)},selectedKeys:p,setSelectedKeys($){(r||!PI($,p))&&m($)},disabledKeys:g,disabledBehavior:l}}u(EI,"$7af3f5b51489e0b5$export$253fe78d46329472");function nP(t,e){return t?t==="all"?"all":new En(t):e}u(nP,"$7af3f5b51489e0b5$var$convertSelection");const bp=class bp{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&n0(this.collection,i,e)<0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&n0(this.collection,i,e)>0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new En([n],n,n);else{let a=this.state.selectedKeys;var i;let o=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new En(a,o,n);var l;for(let s of this.getKeyRange(o,(l=a.currentKey)!==null&&l!==void 0?l:n))r.delete(s);for(let s of this.getKeyRange(n,o))this.canSelectItem(s)&&r.add(s)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),i=this.collection.getItem(n);return r&&i?n0(this.collection,r,i)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let i=[],l=e;for(;l!=null;){let a=this.collection.getItem(l);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(l),l===n)return i;l=this.collection.getKeyAfter(l)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new En(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new En([n],n,n):new En;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new En;for(let r of e){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=[],n=u(r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);a?.type==="item"&&e.push(r);var l;a?.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((l=(i=lF(Bd(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&l!==void 0?l:null)}r=this.collection.getKeyAfter(r)}},"addKeys");return n(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new En)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=this.collection.getItem(e);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(e){var n,r;return!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))===null||n===void 0?void 0:n.props}withCollection(e){return new bp(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,n,r){this.collection=e,this.state=n;var i;this.allowsCellSelection=(i=r?.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null}};u(bp,"$d496c0a20b6e58ec$export$6c8a5aaad13c9852");let b0=bp;function y0(t){let{filter:e,layoutDelegate:n}=t,r=EI(t),i=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=(0,wp.element.useCallback)(c=>e?new bs(e(c)):new bs(c),[e]),a=(0,wp.element.useMemo)(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),o=iF(t,l,a),s=(0,wp.element.useMemo)(()=>new b0(o,r,{layoutDelegate:n}),[o,r,n]);return TI(o,s),{collection:o,disabledKeys:i,selectionManager:s}}u(y0,"$e72dd72e1c76a225$export$2f645645f7bca764");function TI(t,e){const n=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){const d=n.current.getItem(e.focusedKey),f=[...n.current.getKeys()].map(b=>{const y=n.current.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null),h=[...t.getKeys()].map(b=>{const y=t.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null);var r,i;const p=((r=f?.length)!==null&&r!==void 0?r:0)-((i=h?.length)!==null&&i!==void 0?i:0);var l,a,o;let m=Math.min(p>1?Math.max(((l=d?.index)!==null&&l!==void 0?l:0)-p+1,0):(a=d?.index)!==null&&a!==void 0?a:0,((o=h?.length)!==null&&o!==void 0?o:0)-1),g=null,O=!1;for(;m>=0;){if(!e.isDisabled(h[m].key)){g=h[m];break}if(m((s=d?.index)!==null&&s!==void 0?s:0)&&(m=(c=d?.index)!==null&&c!==void 0?c:0),m--}}e.setFocusedKey(g?g.key:null)}n.current=t},[t,e])}u(TI,"$e72dd72e1c76a225$var$useFocusedKeyReset");function AI(t){var e;let[n,r]=je(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),i=(0,wp.element.useMemo)(()=>n!=null?[n]:[],[n]),{collection:l,disabledKeys:a,selectionManager:o}=y0({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:c=>{if(c==="all")return;var d;let f=(d=c.values().next().value)!==null&&d!==void 0?d:null;f===n&&t.onSelectionChange&&t.onSelectionChange(f),r(f)}}),s=n!=null?l.getItem(n):null;return{collection:l,disabledKeys:a,selectionManager:o,selectedKey:n,setSelectedKey:r,selectedItem:s}}u(AI,"$a0d645289fe9b86b$export$e7f05e985daf4b5f");function pi(t){let[e,n]=je(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=(0,wp.element.useCallback)(()=>{n(!0)},[n]),i=(0,wp.element.useCallback)(()=>{n(!1)},[n]),l=(0,wp.element.useCallback)(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:i,toggle:l}}u(pi,"$fc909762b330b746$export$61c6a8c84e605fb6");function rP(t){var e;let{defaultFilter:n,menuTrigger:r="input",allowsEmptyCollection:i=!1,allowsCustomValue:l,shouldCloseOnBlur:a=!0}=t,[o,s]=(0,wp.element.useState)(!1),[c,d]=(0,wp.element.useState)(!1),[f,h]=(0,wp.element.useState)(null),p=u(oe=>{t.onSelectionChange&&t.onSelectionChange(oe),oe===b&&(z(),k())},"onSelectionChange");var m;let{collection:g,selectionManager:O,selectedKey:b,setSelectedKey:y,selectedItem:$,disabledKeys:v}=AI({...t,onSelectionChange:p,items:(m=t.items)!==null&&m!==void 0?m:t.defaultItems}),[S,x]=je(t.inputValue,lP(t.defaultInputValue,b,g)||"",t.onInputChange),[C]=(0,wp.element.useState)(b),[Q]=(0,wp.element.useState)(S),T=g,B=(0,wp.element.useMemo)(()=>t.items!=null||!n?g:QI(g,S,n),[g,S,n,t.items]),[w,M]=(0,wp.element.useState)(B),A=(0,wp.element.useRef)("focus"),I=pi({...t,onOpenChange:u(oe=>{t.onOpenChange&&t.onOpenChange(oe,oe?A.current:void 0),O.setFocused(oe),oe||O.setFocusedKey(null)},"onOpenChange"),isOpen:void 0,defaultOpen:void 0}),D=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";(i||B.size>0||$e&&T.size>0||t.items)&&($e&&!I.isOpen&&t.items===void 0&&s(!0),A.current=ge,h(oe),I.open())},"open"),P=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";!(i||B.size>0||$e&&T.size>0||t.items)&&!I.isOpen||($e&&!I.isOpen&&t.items===void 0&&s(!0),I.isOpen||(A.current=ge),L(oe))},"toggle"),R=(0,wp.element.useCallback)(()=>{M(o?T:B)},[o,T,B]),L=(0,wp.element.useCallback)((oe=null)=>{I.isOpen&&R(),h(oe),I.toggle()},[I,R]),k=(0,wp.element.useCallback)(()=>{I.isOpen&&(R(),I.close())},[I,R]),[F,N]=(0,wp.element.useState)(S),z=u(()=>{var oe,ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";N($e),x($e)},"resetInputValue");var G,le;let ie=(0,wp.element.useRef)((le=(G=t.selectedKey)!==null&&G!==void 0?G:t.defaultSelectedKey)!==null&&le!==void 0?le:null);var me;let ve=(0,wp.element.useRef)(b!=null&&(me=(e=g.getItem(b))===null||e===void 0?void 0:e.textValue)!==null&&me!==void 0?me:"");(0,wp.element.useEffect)(()=>{var oe;c&&(B.size>0||i)&&!I.isOpen&&S!==F&&r!=="manual"&&D(null,"input"),!o&&!i&&I.isOpen&&B.size===0&&k(),b!=null&&b!==ie.current&&k(),S!==F&&(O.setFocusedKey(null),s(!1),S===""&&(t.inputValue===void 0||t.selectedKey===void 0)&&y(null)),b!==ie.current&&(t.inputValue===void 0||t.selectedKey===void 0)?z():F!==S&&N(S);var ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";!c&&b!=null&&t.inputValue===void 0&&b===ie.current&&ve.current!==$e&&(N($e),x($e)),ie.current=b,ve.current=$e});let ce=Yn({...t,value:(0,wp.element.useMemo)(()=>({inputValue:S,selectedKey:b}),[S,b])}),K=u(()=>{l&&b==null?W():Z()},"revert"),W=u(()=>{ie.current=null,y(null),k()},"commitCustomValue"),Z=u(()=>{if(t.selectedKey!==void 0&&t.inputValue!==void 0){var oe,ge;(oe=t.onSelectionChange)===null||oe===void 0||oe.call(t,b);var $e;let Zi=b!=null&&($e=(ge=g.getItem(b))===null||ge===void 0?void 0:ge.textValue)!==null&&$e!==void 0?$e:"";N(Zi),k()}else z(),k()},"commitSelection");const ee=u(()=>{if(l){var oe,ge;const $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";S===$e?Z():W()}else Z()},"commitValue");let De=u(()=>{I.isOpen&&O.focusedKey!=null?b===O.focusedKey?Z():y(O.focusedKey):ee()},"commit"),qt=(0,wp.element.useRef)(S),ni=u(oe=>{oe?(qt.current=S,r==="focus"&&!t.isReadOnly&&D(null,"focus")):(a&&ee(),S!==qt.current&&ce.commitValidation()),d(oe)},"setFocused"),yr=(0,wp.element.useMemo)(()=>I.isOpen?o?T:B:w,[I.isOpen,T,B,o,w]);var oa;let q=(oa=t.defaultSelectedKey)!==null&&oa!==void 0?oa:C;var fe;return{...ce,...I,focusStrategy:f,toggle:P,open:D,close:ee,selectionManager:O,selectedKey:b,defaultSelectedKey:q,setSelectedKey:y,disabledKeys:v,isFocused:c,setFocused:ni,selectedItem:$,collection:yr,inputValue:S,defaultInputValue:(fe=lP(t.defaultInputValue,q,g))!==null&&fe!==void 0?fe:Q,setInputValue:x,commit:De,revert:K}}u(rP,"$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e");function QI(t,e,n){return new bs(iP(t,t,e,n))}u(QI,"$a9e7382a7d111cb5$var$filterCollection");function iP(t,e,n,r){let i=[];for(let l of e)if(l.type==="section"&&l.hasChildNodes){let a=iP(t,Bd(l,t),n,r);[...a].some(o=>o.type==="item")&&i.push({...l,childNodes:a})}else l.type==="item"&&r(l.textValue,n)?i.push({...l}):l.type!=="item"&&i.push({...l});return i}u(iP,"$a9e7382a7d111cb5$var$filterNodes");function lP(t,e,n){if(t==null){var r,i;if(e!=null)return(i=(r=n.getItem(e))===null||r===void 0?void 0:r.textValue)!==null&&i!==void 0?i:""}return t}u(lP,"$a9e7382a7d111cb5$var$getDefaultInputValue");var aP={};aP={rangeOverflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.maxValue} \u0623\u0648 \u0642\u0628\u0644 \u0630\u0644\u0643.`,rangeReversed:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621 \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0642\u0628\u0644 \u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621.",rangeUnderflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.minValue} \u0623\u0648 \u0628\u0639\u062F \u0630\u0644\u0643.`,unavailableDate:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0645\u062D\u062F\u062F\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629."};var oP={};oP={rangeOverflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.maxValue} \u0438\u043B\u0438 \u043F\u043E-\u0440\u0430\u043D\u043D\u0430.`,rangeReversed:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 \u043F\u0440\u0435\u0434\u0438 \u043A\u0440\u0430\u0439\u043D\u0430\u0442\u0430.",rangeUnderflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.minValue} \u0438\u043B\u0438 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.`,unavailableDate:"\u0418\u0437\u0431\u0440\u0430\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435 \u0435 \u043D\u0430\u043B\u0438\u0447\u043D\u0430."};var sP={};sP={rangeOverflow:t=>`Hodnota mus\xED b\xFDt ${t.maxValue} nebo d\u0159\xEDv\u011Bj\u0161\xED.`,rangeReversed:"Datum zah\xE1jen\xED mus\xED p\u0159edch\xE1zet datu ukon\u010Den\xED.",rangeUnderflow:t=>`Hodnota mus\xED b\xFDt ${t.minValue} nebo pozd\u011Bj\u0161\xED.`,unavailableDate:"Vybran\xE9 datum nen\xED k dispozici."};var uP={};uP={rangeOverflow:t=>`V\xE6rdien skal v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xE6re f\xF8r slutdatoen.",rangeUnderflow:t=>`V\xE6rdien skal v\xE6re ${t.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xE6ngelig."};var cP={};cP={rangeOverflow:t=>`Der Wert muss ${t.maxValue} oder fr\xFCher sein.`,rangeReversed:"Das Startdatum muss vor dem Enddatum liegen.",rangeUnderflow:t=>`Der Wert muss ${t.minValue} oder sp\xE4ter sein.`,unavailableDate:"Das ausgew\xE4hlte Datum ist nicht verf\xFCgbar."};var dP={};dP={rangeOverflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.maxValue} \u03AE \u03C0\u03B1\u03BB\u03B1\u03B9\u03CC\u03C4\u03B5\u03C1\u03B7.`,rangeReversed:"\u0397 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2 \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2.",rangeUnderflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.minValue} \u03AE \u03BC\u03B5\u03C4\u03B1\u03B3\u03B5\u03BD\u03AD\u03C3\u03C4\u03B5\u03C1\u03B7.`,unavailableDate:"\u0397 \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03B7."};var fP={};fP={rangeUnderflow:t=>`Value must be ${t.minValue} or later.`,rangeOverflow:t=>`Value must be ${t.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."};var hP={};hP={rangeOverflow:t=>`El valor debe ser ${t.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xF3n.",rangeUnderflow:t=>`El valor debe ser ${t.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."};var pP={};pP={rangeOverflow:t=>`V\xE4\xE4rtus peab olema ${t.maxValue} v\xF5i varasem.`,rangeReversed:"Alguskuup\xE4ev peab olema enne l\xF5ppkuup\xE4eva.",rangeUnderflow:t=>`V\xE4\xE4rtus peab olema ${t.minValue} v\xF5i hilisem.`,unavailableDate:"Valitud kuup\xE4ev pole saadaval."};var mP={};mP={rangeOverflow:t=>`Arvon on oltava ${t.maxValue} tai sit\xE4 aikaisempi.`,rangeReversed:"Aloitusp\xE4iv\xE4n on oltava ennen lopetusp\xE4iv\xE4\xE4.",rangeUnderflow:t=>`Arvon on oltava ${t.minValue} tai sit\xE4 my\xF6h\xE4isempi.`,unavailableDate:"Valittu p\xE4iv\xE4m\xE4\xE4r\xE4 ei ole k\xE4ytett\xE4viss\xE4."};var gP={};gP={rangeOverflow:t=>`La valeur doit \xEAtre ${t.maxValue} ou ant\xE9rieure.`,rangeReversed:"La date de d\xE9but doit \xEAtre ant\xE9rieure \xE0 la date de fin.",rangeUnderflow:t=>`La valeur doit \xEAtre ${t.minValue} ou ult\xE9rieure.`,unavailableDate:"La date s\xE9lectionn\xE9e n\u2019est pas disponible."};var OP={};OP={rangeOverflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.maxValue} \u05D0\u05D5 \u05DE\u05D5\u05E7\u05D3\u05DD \u05D9\u05D5\u05EA\u05E8.`,rangeReversed:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05D4\u05EA\u05D7\u05DC\u05D4 \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05E0\u05D9 \u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E1\u05D9\u05D5\u05DD.",rangeUnderflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.minValue} \u05D0\u05D5 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.`,unavailableDate:"\u05D4\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E0\u05D1\u05D7\u05E8 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF."};var bP={};bP={rangeOverflow:t=>`Vrijednost mora biti ${t.maxValue} ili ranije.`,rangeReversed:"Datum po\u010Detka mora biti prije datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrijednost mora biti ${t.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."};var yP={};yP={rangeOverflow:t=>`Az \xE9rt\xE9knek ${t.maxValue} vagy kor\xE1bbinak kell lennie.`,rangeReversed:"A kezd\u0151 d\xE1tumnak a befejez\u0151 d\xE1tumn\xE1l kor\xE1bbinak kell lennie.",rangeUnderflow:t=>`Az \xE9rt\xE9knek ${t.minValue} vagy k\xE9s\u0151bbinek kell lennie.`,unavailableDate:"A kiv\xE1lasztott d\xE1tum nem \xE9rhet\u0151 el."};var vP={};vP={rangeOverflow:t=>`Il valore deve essere ${t.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:t=>`Il valore deve essere ${t.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."};var $P={};$P={rangeOverflow:t=>`\u5024\u306F ${t.maxValue} \u4EE5\u4E0B\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u306F\u7D42\u4E86\u65E5\u3088\u308A\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",rangeUnderflow:t=>`\u5024\u306F ${t.minValue} \u4EE5\u4E0A\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,unavailableDate:"\u9078\u629E\u3057\u305F\u65E5\u4ED8\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002"};var wP={};wP={rangeOverflow:t=>`\uAC12\uC740 ${t.maxValue} \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,rangeReversed:"\uC2DC\uC791\uC77C\uC740 \uC885\uB8CC\uC77C \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.",rangeUnderflow:t=>`\uAC12\uC740 ${t.minValue} \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,unavailableDate:"\uC120\uD0DD\uD55C \uB0A0\uC9DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."};var xP={};xP={rangeOverflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.maxValue} arba ankstesn\u0117.`,rangeReversed:"Prad\u017Eios data turi b\u016Bti ankstesn\u0117 nei pabaigos data.",rangeUnderflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.minValue} arba naujesn\u0117.`,unavailableDate:"Pasirinkta data nepasiekiama."};var SP={};SP={rangeOverflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.maxValue} vai agr\u0101kai.`,rangeReversed:"S\u0101kuma datumam ir j\u0101b\u016Bt pirms beigu datuma.",rangeUnderflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.minValue} vai v\u0113l\u0101kai.`,unavailableDate:"Atlas\u012Btais datums nav pieejams."};var CP={};CP={rangeOverflow:t=>`Verdien m\xE5 v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xE5 v\xE6re f\xF8r sluttdatoen.",rangeUnderflow:t=>`Verdien m\xE5 v\xE6re ${t.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."};var kP={};kP={rangeOverflow:t=>`Waarde moet ${t.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:t=>`Waarde moet ${t.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."};var DP={};DP={rangeOverflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.maxValue} lub wcze\u015Bniejsz\u0105.`,rangeReversed:"Data rozpocz\u0119cia musi by\u0107 wcze\u015Bniejsza ni\u017C data zako\u0144czenia.",rangeUnderflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.minValue} lub p\xF3\u017Aniejsz\u0105.`,unavailableDate:"Wybrana data jest niedost\u0119pna."};var PP={};PP={rangeOverflow:t=>`O valor deve ser ${t.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xE0 data final.",rangeUnderflow:t=>`O valor deve ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var EP={};EP={rangeOverflow:t=>`O valor tem de ser ${t.maxValue} ou anterior.`,rangeReversed:"A data de in\xEDcio deve ser anterior \xE0 data de fim.",rangeUnderflow:t=>`O valor tem de ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var TP={};TP={rangeOverflow:t=>`Valoarea trebuie s\u0103 fie ${t.maxValue} sau anterioar\u0103.`,rangeReversed:"Data de \xEEnceput trebuie s\u0103 fie anterioar\u0103 datei de sf\xE2r\u0219it.",rangeUnderflow:t=>`Valoarea trebuie s\u0103 fie ${t.minValue} sau ulterioar\u0103.`,unavailableDate:"Data selectat\u0103 nu este disponibil\u0103."};var AP={};AP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043F\u043E\u0437\u0436\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0434\u0430\u0442\u0435 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u0440\u0430\u043D\u044C\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var QP={};QP={rangeOverflow:t=>`Hodnota mus\xED by\u0165 ${t.maxValue} alebo skor\u0161ia.`,rangeReversed:"D\xE1tum za\u010Diatku mus\xED by\u0165 skor\u0161\xED ako d\xE1tum konca.",rangeUnderflow:t=>`Hodnota mus\xED by\u0165 ${t.minValue} alebo neskor\u0161ia.`,unavailableDate:"Vybrat\xFD d\xE1tum je nedostupn\xFD."};var MP={};MP={rangeOverflow:t=>`Vrednost mora biti ${t.maxValue} ali starej\u0161a.`,rangeReversed:"Za\u010Detni datum mora biti pred kon\u010Dnim datumom.",rangeUnderflow:t=>`Vrednost mora biti ${t.minValue} ali novej\u0161a.`,unavailableDate:"Izbrani datum ni na voljo."};var BP={};BP={rangeOverflow:t=>`Vrednost mora da bude ${t.maxValue} ili starija.`,rangeReversed:"Datum po\u010Detka mora biti pre datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrednost mora da bude ${t.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."};var RP={};RP={rangeOverflow:t=>`V\xE4rdet m\xE5ste vara ${t.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xE5ste vara f\xF6re slutdatumet.",rangeUnderflow:t=>`V\xE4rdet m\xE5ste vara ${t.minValue} eller senare.`,unavailableDate:"Det valda datumet \xE4r inte tillg\xE4ngligt."};var VP={};VP={rangeOverflow:t=>`De\u011Fer, ${t.maxValue} veya \xF6ncesi olmal\u0131d\u0131r.`,rangeReversed:"Ba\u015Flang\u0131\xE7 tarihi biti\u015F tarihinden \xF6nce olmal\u0131d\u0131r.",rangeUnderflow:t=>`De\u011Fer, ${t.minValue} veya sonras\u0131 olmal\u0131d\u0131r.`,unavailableDate:"Se\xE7ilen tarih kullan\u0131lam\u0131yor."};var NP={};NP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u043F\u0456\u0437\u043D\u0456\u0448\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443 \u043C\u0430\u0454 \u043F\u0435\u0440\u0435\u0434\u0443\u0432\u0430\u0442\u0438 \u0434\u0430\u0442\u0456 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u0440\u0430\u043D\u0456\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var FP={};FP={rangeOverflow:t=>`\u503C\u5FC5\u987B\u662F ${t.maxValue} \u6216\u66F4\u65E9\u65E5\u671F\u3002`,rangeReversed:"\u5F00\u59CB\u65E5\u671F\u5FC5\u987B\u65E9\u4E8E\u7ED3\u675F\u65E5\u671F\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u987B\u662F ${t.minValue} \u6216\u66F4\u665A\u65E5\u671F\u3002`,unavailableDate:"\u6240\u9009\u65E5\u671F\u4E0D\u53EF\u7528\u3002"};var IP={};IP={rangeOverflow:t=>`\u503C\u5FC5\u9808\u662F ${t.maxValue} \u6216\u66F4\u65E9\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u671F\u5FC5\u9808\u5728\u7D50\u675F\u65E5\u671F\u4E4B\u524D\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u9808\u662F ${t.minValue} \u6216\u66F4\u665A\u3002`,unavailableDate:"\u6240\u9078\u65E5\u671F\u7121\u6CD5\u4F7F\u7528\u3002"};var LP={};LP={"ar-AE":aP,"bg-BG":oP,"cs-CZ":sP,"da-DK":uP,"de-DE":cP,"el-GR":dP,"en-US":fP,"es-ES":hP,"et-EE":pP,"fi-FI":mP,"fr-FR":gP,"he-IL":OP,"hr-HR":bP,"hu-HU":yP,"it-IT":vP,"ja-JP":$P,"ko-KR":wP,"lt-LT":xP,"lv-LV":SP,"nb-NO":CP,"nl-NL":kP,"pl-PL":DP,"pt-BR":PP,"pt-PT":EP,"ro-RO":TP,"ru-RU":AP,"sk-SK":QP,"sl-SI":MP,"sr-SP":BP,"sv-SE":RP,"tr-TR":VP,"uk-UA":NP,"zh-CN":FP,"zh-TW":IP};function MI(t){return t&&t.__esModule?t.default:t}u(MI,"$parcel$interopDefault");const zP=new dn(MI(LP));function ZP(){let t=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return t}u(ZP,"$35a22f14a1f04b11$var$getLocale");function Nd(t,e,n,r,i){let l=t!=null&&n!=null&&t.compare(n)>0,a=t!=null&&e!=null&&t.compare(e)<0,o=t!=null&&r?.(t)||!1,s=l||a||o,c=[];if(s){let d=ZP(),f=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||zP,h=new qo(d,f),p=new Rt(d,Br({},i)),m=p.resolvedOptions().timeZone;a&&e!=null&&c.push(h.format("rangeUnderflow",{minValue:p.format(e.toDate(m))})),l&&n!=null&&c.push(h.format("rangeOverflow",{maxValue:p.format(n.toDate(m))})),o&&c.push(h.format("unavailableDate"))}return{isInvalid:s,validationErrors:c,validationDetails:{badInput:o,customError:!1,patternMismatch:!1,rangeOverflow:l,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!s}}}u(Nd,"$35a22f14a1f04b11$export$f18627323ab57ac0");function BI(t,e,n,r,i){var l;let a=Nd((l=t?.start)!==null&&l!==void 0?l:null,e,n,r,i);var o;let s=Nd((o=t?.end)!==null&&o!==void 0?o:null,e,n,r,i),c=Sd(a,s);if(t?.end!=null&&t.start!=null&&t.end.compare(t.start)<0){let d=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||zP;c=Sd(c,{isInvalid:!0,validationErrors:[d.getStringForLocale("rangeReversed",ZP())],validationDetails:{...xd,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return c}u(BI,"$35a22f14a1f04b11$export$80ff8fc0ae339c13");const RI={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},VI={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function Br(t,e){t={...e.shouldForceLeadingZeros?VI:RI,...t};let r=e.granularity||"minute",i=Object.keys(t);var l;let a=i.indexOf((l=e.maxGranularity)!==null&&l!==void 0?l:"year");a<0&&(a=0);let o=i.indexOf(r);if(o<0&&(o=2),a>o)throw new Error("maxGranularity must be greater than granularity");let s=i.slice(a,o+1).reduce((d,f)=>(d[f]=t[f],d),{});return e.hourCycle!=null&&(s.hour12=e.hourCycle===12),s.timeZone=e.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&e.timeZone&&!e.hideTimeZone&&(s.timeZoneName="short"),e.showEra&&a===0&&(s.era="short"),s}u(Br,"$35a22f14a1f04b11$export$7e319ea407e63bc0");function Qa(t){return t&&"hour"in t?t:new Tr}u(Qa,"$35a22f14a1f04b11$export$c5221a78ef73c5e9");function XP(t,e){if(t===null)return null;if(t)return Ne(t,e)}u(XP,"$35a22f14a1f04b11$export$61a490a80c552550");function ys(t,e,n,r){if(t)return XP(t,n);let i=Ne(V3(r??kr()).set({hour:0,minute:0,second:0,millisecond:0}),n);return e==="year"||e==="month"||e==="day"?vt(i):r?i:Pn(i)}u(ys,"$35a22f14a1f04b11$export$66aa2b09de4b1ea5");function v0(t,e){let n=t&&"timeZone"in t?t.timeZone:void 0,r=t&&"minute"in t?"minute":"day";if(t&&e&&!(e in t))throw new Error("Invalid granularity "+e+" for value "+t.toString());let[i,l]=(0,wp.element.useState)([r,n]);t&&(i[0]!==r||i[1]!==n)&&l([r,n]),e||(e=t?r:i[0]);let a=t?n:i[1];return[e,a]}u(v0,"$35a22f14a1f04b11$export$2440da353cedad43");function NI(t){let e=pi(t),[n,r]=je(t.value,t.defaultValue||null,t.onChange),[i]=(0,wp.element.useState)(n),l=n||t.placeholderValue||null,[a,o]=v0(l,t.granularity),s=n!=null?n.toDate(o??"UTC"):null,c=a==="hour"||a==="minute"||a==="second";var d;let f=(d=t.shouldCloseOnSelect)!==null&&d!==void 0?d:!0,[h,p]=(0,wp.element.useState)(null),[m,g]=(0,wp.element.useState)(null);if(n&&(h=n,"hour"in n&&(m=n)),l&&!(a in l))throw new Error("Invalid granularity "+a+" for value "+l.toString());let O=n?.calendar.identifier==="gregory"&&n.era==="BC",b=(0,wp.element.useMemo)(()=>({granularity:a,timeZone:o,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:O}),[a,t.hourCycle,t.shouldForceLeadingZeros,o,t.hideTimeZone,O]),{minValue:y,maxValue:$,isDateUnavailable:v}=t,S=(0,wp.element.useMemo)(()=>Nd(n,y,$,v,b),[n,y,$,v,b]),x=Yn({...t,value:n,builtinValidation:S}),C=x.displayValidation.isInvalid,Q=t.validationState||(C?"invalid":null),T=u((A,E)=>{r("timeZone"in E?E.set(vt(A)):Pn(A,E)),p(null),g(null),x.commitValidation()},"commitValue"),B=u(A=>{let E=typeof f=="function"?f():f;c?m||E?T(A,m||Qa(t.defaultValue||t.placeholderValue)):p(A):(r(A),x.commitValidation()),E&&e.setOpen(!1)},"selectDate"),w=u(A=>{h&&A?T(h,A):g(A)},"selectTime");var M;return{...x,value:n,defaultValue:(M=t.defaultValue)!==null&&M!==void 0?M:i,setValue:r,dateValue:h,timeValue:m,setDateValue:B,setTimeValue:w,granularity:a,hasTime:c,...e,setOpen(A){!A&&!n&&h&&c&&T(h,m||Qa(t.defaultValue||t.placeholderValue)),e.setOpen(A)},validationState:Q,isInvalid:C,formatValue(A,E){if(!s)return"";let I=Br(E,b);return new Rt(A,I).format(s)},getDateFormatter(A,E){let I={...b,...E},D=Br({},I);return new Rt(A,D)}}}u(NI,"$ab5bf3f618090389$export$87194bb378cc3ac2");const FI=new dn({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"\u12D3\u12D3\u12D3\u12D3",month:"\u121A\u121C",day:"\u1240\u1240"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"\u0633\u0646\u0629",month:"\u0634\u0647\u0631",day:"\u064A\u0648\u0645"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bg:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bn:{year:"yyyy",month:"\u09AE\u09BF\u09AE\u09BF",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"\u0633\u0627\u06B5",month:"\u0645\u0627\u0646\u06AF",day:"\u0695\u06C6\u0698"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"\u017A\u017A"},el:{year:"\u03B5\u03B5\u03B5\u03B5",month:"\u03BC\u03BC",day:"\u03B7\u03B7"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"\u0633\u0627\u0644",month:"\u0645\u0627\u0647",day:"\u0631\u0648\u0632"},ff:{year:"hhhh",month:"ll",day:"\xF1\xF1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"\u05E9\u05E0\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",day:"\u05D9\u05D5\u05DD"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xE9\xE9\xE9\xE9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"\u5E74",month:"\u6708",day:"\u65E5"},ka:{year:"\u10EC\u10EC\u10EC\u10EC",month:"\u10D7\u10D7",day:"\u10E0\u10E0"},kk:{year:"\u0436\u0436\u0436\u0436",month:"\u0430\u0430",day:"\u043A\u043A"},kn:{year:"\u0CB5\u0CB5\u0CB5\u0CB5",month:"\u0CAE\u0CBF\u0CAE\u0CC0",day:"\u0CA6\u0CBF\u0CA6\u0CBF"},ko:{year:"\uC5F0\uB3C4",month:"\uC6D4",day:"\uC77C"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"\u0E9B\u0E9B\u0E9B\u0E9B",month:"\u0E94\u0E94",day:"\u0EA7\u0EA7"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"\u0D35\u0D7C\u0D37\u0D02",month:"\u0D2E\u0D3E\u0D38\u0D02",day:"\u0D24\u0D40\u0D2F\u0D24\u0D3F"},ms:{year:"tttt",month:"mm",day:"hh"},nb:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},no:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sv:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"\u0441\u0441\u0441\u0441",month:"\u043C\u043C",day:"\u0440\u0440"},th:{year:"\u0E1B\u0E1B\u0E1B\u0E1B",month:"\u0E14\u0E14",day:"\u0E27\u0E27"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"\u0440\u0440\u0440\u0440",month:"\u043C\u043C",day:"\u0434\u0434"},"zh-CN":{year:"\u5E74",month:"\u6708",day:"\u65E5"},"zh-TW":{year:"\u5E74",month:"\u6708",day:"\u65E5"}},"en");function II(t,e,n){return t==="era"||t==="dayPeriod"?e:t==="year"||t==="month"||t==="day"?FI.getStringForLocale(t,n):"\u2013\u2013"}u(II,"$3e3ed55ab2966714$export$d3f5c5e0a5023fa0");const Fd={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},jP={year:5,month:2,day:7,hour:2,minute:15,second:15},qP={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function WP(t){let{locale:e,createCalendar:n,hideTimeZone:r,isDisabled:i=!1,isReadOnly:l=!1,isRequired:a=!1,minValue:o,maxValue:s,isDateUnavailable:c}=t,d=t.value||t.defaultValue||t.placeholderValue||null,[f,h]=v0(d,t.granularity),p=h||"UTC";if(d&&!(f in d))throw new Error("Invalid granularity "+f+" for value "+d.toString());let m=(0,wp.element.useMemo)(()=>new Rt(e),[e]),g=(0,wp.element.useMemo)(()=>n(m.resolvedOptions().calendar),[n,m]);var O;let[b,y]=je(t.value,(O=t.defaultValue)!==null&&O!==void 0?O:null,t.onChange),[$]=(0,wp.element.useState)(b),v=(0,wp.element.useMemo)(()=>{var K;return(K=XP(b,g))!==null&&K!==void 0?K:null},[b,g]),[S,x]=(0,wp.element.useState)(()=>ys(t.placeholderValue,f,g,h)),C=v||S,Q=g.identifier==="gregory"&&C.era==="BC",T=(0,wp.element.useMemo)(()=>{var K;return{granularity:f,maxGranularity:(K=t.maxGranularity)!==null&&K!==void 0?K:"year",timeZone:h,hideTimeZone:r,hourCycle:t.hourCycle,showEra:Q,shouldForceLeadingZeros:t.shouldForceLeadingZeros}},[t.maxGranularity,f,t.hourCycle,t.shouldForceLeadingZeros,h,r,Q]),B=(0,wp.element.useMemo)(()=>Br({},T),[T]),w=(0,wp.element.useMemo)(()=>new Rt(e,B),[e,B]),M=(0,wp.element.useMemo)(()=>w.resolvedOptions(),[w]),A=(0,wp.element.useMemo)(()=>w.formatToParts(new Date).filter(K=>Fd[K.type]).reduce((K,W)=>(K[qP[W.type]||W.type]=!0,K),{}),[w]),[E,I]=(0,wp.element.useState)(()=>t.value||t.defaultValue?{...A}:{}),D=(0,wp.element.useRef)(null),P=(0,wp.element.useRef)(g);(0,wp.element.useEffect)(()=>{od(g,P.current)||(P.current=g,x(K=>Object.keys(E).length>0?Ne(K,g):ys(t.placeholderValue,f,g,h)))},[g,f,E,h,t.placeholderValue]),b&&Object.keys(E).length=Object.keys(A).length?v:S,L=u(K=>{if(t.isDisabled||t.isReadOnly)return;let W=Object.keys(E),Z=Object.keys(A);K==null?(y(null),x(ys(t.placeholderValue,f,g,h)),I({})):W.length===0&&D.current==null||W.length>=Z.length||W.length===Z.length-1&&A.dayPeriod&&!E.dayPeriod&&D.current!=="dayPeriod"?(W.length===0&&(E={...A},I(E)),K=Ne(K,d?.calendar||new tt),y(K)):x(K),D.current=null},"setValue"),k=(0,wp.element.useMemo)(()=>R.toDate(p),[R,p]),F=(0,wp.element.useMemo)(()=>LI(k,E,w,M,R,g,e,f),[k,E,w,M,R,g,e,f]);A.era&&E.year&&!E.era?(E.era=!0,I({...E})):!A.era&&E.era&&(delete E.era,I({...E}));let N=u(K=>{E[K]=!0,K==="year"&&A.era&&(E.era=!0),I({...E})},"markValid"),z=u((K,W)=>{if(E[K])L(zI(R,K,W,M));else{N(K);let Z=Object.keys(E),ee=Object.keys(A);(Z.length>=ee.length||Z.length===ee.length-1&&A.dayPeriod&&!E.dayPeriod)&&L(R)}},"adjustSegment"),G=(0,wp.element.useMemo)(()=>Nd(b,o,s,c,T),[b,o,s,c,T]),le=Yn({...t,value:b,builtinValidation:G}),ie=le.displayValidation.isInvalid,me=t.validationState||(ie?"invalid":null);var ve,ce;return{...le,value:v,defaultValue:(ve=t.defaultValue)!==null&&ve!==void 0?ve:$,dateValue:k,calendar:g,setValue:L,segments:F,dateFormatter:w,validationState:me,isInvalid:ie,granularity:f,maxGranularity:(ce=t.maxGranularity)!==null&&ce!==void 0?ce:"year",isDisabled:i,isReadOnly:l,isRequired:a,increment(K){z(K,1)},decrement(K){z(K,-1)},incrementPage(K){z(K,jP[K]||1)},decrementPage(K){z(K,-(jP[K]||1))},setSegment(K,W){N(K),L(ZI(R,K,W,M))},confirmPlaceholder(){if(t.isDisabled||t.isReadOnly)return;let K=Object.keys(E),W=Object.keys(A);K.length===W.length-1&&A.dayPeriod&&!E.dayPeriod&&(E={...A},I(E),L(R.copy()))},clearSegment(K){delete E[K],D.current=K,I({...E});let W=ys(t.placeholderValue,f,g,h),Z=R;if(K==="dayPeriod"&&"hour"in R&&"hour"in W){let ee=R.hour>=12,De=W.hour>=12;ee&&!De?Z=R.set({hour:R.hour-12}):!ee&&De&&(Z=R.set({hour:R.hour+12}))}else K==="hour"&&"hour"in R&&R.hour>=12&&E.dayPeriod?Z=R.set({hour:W.hour+12}):K in R&&(Z=R.set({[K]:W[K]}));y(null),L(Z)},formatValue(K){if(!v)return"";let W=Br(K,T);return new Rt(e,W).format(k)},getDateFormatter(K,W){let Z={...T,...W},ee=Br({},Z);return new Rt(K,ee)}}}u(WP,"$3c0fc76039f1c516$export$60e84778edff6d26");function LI(t,e,n,r,i,l,a,o){let s=["hour","minute","second"],c=n.formatToParts(t),d=[];for(let f of c){let h=qP[f.type]||f.type,p=Fd[h];h==="era"&&l.getEras().length===1&&(p=!1);let m=Fd[h]&&!e[h],g=Fd[h]?II(h,f.value,a):null,O={type:h,text:m?g:f.value,...Id(i,h,r),isPlaceholder:m,placeholder:g,isEditable:p};h==="hour"?(d.push({type:"literal",text:"\u2066",...Id(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(O),h===o&&d.push({type:"literal",text:"\u2069",...Id(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(h)&&h===o?(d.push(O),d.push({type:"literal",text:"\u2069",...Id(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(O)}return d}u(LI,"$3c0fc76039f1c516$var$processSegments");function Id(t,e,n){switch(e){case"era":{let r=t.calendar.getEras();return{value:r.indexOf(t.era),minValue:0,maxValue:r.length-1}}case"year":return{value:t.year,minValue:1,maxValue:t.calendar.getYearsInEra(t)};case"month":return{value:t.month,minValue:FR(t),maxValue:t.calendar.getMonthsInYear(t)};case"day":return{value:t.day,minValue:IR(t),maxValue:t.calendar.getDaysInMonth(t)}}if("hour"in t)switch(e){case"dayPeriod":return{value:t.hour>=12?12:0,minValue:0,maxValue:12};case"hour":if(n.hour12){let r=t.hour>=12;return{value:t.hour,minValue:r?12:0,maxValue:r?23:11}}return{value:t.hour,minValue:0,maxValue:23};case"minute":return{value:t.minute,minValue:0,maxValue:59};case"second":return{value:t.second,minValue:0,maxValue:59}}return{}}u(Id,"$3c0fc76039f1c516$var$getSegmentLimits");function zI(t,e,n,r){switch(e){case"era":case"year":case"month":case"day":return t.cycle(e,n,{round:e==="year"})}if("hour"in t)switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return t.set({hour:l?i-12:i+12})}case"hour":case"minute":case"second":return t.cycle(e,n,{round:e!=="hour",hourCycle:r.hour12?12:24})}throw new Error("Unknown segment: "+e)}u(zI,"$3c0fc76039f1c516$var$addSegment");function ZI(t,e,n,r){switch(e){case"day":case"month":case"year":case"era":return t.set({[e]:n})}if("hour"in t&&typeof n=="number")switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return n>=12===l?t:t.set({hour:l?i-12:i+12})}case"hour":if(r.hour12){let l=t.hour>=12;!l&&n===12&&(n=0),l&&n<12&&(n+=12)}case"minute":case"second":return t.set({[e]:n})}throw new Error("Unknown segment: "+e)}u(ZI,"$3c0fc76039f1c516$var$setSegment");function XI(t){var e,n;let r=pi(t),[i,l]=je(t.value,t.defaultValue||null,t.onChange),[a]=(0,wp.element.useState)(i),[o,s]=(0,wp.element.useState)(()=>i||{start:null,end:null});i==null&&o.start&&o.end&&(o={start:null,end:null},s(o));let c=i||o,d=u(R=>{c=R||{start:null,end:null},s(c),al(c)?l(c):l(null)},"setValue"),f=c?.start||c?.end||t.placeholderValue||null,[h,p]=v0(f,t.granularity),m=h==="hour"||h==="minute"||h==="second";var g;let O=(g=t.shouldCloseOnSelect)!==null&&g!==void 0?g:!0,[b,y]=(0,wp.element.useState)(null),[$,v]=(0,wp.element.useState)(null);c&&al(c)&&(b=c,"hour"in c.start&&($=c));let S=u((R,L)=>{d({start:"timeZone"in L.start?L.start.set(vt(R.start)):Pn(R.start,L.start),end:"timeZone"in L.end?L.end.set(vt(R.end)):Pn(R.end,L.end)}),y(null),v(null),E.commitValidation()},"commitValue"),x=u(R=>{let L=typeof O=="function"?O():O;m?al(R)&&(L||$?.start&&$?.end)?S(R,{start:$?.start||Qa(t.placeholderValue),end:$?.end||Qa(t.placeholderValue)}):y(R):al(R)?(d(R),E.commitValidation()):y(R),L&&r.setOpen(!1)},"setDateRange"),C=u(R=>{al(b)&&al(R)?S(b,R):v(R)},"setTimeRange"),Q=(c==null||(e=c.start)===null||e===void 0?void 0:e.calendar.identifier)==="gregory"&&c.start.era==="BC"||(c==null||(n=c.end)===null||n===void 0?void 0:n.calendar.identifier)==="gregory"&&c.end.era==="BC",T=(0,wp.element.useMemo)(()=>({granularity:h,timeZone:p,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:Q}),[h,t.hourCycle,t.shouldForceLeadingZeros,p,t.hideTimeZone,Q]),{minValue:B,maxValue:w,isDateUnavailable:M}=t,A=(0,wp.element.useMemo)(()=>BI(c,B,w,M,T),[c,B,w,M,T]),E=Yn({...t,value:i,name:(0,wp.element.useMemo)(()=>[t.startName,t.endName].filter(R=>R!=null),[t.startName,t.endName]),builtinValidation:A}),I=E.displayValidation.isInvalid,D=t.validationState||(I?"invalid":null);var P;return{...E,value:c,defaultValue:(P=t.defaultValue)!==null&&P!==void 0?P:a,setValue:d,dateRange:b,timeRange:$,granularity:h,hasTime:m,setDate(R,L){var k,F;x(R==="start"?{start:L,end:(k=b?.end)!==null&&k!==void 0?k:null}:{start:(F=b?.start)!==null&&F!==void 0?F:null,end:L})},setTime(R,L){var k,F;C(R==="start"?{start:L,end:(k=$?.end)!==null&&k!==void 0?k:null}:{start:(F=$?.start)!==null&&F!==void 0?F:null,end:L})},setDateTime(R,L){var k,F;d(R==="start"?{start:L,end:(k=c?.end)!==null&&k!==void 0?k:null}:{start:(F=c?.start)!==null&&F!==void 0?F:null,end:L})},setDateRange:x,setTimeRange:C,...r,setOpen(R){!R&&!(c?.start&&c?.end)&&al(b)&&m&&S(b,{start:$?.start||Qa(t.placeholderValue),end:$?.end||Qa(t.placeholderValue)}),r.setOpen(R)},validationState:D,isInvalid:I,formatValue(R,L){if(!c||!c.start||!c.end)return null;let k="timeZone"in c.start?c.start.timeZone:void 0,F=t.granularity||(c.start&&"minute"in c.start?"minute":"day"),N="timeZone"in c.end?c.end.timeZone:void 0,z=t.granularity||(c.end&&"minute"in c.end?"minute":"day"),G=Br(L,{granularity:F,timeZone:k,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,showEra:c.start.calendar.identifier==="gregory"&&c.start.era==="BC"||c.end.calendar.identifier==="gregory"&&c.end.era==="BC"}),le=c.start.toDate(k||"UTC"),ie=c.end.toDate(N||"UTC"),me=new Rt(R,G),ve;if(k===N&&F===z&&c.start.compare(c.end)!==0){try{let ce=me.formatRangeToParts(le,ie),K=-1;for(let ee=0;eeK&&(Z+=ce[ee].value);return{start:W,end:Z}}catch{}ve=me}else{let ce=Br(L,{granularity:z,timeZone:N,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle});ve=new Rt(R,ce)}return{start:me.format(le),end:ve.format(ie)}},getDateFormatter(R,L){let k={...T,...L},F=Br({},k);return new Rt(R,F)}}}u(XI,"$93c38a5e28be6249$export$e50a61c1de9f574");function al(t){return t?.start!=null&&t.end!=null}u(al,"$93c38a5e28be6249$var$isCompleteRange");function jI(t){let{placeholderValue:e=new Tr,minValue:n,maxValue:r,defaultValue:i,granularity:l,validate:a}=t,[o,s]=je(t.value,i??null,t.onChange),c=o||e,d=c&&"day"in c?c:void 0,f=i&&"timeZone"in i?i.timeZone:void 0,h=(0,wp.element.useMemo)(()=>{let v=c&&"timeZone"in c?c.timeZone:void 0;return(v||f)&&e?K3(Ma(e),v||f):Ma(e)},[e,c,f]),p=(0,wp.element.useMemo)(()=>Ma(n,d),[n,d]),m=(0,wp.element.useMemo)(()=>Ma(r,d),[r,d]),g=(0,wp.element.useMemo)(()=>o&&"day"in o?Y3(o):o,[o]),O=(0,wp.element.useMemo)(()=>o==null?null:Ma(o),[o]),b=(0,wp.element.useMemo)(()=>i==null?null:Ma(i),[i]);return{...WP({...t,value:O,defaultValue:b,minValue:p,maxValue:m,onChange:u(v=>{s(d||f?v:v&&Y3(v))},"onChange"),granularity:l||"minute",maxGranularity:"hour",placeholderValue:h??void 0,createCalendar:()=>new tt,validate:(0,wp.element.useCallback)(()=>a?.(o),[a,o])}),timeValue:g}}u(jI,"$eff5d8ee529ac4bb$export$fd53cef0cc796101");function Ma(t,e=Cr(kr())){return t?"day"in t?t:Pn(e,t):null}u(Ma,"$eff5d8ee529ac4bb$var$convertValue");function qI(t,e){let{cursor:n,getKey:r}=t;return{setSelectedKeys(i){e(l=>({...l,selectedKeys:i}))},addKeysToSelection(i){e(l=>l.selectedKeys==="all"?l:i==="all"?{...l,selectedKeys:"all"}:{...l,selectedKeys:new Set([...l.selectedKeys,...i])})},removeKeysFromSelection(i){e(l=>{if(i==="all")return{...l,selectedKeys:new Set};let a=l.selectedKeys==="all"?new Set(l.items.map(r)):new Set(l.selectedKeys);for(let o of i)a.delete(o);return{...l,selectedKeys:a}})},setFilterText(i){e(l=>({...l,filterText:i}))},insert(i,...l){e(a=>vs(a,i,...l))},insertBefore(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return vs(a,o,...l)})},insertAfter(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return vs(a,o+1,...l)})},prepend(...i){e(l=>vs(l,0,...i))},append(...i){e(l=>vs(l,l.items.length,...i))},remove(...i){e(l=>{let a=new Set(i),o=l.items.filter(c=>!a.has(r(c))),s="all";if(l.selectedKeys!=="all"){s=new Set(l.selectedKeys);for(let c of i)s.delete(c)}return n==null&&o.length===0&&(s=new Set),{...l,items:o,selectedKeys:s}})},removeSelectedItems(){e(i=>{if(i.selectedKeys==="all")return{...i,items:[],selectedKeys:new Set};let l=i.selectedKeys,a=i.items.filter(o=>!l.has(r(o)));return{...i,items:a,selectedKeys:new Set}})},move(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let s=a.items.slice(),[c]=s.splice(o,1);return s.splice(l,0,c),{...a,items:s}})},moveBefore(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return YP(a,c,o)})},moveAfter(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return YP(a,c,o+1)})},update(i,l){e(a=>{let o=a.items.findIndex(s=>r(s)===i);return o===-1?a:{...a,items:[...a.items.slice(0,o),l,...a.items.slice(o+1)]}})}}}u(qI,"$0d86e9c8f07f9a7b$export$79c0c687a5963b0a");function vs(t,e,...n){return{...t,items:[...t.items.slice(0,e),...n,...t.items.slice(e)]}}u(vs,"$0d86e9c8f07f9a7b$var$insert");function YP(t,e,n){n-=e.filter(l=>l({from:l,to:n++}));for(let l=0;la&&r[o].from--}for(let l=0;ll;o--){let s=r[o];s.fromf.id||f.key,"getKey"),initialFilterText:a=""}=t;let[o,s]=(0,wp.element.useReducer)(WI,{state:"idle",error:void 0,items:[],selectedKeys:r==="all"?"all":new Set(r),sortDescriptor:i,filterText:a});const c=u(async(f,h)=>{let p=new AbortController;try{s({...f,abortController:p});var m;let b=(m=f.filterText)!==null&&m!==void 0?m:o.filterText;var g;let y=await h({items:o.items.slice(),selectedKeys:o.selectedKeys,sortDescriptor:(g=f.sortDescriptor)!==null&&g!==void 0?g:o.sortDescriptor,signal:p.signal,cursor:f.type==="loadingMore"?o.cursor:void 0,filterText:b,loadingState:o.state});var O;let $=(O=y.filterText)!==null&&O!==void 0?O:b;s({type:"success",...y,abortController:p}),$&&$!==b&&!p.signal.aborted&&c({type:"filtering",filterText:$},e)}catch(b){s({type:"error",error:b,abortController:p})}},"dispatchFetch");let d=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{d.current||(c({type:"loading"},e),d.current=!0)},[]),{items:o.items,selectedKeys:o.selectedKeys,sortDescriptor:o.sortDescriptor,isLoading:o.state==="loading"||o.state==="loadingMore"||o.state==="sorting"||o.state==="filtering",loadingState:o.state,error:o.error,filterText:o.filterText,getItem(f){return o.items.find(h=>l(h)===f)},reload(){c({type:"loading"},e)},loadMore(){o.state==="loading"||o.state==="loadingMore"||o.state==="filtering"||o.cursor==null||c({type:"loadingMore"},e)},sort(f){c({type:"sorting",sortDescriptor:f},n||e)},...qI({...t,getKey:l,cursor:o.cursor},f=>{s({type:"update",updater:f})}),setFilterText(f){c({type:"filtering",filterText:f},e)}}}u(YI,"$f86e6c1ec7da6ebb$export$bc3384a35de93d66");let KI=Math.round(Math.random()*1e10),UI=0;function KP(t){let e=(0,wp.element.useMemo)(()=>t.name||`radio-group-${KI}-${++UI}`,[t.name]);var n;let[r,i]=je(t.value,(n=t.defaultValue)!==null&&n!==void 0?n:null,t.onChange),[l]=(0,wp.element.useState)(r),[a,o]=(0,wp.element.useState)(null),s=Yn({...t,value:r}),c=u(h=>{!t.isReadOnly&&!t.isDisabled&&(i(h),s.commitValidation())},"setSelectedValue"),d=s.displayValidation.isInvalid;var f;return{...s,name:e,selectedValue:r,defaultSelectedValue:t.value!==void 0?l:(f=t.defaultValue)!==null&&f!==void 0?f:null,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:t.isDisabled||!1,isReadOnly:t.isReadOnly||!1,isRequired:t.isRequired||!1,validationState:t.validationState||(d?"invalid":null),isInvalid:d}}u(KP,"$a54cdc5c1942b639$export$bca9d026f8e704eb");function GI(t){let{selectionMode:e="single"}=t,n=pi(t),[r,i]=(0,wp.element.useState)(null),l=(0,wp.element.useMemo)(()=>{var v;return t.defaultValue!==void 0?t.defaultValue:e==="single"?(v=t.defaultSelectedKey)!==null&&v!==void 0?v:null:[]},[t.defaultValue,t.defaultSelectedKey,e]),a=(0,wp.element.useMemo)(()=>t.value!==void 0?t.value:e==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,e]),[o,s]=je(a,l,t.onChange),c=e==="single"&&Array.isArray(o)?o[0]:o,d=u(v=>{if(e==="single"){var S,x;let C=Array.isArray(v)?(x=v[0])!==null&&x!==void 0?x:null:v;s(C),C!==c&&((S=t.onSelectionChange)===null||S===void 0||S.call(t,C))}else{let C=[];Array.isArray(v)?C=v:v!=null&&(C=[v]),s(C)}},"setValue"),f=y0({...t,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:(0,wp.element.useMemo)(()=>_I(c),[c]),onSelectionChange:v=>{if(v!=="all"){if(e==="single"){var S;let x=(S=v.values().next().value)!==null&&S!==void 0?S:null;d(x),n.close()}else d([...v]);m.commitValidation()}}}),h=f.selectionManager.firstSelectedKey,p=(0,wp.element.useMemo)(()=>[...f.selectionManager.selectedKeys].map(v=>f.collection.getItem(v)).filter(v=>v!=null),[f.selectionManager.selectedKeys,f.collection]),m=Yn({...t,value:Array.isArray(c)&&c.length===0?null:c}),[g,O]=(0,wp.element.useState)(!1),[b]=(0,wp.element.useState)(c);var y,$;return{...m,...f,...n,value:c,defaultValue:l??b,setValue:d,selectedKey:h,setSelectedKey:d,selectedItem:(y=p[0])!==null&&y!==void 0?y:null,selectedItems:p,defaultSelectedKey:($=t.defaultSelectedKey)!==null&&$!==void 0?$:t.selectionMode==="single"?b:null,focusStrategy:r,open(v=null){f.collection.size!==0&&(i(v),n.open())},toggle(v=null){f.collection.size!==0&&(i(v),n.toggle())},isFocused:g,setFocused:O}}u(GI,"$2bc3a590c5373a4e$export$5159ec8b34d4ec12");function _I(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}u(_I,"$2bc3a590c5373a4e$var$convertValue");var HI=Object.defineProperty,JI=u((t,e)=>HI(t,"name",{value:e,configurable:!0}),"n$o");const $s=JI(t=>{const e=t.content??t.children,n=pi(t),{triggerProps:r,overlayProps:i}=us({type:"dialog"},n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(se,{...r,type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},t.label??"Open modal"),n.isOpen&&wp.element.createElement(kI,{className:"tf-modal",state:n},wp.element.createElement(gs,{title:t.title,...i},e,wp.element.createElement("div",{className:"tf-modal-actions"},wp.element.createElement(se,{type:"danger",onPress:()=>{n.close(),t.onValidate&&t.onValidate()}},t.confirmText??t.label),wp.element.createElement(se,{type:"action",onPress:()=>{n.close(),t.onCancel&&t.onCancel()}},t.cancelText??"Cancel")))))},"ModalTrigger");var eL=Object.defineProperty,tL=u((t,e)=>eL(t,"name",{value:e,configurable:!0}),"s$i");function UP({message:t,type:e,onDismiss:n}){return wp.element.createElement("div",{className:`tf-notice ${e} tf-is-dismissible`},wp.element.createElement("p",null,t),wp.element.createElement("button",{type:"button",className:"tf-notice-dismiss",onClick:n}))}u(UP,"n$n"),tL(UP,"Notice");var nL=Object.defineProperty,rL=u((t,e)=>nL(t,"name",{value:e,configurable:!0}),"i$o");function Rr({children:t,state:e,style:n,className:r="",...i}){const l=wp.element.useRef(null),{popoverProps:a,underlayProps:o}=WN({...i,popoverRef:l},e),s=wp.element.useContext(Zl);return wp.element.createElement(_k,{portalContainer:s.portalContainer},wp.element.createElement("div",{className:s.wrapper},!i.isNonModal&&wp.element.createElement("div",{...o,className:"tf-underlay"}),wp.element.createElement("div",{...a,ref:l,style:{...a.style,...n,zIndex:1e6,boxSizing:"border-box"},className:`tf-popover ${r}`},t,wp.element.createElement(ds,{onDismiss:e.close}))))}u(Rr,"y$6"),rL(Rr,"Popover");var iL=Object.defineProperty,lL=u((t,e)=>iL(t,"name",{value:e,configurable:!0}),"o$i");const Ld=lL(t=>t.choices?wp.element.createElement(nF,{key:t.key??t.name,title:t.label??"",items:t.choices??[]},e=>wp.element.createElement(Qr,{key:e.value??""},e.label??"")):wp.element.createElement(Qr,{key:t.value??""},t.label??""),"RenderChoices");var aL=Object.defineProperty,mi=u((t,e)=>aL(t,"name",{value:e,configurable:!0}),"e$4");const oL=mi(t=>wp.element.createElement("div",{className:"tf-tab-container "+(t.className??"")},t.children),"Container"),sL=mi(t=>wp.element.createElement("div",{className:"tf-tab-header"},wp.element.createElement("div",{className:"tf-tab-items "+(t.className??"")},t.children),t.actions&&wp.element.createElement("div",{className:"tf-tab-actions "+(t.actionsClassName??"")},t.actions)),"Header"),uL=mi(t=>wp.element.createElement("div",{className:"tf-tab-item "+(t.className??""),"data-open":t.isOpen??!1},wp.element.createElement(se,{type:"text-action",onPress:t.onPress},t.children)),"Title"),cL=mi(t=>{const[e,n]=wp.element.useState(t.isActive??!1);if(wp.element.useEffect(()=>{t.isActive!==e&&n(t.isActive)},[t.isActive]),!!e)return wp.element.createElement("div",{className:"tf-tab-content "+(t.className??"")},t.children)},"Content"),dL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row "+(t.className??"")},t.children),"Row"),fL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title tf-tab-row-title-section "+(t.className??"")},t.children),"RowTitle"),hL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title "+(t.className??"")},wp.element.createElement("span",{className:"tf-label"},t.children)),"RowLabel"),pL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-field "+(t.className??"")},t.children),"RowField");var GP=Object.freeze({__proto__:null,Container:oL,Content:cL,Header:sL,Row:dL,RowField:pL,RowLabel:hL,RowTitle:fL,Title:uL}),mL=Object.defineProperty,gL=u((t,e)=>mL(t,"name",{value:e,configurable:!0}),"l$h");const zd=gL(t=>{const e=`h${t.level??"3"}`,n=t.content??t.children;return wp.element.createElement("div",{className:"tf-title"},wp.element.createElement(e,{className:t.className},n))},"Title");var OL=Object.defineProperty,bL=u((t,e)=>OL(t,"name",{value:e,configurable:!0}),"n$k");const yL=bL(t=>{const e=t.content??t.children,n=t.placement??"top",r=t.theme&&t.theme==="dark"?"dark":"light";return wp.element.createElement("div",{className:`tf-tooltip tf-tooltip-${n}`},wp.element.createElement("div",{className:`tf-tooltip-content tf-tooltip-content-${n} ${r}`},e))},"Tooltip");var vL=Object.defineProperty,_P=u((t,e)=>vL(t,"name",{value:e,configurable:!0}),"n$j");const $L=_P(t=>{const e=t.layout??"button",n=t.label??"Open tooltip",r=t.children??!1;return wp.element.createElement("div",{className:"tf-tooltip-trigger"},wp.element.createElement("div",{className:"tf-tooltip-trigger-content"},r||_P(()=>e==="button"?wp.element.createElement(se,{type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},n):wp.element.createElement("span",null,n),"renderContent")(),wp.element.createElement(yL,{...t})))},"TooltipTrigger");var wL=Object.defineProperty,xL=u((t,e)=>wL(t,"name",{value:e,configurable:!0}),"t$b");const SL=xL(({content:t,children:e})=>wp.element.createElement(wp.element.Fragment,null,t??e),"Wrapper");var CL=Object.defineProperty,ol=u((t,e)=>CL(t,"name",{value:e,configurable:!0}),"o$f");const HP=ol(t=>{const e={},n=["sectionTitle"],r=t.dependent?.callback??!1,i=t.dependent?.callbackData??!1;for(const l in t){if(n.includes(l))continue;const a=t[l];if(a&&typeof a=="object"&&!Array.isArray(a)){const o=HP(a);if(Object.keys(o).length===0)continue;for(const s in o)e[s]||(e[s]={}),e[s][l]={__isWrapped:!0,...o[s]}}if(typeof a=="string")for(const o of eE(a)){const s=DL(o,r,i);s&&(e[s.name]||(e[s.name]={}),e[s.name][l]=s.config)}}return e},"getDependentFields"),kL=ol((t=!0)=>t?/(\{\{.+?}\})/g:/\{\{(.+?)}\}/g,"dependentAttributeRegex"),JP=ol(t=>eE(t).length>0,"isDependentString"),eE=ol((t,e=!0)=>typeof t=="string"?Array.from(t.matchAll(kL(e)),n=>n[1]):[],"getDependentStrings"),DL=ol((t,e,n)=>{if(!JP(t))return!1;const r=t.slice(2,t.length-2).trim();if(!r.includes("."))return{name:r,config:{__returnedType:"full",__callback:e,__callbackData:n}};const[i,l]=r.split(".");return{name:i,config:{__returnedType:"partial",__returnedAttribute:l,__callback:e,__callbackData:n}}},"getDependentValue"),tE=ol((t,e,n,r,i)=>{const l=e.__returnedType==="partial"?n()?.[e.__returnedAttribute]:n();let a=e.__callback??!1;typeof a=="string"&&(a=G1.dependent.__callbacks[a]??!1);const o=a?a({attribute:t,value:l,...e.__callbackData??{}}):l;return typeof o=="string"&&typeof i=="string"?i.replace(e.__returnedType==="partial"?`{{${r}.${e.__returnedAttribute}}}`:`{{${r}}}`,o):o},"getFieldValue"),PL=ol((t,e,n)=>{if(e===!1)return{...t};const r={...t};for(const i in e){const l=e[i];for(const a in l){const o=l[a];if(o.__isWrapped){for(const s in o){if(s==="__isWrapped")continue;const c=tE(s,o[s],()=>n(i),i,r[a][s]);r[a]={...r[a],[s]:c}}continue}r[a]=tE(a,o,()=>n(i),i,r[a])}}return r},"mergeDependentProps");var EL=Object.defineProperty,nE=u((t,e)=>EL(t,"name",{value:e,configurable:!0}),"o$e");const rE=nE(({itemProps:t,refresh:e,data:n,children:r})=>{const i=Object.assign({},t);delete i.value,delete i.onChange,delete i.class,delete i.wrapper;const l=wp.element.useMemo(()=>t.dependent?Object.assign({},HP(t)):!1,[]),a=nE(c=>{!t.dependent||!l||Object.keys(l).includes(c)&&e()},"maybeUpdateProps"),o=wp.element.useCallback(c=>{c.props?.itemType!=="subfield"&&a(c.name)},[]);wp.element.useEffect(()=>{const c=sa("valueChange",o);return()=>cm("valueChange",c)},[o]),wp.element.useEffect(()=>{n.watcher&&n.watcher(c=>{a(c)})},[o]);const s=wp.element.useMemo(()=>PL(i,l,n.getValue),[]);return r(s)},"DependendWrapper");var TL=Object.defineProperty,AL=u((t,e)=>TL(t,"name",{value:e,configurable:!0}),"u$c");const iE=AL(t=>{const e=[];if(t.length===0)return!0;for(const n in t){const r=t[n];if(["_and","_or"].includes(n)){const i=r.map(iE);if(i.length===0){e.push(!1);continue}switch(n){case"_or":e.push(i.filter(Boolean).length>0);break;case"_and":e.push(i.length===i.filter(Boolean).length);break}continue}Object.entries(r).forEach(([i,l])=>{switch(i){case"_eq":e.push(n==l);break;case"_neq":e.push(n!=l);break;case"_lt":e.push(nl);break;case"_lte":e.push(n<=l);break;case"_gte":e.push(n>=l);break;case"_in":e.push(l.includes(n));break;case"_nin":e.push(!l.includes(n));break;case"_contains":e.push(n.includes(l));break;case"_ncontains":e.push(!n.includes(l));break;case"_re":e.push(new RegExp(l).test(n));break;default:e.push(!1)}})}return e.length>0&&e.length===e.filter(Boolean).length},"evaluateCondition");var QL=Object.defineProperty,Zd=u((t,e)=>QL(t,"name",{value:e,configurable:!0}),"i$m");const ML=Zd((t,e)=>(t=typeof t=="object"?lE(t,e):{},iE(t)),"evaluateFieldVisibility"),lE=Zd((t,e)=>{const n={};for(const r in t){if(["_and","_or"].includes(r)){n[r]=t[r].map(l=>lE(l,e));continue}const i=r.includes(".")?BL(r,e):e(r);n[i]=t[r]}return n},"replaceFieldValue"),BL=Zd((t,e)=>{const[n,r]=t.split(".");let i=e(n);if(typeof i=="string")try{i=JSON.parse(i)}catch{return""}return i[r]??""},"getPartialValue"),aE=Zd(t=>{const e=[];for(const n in t){if(["_and","_or"].includes(n)){for(const r in t[n])e.push(aE(t[n][r]));continue}e.push(n)}return e.flat().map(n=>n.split(".")[0])},"getTriggerFields");var RL=Object.defineProperty,oE=u((t,e)=>RL(t,"name",{value:e,configurable:!0}),"o$d");const sE=oE(({visibility:t,data:e,...n})=>{const[r,i]=wp.element.useState(!1),l=oE(()=>{if(!t.condition){i(!0);return}const o=e.getValue??control.getValue,s=ML(t.condition,o);i(t.action!=="hide"?s:!s)},"evaluateVisibility");wp.element.useEffect(()=>{l(),!(!t.condition||!a)&&(sa("valueChange",o=>{o.props?.itemType!=="subfield"&&a.includes(o.name)&&setTimeout(l)}),e.watcher&&e.watcher(o=>{a.includes(o)&&l()}),sa("evaluateVisibility",()=>l()))},[]);const a=wp.element.useMemo(()=>t.condition?aE(t.condition):!1,[]);return r?n.children:wp.element.createElement(wp.element.Fragment,null)},"VisibilityWrapper");var VL=Object.defineProperty,Xd=u((t,e)=>VL(t,"name",{value:e,configurable:!0}),"r$a");const uE=Xd(({children:t,itemType:e,setValue:n=!1,name:r})=>{const[i,l]=wp.element.useState(0),a=Xd(()=>l(i+1),"refreshRender"),o=Xd(c=>{!r||r!==c.name||(a(),n&&n(c.value))},"fieldValueChanged"),s=Xd(c=>{c===r&&a()},"maybeRerender");return wp.element.useEffect(()=>{if(e!=="field")return;const c=sa("_refreshFieldValue",o),d=sa("_fieldRerender",s);return()=>{cm("_refreshFieldValue",c),cm("_fieldRerender",d)}},[i]),wp.element.createElement(wp.element.Fragment,{key:i},t(a))},"RenderWrapper");var NL=Object.defineProperty,FL=u((t,e)=>NL(t,"name",{value:e,configurable:!0}),"i$l");const $0=FL(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Zl),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class,wp.element.useEffect(()=>{n&&n()},[]);const a=Hr.get(r.type??!1,"element");return a?wp.element.createElement(pk,{...l},wp.element.createElement(sE,{visibility:t,data:e},wp.element.createElement(uE,{itemType:r.itemType??"field",name:r.name??!1},o=>wp.element.createElement(rE,{refresh:o,data:e,itemProps:r},s=>wp.element.createElement(a,{...s,data:e}))))):wp.element.createElement(wp.element.Fragment,null)},"Element");var IL=Object.defineProperty,LL=u((t,e)=>IL(t,"name",{value:e,configurable:!0}),"n$i");const zL=LL(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?$0:hp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...a,...t})},"Item");var cE={common:{add:"Add item",clone:"Clone",delete:"Remove"},layoutOveride:{advanced:{clone:"Duplicate",delete:"Delete"},tab:{add:"+ Add Item"}}},ZL=Object.defineProperty,Vr=u((t,e)=>ZL(t,"name",{value:e,configurable:!0}),"l$c");const dE=Vr(t=>{const e=t.fields??[],n=t.layout&&Object.keys(Hr._types.repeater).includes(t.layout)?t.layout:"table",r=Hr.get(n,"repeater"),i=t.repeatable??!0,l=t.maxlength??1/0,a=e.map(S=>{const x=Object.assign({},S);return n==="table"?(x.labelVisuallyHidden=!0,x.descriptionVisuallyHidden=!0):n==="tab"&&(x.labelVisuallyHidden=!0),delete x.value,delete x.onChange,x}),o={};e.forEach(S=>{o[S.name]=t.newItem?t.newItem[S.name]??"":""});const[s,c]=wp.element.useReducer(K2(o,l,t),t.value??"",S=>U2(S,o)),d=Vr(S=>a.map(x=>x.name??!1).includes(S),"hasField"),[f,h]=wp.element.useState([]),p=Vr((S,x)=>{f.forEach(C=>C(S,x))},"triggerRowCallbackEvents"),m=wp.element.useRef();m.current=s;const g=Vr((S,x,C)=>wp.element.createElement(zL,{key:x.key+C,values:x,config:{...S,repeaterRow:C},onChange:Q=>c({type:"update",item:C,control:S.name,value:Q,callback:()=>p(x.key,S.name)}),data:{getValue:Q=>d(Q)?m.current[C][Q]??"":t.data.getValue(Q??""),watcher:Q=>h(T=>[...T,(B,w)=>{B===x.key&&S.name&&Q(w,x.key)}])}}),"renderItem"),O=Vr(()=>s.map(({_bulkCheckbox:S,...x})=>x),"getSavedValue"),b=Vr(S=>({...cE.common,...cE.layoutOveride[n]??{},...t.strings??{}})[S]??S,"string"),y=Vr(()=>i&&wp.element.createElement("div",{className:"tf-repeater-actions"},wp.element.createElement(se,{type:"action",onPress:()=>c({type:"add"}),isDisabled:l<=s.length},b("add")),wp.element.createElement($s,{title:"Confirmation",label:"Remove all",isDisabled:s.length<=0,onValidate:()=>c({type:"clear"})},"Are you sure you want to clear all item(s)?")),"renderFooterActions"),$=Vr((S,x,C)=>{const Q=typeof t.parts.actions[S]=="string"?Hr.get(t.parts.actions[S],"element"):t.parts.actions[S];return wp.element.createElement(Q,{dispatch:c,item:x,items:s,...C})},"renderCustomComponent"),v=Vr((S,x,C={})=>{if(!i)return wp.element.createElement(wp.element.Fragment,null);if(t?.parts?.actions?.[S])return $(S,x,C);switch(S){case"delete":return wp.element.createElement($s,{label:b("delete"),title:"Confirmation",onValidate:()=>c({type:"remove",item:x}),buttonProps:{type:"danger"},...C},"Are you sure you want to remove item ",x+1,"?");case"clone":return wp.element.createElement(se,{type:"action",isDisabled:l<=s.length,onPress:()=>c({type:"clone",item:s[x]}),...C},b("clone"))}},"renderAction");return wp.element.useEffect(()=>t.onChange&&t.onChange(O()),[s]),wp.element.createElement("div",{className:`tf-repeater tf-repeater-${n}`},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(O())}),t.label&&wp.element.createElement(zd,{level:2,className:"tf-repeater-title"},t.label),wp.element.createElement("div",{className:`tf-repeater-container tf-repeater-${n}-container`},wp.element.createElement(r,{items:s,fields:e,dispatch:c,rowFields:a,headerFields:t.headerFields,renderItem:g,maxLength:i?l:void 0,title:t.sectionTitle??!1,useSwitch:t.useSwitch,useBulk:t.useBulk,afterRow:t.afterRow,beforeRow:t.beforeRow,name:t.name??"",renderFooterActions:y,renderAction:v,parent:t,string:b})))},"Repeater");var XL=Object.defineProperty,fE=u((t,e)=>XL(t,"name",{value:e,configurable:!0}),"o$c");const jL={_eq:"Is",_neq:"Is not",_lt:"Less than",_gt:"Greater than",_lte:"Less than or equal",_gte:"Greater than or equal",_in:"In array",_nin:"Not in array",_contains:"Contains",_ncontains:"Not contain",_re:"Regex"},hE=fE(t=>{const e=t.filter(n=>n.name==="operator")[0]??!1;return!e||typeof e.choices!="object"?"":Object.keys(e.choices)[0]??""},"getInitialOperator"),qL=fE(({dynamic:t,operators:e=void 0,fields:n=void 0})=>n&&n.length>0?n:[{label:"Text",type:"text",name:"left_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0},{label:"Operator",type:"select",name:"operator",choices:e??jL,labelVisuallyHidden:!0},{label:"Text",type:"text",name:"right_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0}],"getFields");var WL=Object.defineProperty,pE=u((t,e)=>WL(t,"name",{value:e,configurable:!0}),"e$2");const YL=pE(t=>wp.element.createElement("div",{className:"tf-conditional-panel-conditions"},wp.element.createElement(dE,{...t,type:"repeater",layout:"bare",afterRow:pE((e,n,r)=>wp.element.createElement("div",{className:"tf-conditional-panel-condition-actions"},wp.element.createElement(se,{type:"action",onPress:()=>r({type:"insert",position:n+1,data:{operator:hE(t.fields)}})},"And"),wp.element.createElement(se,{type:"danger",onPress:()=>r({type:"remove",item:n}),isDisabled:!t.canDelete,contentVisuallyHidden:!0},"Delete condition")),"afterRow"),repeatable:!1})),"ConditionGroup");var KL=Object.defineProperty,ws=u((t,e)=>KL(t,"name",{value:e,configurable:!0}),"i$j");const UL=ws(t=>{const e=wp.element.useMemo(()=>qL(t),[]),n=ws(()=>({key:fi(),data:[{key:fi(),operator:hE(e)}]}),"emptyRow"),r=ws(()=>On(t.value??"",[n()]),"initialValue"),[i,l]=wp.element.useState(r()),[a,o]=wp.element.useState(r());wp.element.useEffect(()=>{t.onChange&&t.onChange(t.useModal?i:a)},[t.useModal?i:a]),wp.element.useEffect(()=>{if(a.length===1)return;const h=a.filter(p=>p.data.length!==0);h.length!==a.length&&o([...h])},[a]);const s=ws(h=>o([...a.slice(0,h),n(),...a.slice(h)]),"insertGroup"),c=ws((h,p)=>{const m=a;m[p].data=h,o([...m])},"updateGroup"),d=t.useModal?$s:wp.element.Fragment,f=t.useModal?{title:"Conditional rules",label:"Open conditional panel",confirmText:"Save",onCancel:()=>{o([...c0(i)])},onValidate:()=>{l([...c0(a)])}}:{};return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(t.useModal?i:a)}),wp.element.createElement("div",{className:"tf-label"},t.label??""),wp.element.createElement(d,{...f},wp.element.createElement("div",{className:"tf-conditional-panel"},wp.element.createElement("div",{className:"tf-conditional-panel-container"},wp.element.createElement("div",{className:"tf-conditional-groups"},a.map((h,p)=>wp.element.createElement("div",{key:h.key,className:"tf-conditional-group"},wp.element.createElement(YL,{canDelete:a.length!==1||h.data.length!==1,value:h.data,onChange:m=>c(m,p),fields:e}),wp.element.createElement("div",{className:"tf-conditional-group-actions"},wp.element.createElement("strong",null,"Or"),wp.element.createElement(se,{type:"primary",onPress:()=>s(p+1)},"Add group")))))))))},"ConditionalPanel");var GL=Object.defineProperty,mE=u((t,e)=>GL(t,"name",{value:e,configurable:!0}),"t$a");const _L=mE(t=>{const[e,n]=wp.element.useState(On(t.value));wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=mE(l=>{n({...e,enabled:l===!0||l==="on"?"on":"off"})},"isEnabled"),i=t.useSwitch?wp.element.createElement("div",{onClick:l=>l.stopPropagation()},wp.element.createElement(K1,{value:e.enabled??"off",onChange:r,label:"Toggle accordion",labelVisuallyHidden:!0})):null;return wp.element.createElement("div",{className:"tf-accordion"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(e)}),wp.element.createElement(_2,{title:t.title??!1,headerLeft:i,behavior:"hide"},wp.element.createElement(Y1,{...t,name:null,fields:t.fields,value:e,onChange:n})))},"Accordion");var HL=Object.defineProperty,JL=u((t,e)=>HL(t,"name",{value:e,configurable:!0}),"t$9");const gE=wp.element.createContext(null),OE=JL(t=>{const e=KP(t),{radioGroupProps:n,labelProps:r,descriptionProps:i}=z2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-radio-group"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("div",{className:"tf-radio-group-container",...n},wp.element.createElement(gE.Provider,{value:e},t.children)),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"RadioGroup");var ez=Object.defineProperty,tz=u((t,e)=>ez(t,"name",{value:e,configurable:!0}),"r$7");const bE=tz(t=>{const e=wp.element.useContext(gE),n=wp.element.useRef(null),{inputProps:r}=L2(t,e,n);return wp.element.createElement("label",{className:"tf-radio"},wp.element.createElement("input",{...r,ref:n}),t.children)},"Radio");var nz=Object.defineProperty,rz=u((t,e)=>nz(t,"name",{value:e,configurable:!0}),"i$h");const iz=rz(t=>{const[e,n]=wp.element.useState(t.value??""),r=["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"];return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement("div",{className:"tf-alignment-matrix"},wp.element.createElement(OE,{...t,onChange:n},wp.element.createElement("div",{className:"tf-alignment-matrix-container"},r.map(i=>wp.element.createElement(bE,{key:i,id:i,value:i},wp.element.createElement(gn,null,i))))))},"AlignmentMatrix");var lz=Object.defineProperty,xs=u((t,e)=>lz(t,"name",{value:e,configurable:!0}),"a$a");const yE=xs(t=>{if(t.config===!1)return t.children;const{dynamics:e}=Zn(),n=wp.element.useRef(),r=wp.element.useRef(),[i,l]=wp.element.useState(!1),[a,o]=wp.element.useState(!1),[s,c]=wp.element.useState({}),[d,f]=wp.element.useState(!1),h=pi({}),{triggerProps:p,overlayProps:m}=us({type:"dialog"},h,n);wp.element.useEffect(()=>{t.isOpen?h.open():h.close()},[t.isOpen]),wp.element.useEffect(()=>{d!==!1&&(t?.onValueSelection(d),f(!1))},[d]);const g=xs(T=>{if(!T)return;const B=e.values[T]?.fields;if(l(T),!Array.isArray(B)||B.length===0)return O(T);o(B)},"saveDynamicValue"),O=xs(T=>{f(t.config.stringify(T,s??!1)),b()},"selectAndClose"),b=xs(()=>{l(!1),o(!1),c(!1),h.close()},"resetAndClose"),y=wp.element.useMemo(()=>{const T=t.config.getTypes();return t.config.getCategories().map(B=>{const w=e.categories[B],M=Object.keys(e.values).filter(A=>w.values.includes(A)&&T.includes(e.values[A]?.type)).reduce((A,E)=>({...A,[E]:e.values[E].label??E}),{});return{name:w.label,choices:M}}).filter(B=>Object.keys(B.choices).length!==0)},[]),$=wp.element.useRef(s),v=xs((T,B)=>{c($.current={...s,[T]:B})},"updateSettings"),S=t.buttonType??"outside",x=!(t.readOnly||t.inputMasking)&&(S==="outside"||!t.remove||t.remove.isDisabled),C=!(t.readOnly||t.inputMasking)&&(S==="outside"||t.remove&&t.remove.isDisabled===!1),Q=`tf-dynamic-wrapper tf-dynamic-wrapper-buttons-${S} ${t.className??""}`;return wp.element.createElement("div",{className:Q,"data-dynamic":"true"},t.children,x&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-insert",ref:n,contentVisuallyHidden:S==="inside",...p},"Insert"),C&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-clear",contentVisuallyHidden:S==="inside",...t.remove},"Clear"),h.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover",ref:r,...m},a?wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-form"},wp.element.createElement(zd,{level:4},"Dynamic value settings"),e.values[i].description&&wp.element.createElement("i",null,e.values[i].description),a.map(T=>wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-field"},wp.element.createElement(hp,{...T,value:s[T.name]??"",onChange:B=>v(T.name,B),visibility:{condition:T.condition?.condition??!1,action:T.condition?.action??"show"},data:{getValue:B=>$.current[B]??""}}))),wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-buttons"},wp.element.createElement(se,{type:"action",onPress:()=>O(i)},"Add"),wp.element.createElement(se,{type:"action",onPress:b},"Close"))):wp.element.createElement(xh,{choices:y,label:"Select dynamic value to insert",labelVisuallyHidden:!0,autoFocus:!0,showButton:!1,onChange:g,onFocusChange:T=>T?!h.isOpen&&h.open():h.close()}),wp.element.createElement(ds,{onDismiss:h.close})))},"BaseWrapper");var az=Object.defineProperty,oz=u((t,e)=>az(t,"name",{value:e,configurable:!0}),"u$9");const Ss=wp.element.forwardRef(({inputProps:t={},...e},n)=>{const[r,i]=wp.element.useState(e.dynamic?e.dynamic.hasValues():!1),l=oz(a=>{const o=e.dynamic.parse(a);return o&&o.type?e.dynamic.getLabel(o.type):""},"getLabel");return wp.element.createElement(yE,{className:"tf-dynamic-field-wrapper",config:e.dynamic??!1,onValueSelection:a=>{i(!0),e.onValueSelection(a)},remove:{isDisabled:r===!1,onPress:()=>{i(!1),e.onValueRemove&&e.onValueRemove()}},buttonType:e.buttonType??"outside",readOnly:e.readOnly??!1},r?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"text",className:"tf-dynamic-value-input",value:l(e.value),disabled:!0}),wp.element.createElement("input",{...t,name:e.name??"",value:e.value??"",type:"hidden",ref:n})):e.children)});let w0=[],vE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=vE[r])e=r+1;else return!0;if(e==n)return!1}}u(sz,"isExtendingChar");function $E(t){return t>=127462&&t<=127487}u($E,"isRegionalIndicator");const wE=8205;function uz(t,e,n=!0,r=!0){return(n?xE:cz)(t,e,r)}u(uz,"findClusterBreak$1");function xE(t,e,n){if(e==t.length)return e;e&&SE(t.charCodeAt(e))&&CE(t.charCodeAt(e-1))&&e--;let r=x0(t,e);for(e+=kE(r);e=0&&$E(x0(t,a));)l++,a-=2;if(l%2==0)break;e+=2}else break}return e}u(xE,"nextClusterBreak");function cz(t,e,n){for(;e>0;){let r=xE(t,e-2,n);if(r=56320&&t<57344}u(SE,"surrogateLow$1");function CE(t){return t>=55296&&t<56320}u(CE,"surrogateHigh$1");function kE(t){return t<65536?1:2}u(kE,"codePointSize$1");const yp=class yp{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Ba(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),jd.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ba(this,e,n);let r=[];return this.decompose(e,n,r,0),jd.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new sl(this),l=new sl(e);for(let a=n,o=n;;){if(i.next(a),l.next(a),a=0,i.lineBreak!=l.lineBreak||i.done!=l.done||i.value!=l.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new sl(this,e)}iterRange(e,n=this.length){return new Wd(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Yd(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?yp.empty:e.length<=32?new Kt(e):jd.from(Kt.split(e,[]))}};u(yp,"Text");let pe=yp;const Dn=class Dn extends pe{constructor(e,n=dz(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let l=0;;l++){let a=this.text[l],o=i+a.length;if((n?r:o)>=e)return new S0(i,o,r,a);i=o+1,r++}}decompose(e,n,r,i){let l=e<=0&&n>=this.length?this:new Dn(DE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=qd(l.text,a.text.slice(),0,l.length);if(o.length<=32)r.push(new Dn(o,a.length+l.length));else{let s=o.length>>1;r.push(new Dn(o.slice(0,s)),new Dn(o.slice(s)))}}else r.push(l)}replace(e,n,r){if(!(r instanceof Dn))return super.replace(e,n,r);[e,n]=Ba(this,e,n);let i=qd(this.text,qd(r.text,DE(this.text,0,e)),n),l=this.length+r.length-(n-e);return i.length<=32?new Dn(i,l):jd.from(Dn.split(i,[]),l)}sliceString(e,n=this.length,r=` +}`.trim(),document.head.prepend(r);let i=u(s=>{if(!(s.touches.length===2||e)){if(!t||t===document.documentElement||t===document.body){s.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&s.preventDefault()}},"onTouchMove"),l=u(s=>{let c=s.target,d=s.relatedTarget;if(d&&vm(d))d.focus({preventScroll:!0}),fk(d,vm(c));else if(!d){var f;let h=(f=c.parentElement)===null||f===void 0?void 0:f.closest("[tabindex]");h?.focus({preventScroll:!0})}},"onBlur"),a=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(s){let c=document.activeElement!=null&&vm(document.activeElement);a.call(this,{...s,preventScroll:!0}),(!s||!s.preventScroll)&&fk(this,c)};let o=vr(Gg(document,"touchstart",n,{passive:!1,capture:!0}),Gg(document,"touchmove",i,{passive:!1,capture:!0}),Gg(document,"blur",l,!0));return()=>{o(),r.remove(),HTMLElement.prototype.focus=a}}u(NN,"$49c51c25361d4cd2$var$preventScrollMobileSafari");function Ug(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}u(Ug,"$49c51c25361d4cd2$var$setStyle");function Gg(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}u(Gg,"$49c51c25361d4cd2$var$addEvent");function fk(t,e){e||!cs?hk(t):cs.addEventListener("resize",()=>hk(t),{once:!0})}u(fk,"$49c51c25361d4cd2$var$scrollIntoViewWhenReady");function hk(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=Wc(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect(),l=n.getBoundingClientRect();if(l.topi.top+n.clientHeight){let a=i.bottom;cs&&(a=Math.min(a,cs.offsetTop+cs.height));let o=l.top-i.top-((a-i.top)/2-l.height/2);r.scrollTo({top:Math.max(0,Math.min(r.scrollHeight-r.clientHeight,r.scrollTop+o)),behavior:"smooth"})}}n=r.parentElement}}u(hk,"$49c51c25361d4cd2$var$scrollIntoView");const FN=(0,wp.element.createContext)({});function IN(){var t;return(t=(0,wp.element.useContext)(FN))!==null&&t!==void 0?t:{}}u(IN,"$96b38030c423d352$export$9fc1347d4195ccb3");const _g=wp.element.createContext(null);function LN(t){let{children:e}=t,n=(0,wp.element.useContext)(_g),[r,i]=(0,wp.element.useState)(0),l=(0,wp.element.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(a=>a+1),n&&n.addModal()},removeModal(){i(a=>a-1),n&&n.removeModal()}}),[n,r]);return wp.element.createElement(_g.Provider,{value:l},e)}u(LN,"$f57aed4a881a3485$export$178405afcd8c5eb");function zN(){let t=(0,wp.element.useContext)(_g);return{modalProviderProps:{"aria-hidden":t&&t.modalCount>0?!0:void 0}}}u(zN,"$f57aed4a881a3485$export$d9aaed4c3ece1bc0");function ZN(t){let{modalProviderProps:e}=zN();return wp.element.createElement("div",{"data-overlay-container":!0,...t,...e})}u(ZN,"$f57aed4a881a3485$var$OverlayContainerDOM");function pk(t){return wp.element.createElement(LN,null,wp.element.createElement(ZN,t))}u(pk,"$f57aed4a881a3485$export$bf688221f59024e5");var mk={};mk={dismiss:"\u062A\u062C\u0627\u0647\u0644"};var gk={};gk={dismiss:"\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435"};var Ok={};Ok={dismiss:"Odstranit"};var bk={};bk={dismiss:"Luk"};var yk={};yk={dismiss:"Schlie\xDFen"};var vk={};vk={dismiss:"\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7"};var $k={};$k={dismiss:"Dismiss"};var wk={};wk={dismiss:"Descartar"};var xk={};xk={dismiss:"L\xF5peta"};var Sk={};Sk={dismiss:"Hylk\xE4\xE4"};var Ck={};Ck={dismiss:"Rejeter"};var kk={};kk={dismiss:"\u05D4\u05EA\u05E2\u05DC\u05DD"};var Dk={};Dk={dismiss:"Odbaci"};var Pk={};Pk={dismiss:"Elutas\xEDt\xE1s"};var Ek={};Ek={dismiss:"Ignora"};var Tk={};Tk={dismiss:"\u9589\u3058\u308B"};var Ak={};Ak={dismiss:"\uBB34\uC2DC"};var Qk={};Qk={dismiss:"Atmesti"};var Mk={};Mk={dismiss:"Ner\u0101d\u012Bt"};var Bk={};Bk={dismiss:"Lukk"};var Rk={};Rk={dismiss:"Negeren"};var Vk={};Vk={dismiss:"Zignoruj"};var Nk={};Nk={dismiss:"Descartar"};var Fk={};Fk={dismiss:"Dispensar"};var Ik={};Ik={dismiss:"Revocare"};var Lk={};Lk={dismiss:"\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C"};var zk={};zk={dismiss:"Zru\u0161i\u0165"};var Zk={};Zk={dismiss:"Opusti"};var Xk={};Xk={dismiss:"Odbaci"};var jk={};jk={dismiss:"Avvisa"};var qk={};qk={dismiss:"Kapat"};var Wk={};Wk={dismiss:"\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438"};var Yk={};Yk={dismiss:"\u53D6\u6D88"};var Kk={};Kk={dismiss:"\u95DC\u9589"};var Uk={};Uk={"ar-AE":mk,"bg-BG":gk,"cs-CZ":Ok,"da-DK":bk,"de-DE":yk,"el-GR":vk,"en-US":$k,"es-ES":wk,"et-EE":xk,"fi-FI":Sk,"fr-FR":Ck,"he-IL":kk,"hr-HR":Dk,"hu-HU":Pk,"it-IT":Ek,"ja-JP":Tk,"ko-KR":Ak,"lt-LT":Qk,"lv-LV":Mk,"nb-NO":Bk,"nl-NL":Rk,"pl-PL":Vk,"pt-BR":Nk,"pt-PT":Fk,"ro-RO":Ik,"ru-RU":Lk,"sk-SK":zk,"sl-SI":Zk,"sr-SP":Xk,"sv-SE":jk,"tr-TR":qk,"uk-UA":Wk,"zh-CN":Yk,"zh-TW":Kk};function XN(t){return t&&t.__esModule?t.default:t}u(XN,"$parcel$interopDefault$7");function ds(t){let{onDismiss:e,...n}=t,r=Yt(XN(Uk),"@react-aria/overlays"),i=Xn(n,r.format("dismiss")),l=u(()=>{e&&e()},"onClick");return wp.element.createElement(gn,null,wp.element.createElement("button",{...i,tabIndex:-1,onClick:l,style:{width:1,height:1}}))}u(ds,"$86ea4cb521eb2e37$export$2317d149ed6f78c4");const jN=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;let fs=new WeakMap,Nt=[];function Hg(t,e){let n=bt(t?.[0]),r=e instanceof n.Element?{root:e}:e;var i;let l=(i=r?.root)!==null&&i!==void 0?i:document.body,a=r?.shouldUseInert&&jN,o=new Set(t),s=new Set,c=u(g=>a&&g instanceof n.HTMLElement?g.inert:g.getAttribute("aria-hidden")==="true","getHidden"),d=u((g,O)=>{a&&g instanceof n.HTMLElement?g.inert=O:O?g.setAttribute("aria-hidden","true"):(g.removeAttribute("aria-hidden"),g instanceof n.HTMLElement&&(g.inert=!1))},"setHidden"),f=u(g=>{for(let $ of g.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))o.add($);let O=u($=>{if(s.has($)||o.has($)||$.parentElement&&s.has($.parentElement)&&$.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let v of o)if($.contains(v))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},"acceptNode"),b=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode:O}),y=O(g);if(y===NodeFilter.FILTER_ACCEPT&&h(g),y!==NodeFilter.FILTER_REJECT){let $=b.nextNode();for(;$!=null;)h($),$=b.nextNode()}},"walk"),h=u(g=>{var O;let b=(O=fs.get(g))!==null&&O!==void 0?O:0;c(g)&&b===0||(b===0&&d(g,!0),s.add(g),fs.set(g,b+1))},"hide");Nt.length&&Nt[Nt.length-1].disconnect(),f(l);let p=new MutationObserver(g=>{for(let O of g)if(O.type==="childList"&&![...o,...s].some(b=>b.contains(O.target)))for(let b of O.addedNodes)(b instanceof HTMLElement||b instanceof SVGElement)&&(b.dataset.liveAnnouncer==="true"||b.dataset.reactAriaTopLayer==="true")?o.add(b):b instanceof Element&&f(b)});p.observe(l,{childList:!0,subtree:!0});let m={visibleNodes:o,hiddenNodes:s,observe(){p.observe(l,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return Nt.push(m),()=>{p.disconnect();for(let g of s){let O=fs.get(g);O!=null&&(O===1?(d(g,!1),fs.delete(g)):fs.set(g,O-1))}m===Nt[Nt.length-1]?(Nt.pop(),Nt.length&&Nt[Nt.length-1].observe()):Nt.splice(Nt.indexOf(m),1)}}u(Hg,"$5e3802645cc19319$export$1c3ebcada18427bf");function qN(t){let e=Nt[Nt.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}u(qN,"$5e3802645cc19319$export$1020fa7f77e17884");function WN(t,e){let{triggerRef:n,popoverRef:r,groupRef:i,isNonModal:l,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o,...s}=t,c=s.trigger==="SubmenuTrigger",{overlayProps:d,underlayProps:f}=ck({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!l||c,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:o},i??r),{overlayProps:h,arrowProps:p,placement:m,triggerAnchorPoint:g}=MN({...s,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:l&&!c?e.close:null});return dk({isDisabled:l||!e.isOpen}),(0,wp.element.useEffect)(()=>{if(e.isOpen&&r.current){var O,b;return l?qN((O=i?.current)!==null&&O!==void 0?O:r.current):Hg([(b=i?.current)!==null&&b!==void 0?b:r.current],{shouldUseInert:!0})}},[l,e.isOpen,r,i]),{popoverProps:ne(d,h),arrowProps:p,underlayProps:f,placement:m,triggerAnchorPoint:g}}u(WN,"$f2f8a6077418541e$export$542a6fd13ac93354");const Gk=wp.element.createContext(null);function _k(t){let e=hm(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[i,l]=(0,wp.element.useState)(!1),a=(0,wp.element.useMemo)(()=>({contain:i,setContain:l}),[i,l]),{getContainer:o}=IN();if(!t.portalContainer&&o&&(n=o()),!n)return null;let s=t.children;return t.disableFocusManagement||(s=wp.element.createElement(vd,{restoreFocus:!0,contain:(t.shouldContainFocus||i)&&!r},s)),s=wp.element.createElement(Gk.Provider,{value:a},wp.element.createElement(OR,null,s)),wp.element.createPortal(s,n)}u(_k,"$337b884510726a0d$export$c6fdb837b070b4ff");function Hk(){let t=(0,wp.element.useContext)(Gk),e=t?.setContain;Pe(()=>{e?.(!0)},[e])}u(Hk,"$337b884510726a0d$export$14c98a7594375490");function YN(t,e,n){let{overlayProps:r,underlayProps:i}=ck({...t,isOpen:e.isOpen,onClose:e.close},n);return dk({isDisabled:!e.isOpen}),Hk(),(0,wp.element.useEffect)(()=>{if(e.isOpen&&n.current)return Hg([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:ne(r),underlayProps:i}}u(YN,"$8ac8429251c45e4b$export$dbc0f175b25fb0fb");const Ad=new WeakMap;function KN(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}u(KN,"$b1f0cad8af73213b$var$normalizeKey");function Jk(t,e){let n=Ad.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${KN(e)}`}u(Jk,"$b1f0cad8af73213b$export$9145995848b05025");function Jg(t){return jc()?t.altKey:t.ctrlKey}u(Jg,"$feb5ffebff200149$export$d3e3bd3e26688c04");function Qd(t,e){var n,r;let i=`[data-key="${CSS.escape(String(e))}"]`,l=(n=t.current)===null||n===void 0?void 0:n.dataset.collection;return l&&(i=`[data-collection="${CSS.escape(l)}"]${i}`),(r=t.current)===null||r===void 0?void 0:r.querySelector(i)}u(Qd,"$feb5ffebff200149$export$c3d8340acf92597f");const eD=new WeakMap;function UN(t){let e=Ie();return eD.set(t,e),e}u(UN,"$feb5ffebff200149$export$881eb0d9f3605d9d");function GN(t){return eD.get(t)}u(GN,"$feb5ffebff200149$export$6aeb1680a0ae8741");const _N=1e3;function tD(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,i=(0,wp.element.useRef)({search:"",timeout:void 0}).current,l=u(a=>{let o=HN(a.key);if(!(!o||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target)||i.search.length===0&&o===" ")){if(o===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=o,e.getKeyForSearch!=null){let s=e.getKeyForSearch(i.search,n.focusedKey);s==null&&(s=e.getKeyForSearch(i.search)),s!=null&&(n.setFocusedKey(s),r&&r(s))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},_N)}},"onKeyDown");return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?l:void 0}}}u(tD,"$fb3050f43d946246$export$e32c88dfddc6e1d8");function HN(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}u(HN,"$fb3050f43d946246$var$getStringForKey");function nD(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:l=!1,disallowEmptySelection:a=!1,disallowSelectAll:o=!1,escapeKeyBehavior:s="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:d=!1,shouldUseVirtualFocus:f,allowsTabNavigation:h=!1,isVirtualized:p,scrollRef:m=r,linkBehavior:g="action"}=t,{direction:O}=Re(),b=qc(),y=u(P=>{var R;if(P.altKey&&P.key==="Tab"&&P.preventDefault(),!(!((R=r.current)===null||R===void 0)&&R.contains(P.target)))return;const L=u((Z,ee)=>{if(Z!=null){if(e.isLink(Z)&&g==="selection"&&c&&!Jg(P)){(0,wp.element.flushSync)(()=>{e.setFocusedKey(Z,ee)});let De=Qd(r,Z),qt=e.getItemProps(Z);De&&b.open(De,P,qt.href,qt.routerOptions);return}if(e.setFocusedKey(Z,ee),e.isLink(Z)&&g==="override")return;P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&!Jg(P)&&e.replaceSelection(Z)}},"navigateToKey");switch(P.key){case"ArrowDown":if(n.getKeyBelow){var k,F,N;let Z=e.focusedKey!=null?(k=n.getKeyBelow)===null||k===void 0?void 0:k.call(n,e.focusedKey):(F=n.getFirstKey)===null||F===void 0?void 0:F.call(n);Z==null&&l&&(Z=(N=n.getFirstKey)===null||N===void 0?void 0:N.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowUp":if(n.getKeyAbove){var z,G,le;let Z=e.focusedKey!=null?(z=n.getKeyAbove)===null||z===void 0?void 0:z.call(n,e.focusedKey):(G=n.getLastKey)===null||G===void 0?void 0:G.call(n);Z==null&&l&&(Z=(le=n.getLastKey)===null||le===void 0?void 0:le.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z))}break;case"ArrowLeft":if(n.getKeyLeftOf){var ie,me,ve;let Z=e.focusedKey!=null?(ie=n.getKeyLeftOf)===null||ie===void 0?void 0:ie.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(me=n.getFirstKey)===null||me===void 0?void 0:me.call(n,e.focusedKey):(ve=n.getLastKey)===null||ve===void 0?void 0:ve.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var ce,K,W;let Z=e.focusedKey!=null?(ce=n.getKeyRightOf)===null||ce===void 0?void 0:ce.call(n,e.focusedKey):null;Z==null&&l&&(Z=O==="rtl"?(K=n.getLastKey)===null||K===void 0?void 0:K.call(n,e.focusedKey):(W=n.getFirstKey)===null||W===void 0?void 0:W.call(n,e.focusedKey)),Z!=null&&(P.preventDefault(),L(Z,O==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getFirstKey(e.focusedKey,fa(P));e.setFocusedKey(Z),Z!=null&&(fa(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&P.shiftKey)return;P.preventDefault();let Z=n.getLastKey(e.focusedKey,fa(P));e.setFocusedKey(Z),Z!=null&&(fa(P)&&P.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(Z):c&&e.replaceSelection(Z))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let Z=n.getKeyPageBelow(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let Z=n.getKeyPageAbove(e.focusedKey);Z!=null&&(P.preventDefault(),L(Z))}break;case"a":fa(P)&&e.selectionMode==="multiple"&&o!==!0&&(P.preventDefault(),e.selectAll());break;case"Escape":s==="clearSelection"&&!a&&e.selectedKeys.size!==0&&(P.stopPropagation(),P.preventDefault(),e.clearSelection());break;case"Tab":if(!h){if(P.shiftKey)r.current.focus();else{let Z=ut(r.current,{tabbable:!0}),ee,De;do De=Z.lastChild(),De&&(ee=De);while(De);ee&&!ee.contains(document.activeElement)&&Bt(ee)}break}}},"onKeyDown"),$=(0,wp.element.useRef)({top:0,left:0});un(m,"scroll",p?void 0:()=>{var P,R,L,k;$.current={top:(L=(P=m.current)===null||P===void 0?void 0:P.scrollTop)!==null&&L!==void 0?L:0,left:(k=(R=m.current)===null||R===void 0?void 0:R.scrollLeft)!==null&&k!==void 0?k:0}});let v=u(P=>{if(e.isFocused){P.currentTarget.contains(P.target)||e.setFocused(!1);return}if(P.currentTarget.contains(P.target)){if(e.setFocused(!0),e.focusedKey==null){var R,L;let N=u(G=>{G!=null&&(e.setFocusedKey(G),c&&!e.isSelected(G)&&e.replaceSelection(G))},"navigateToKey"),z=P.relatedTarget;var k,F;z&&P.currentTarget.compareDocumentPosition(z)&Node.DOCUMENT_POSITION_FOLLOWING?N((k=e.lastSelectedKey)!==null&&k!==void 0?k:(R=n.getLastKey)===null||R===void 0?void 0:R.call(n)):N((F=e.firstSelectedKey)!==null&&F!==void 0?F:(L=n.getFirstKey)===null||L===void 0?void 0:L.call(n))}else!p&&m.current&&(m.current.scrollTop=$.current.top,m.current.scrollLeft=$.current.left);if(e.focusedKey!=null&&m.current){let N=Qd(r,e.focusedKey);N instanceof HTMLElement&&(!N.contains(document.activeElement)&&!f&&Bt(N),zo()==="keyboard"&&Yc(N,{containingElement:r.current}))}}},"onFocus"),S=u(P=>{P.currentTarget.contains(P.relatedTarget)||e.setFocused(!1)},"onBlur"),x=(0,wp.element.useRef)(!1);un(r,WB,f?P=>{let{detail:R}=P;P.stopPropagation(),e.setFocused(!0),R?.focusStrategy==="first"&&(x.current=!0)}:void 0);let C=Me(()=>{var P,R;let L=(R=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&R!==void 0?R:null;if(L==null){let k=Ke();Fw(r.current),Tg(k,null),e.collection.size>0&&(x.current=!1)}else e.setFocusedKey(L),x.current=!1});t3(()=>{x.current&&C()},[e.collection,C]);let Q=Me(()=>{e.collection.size>0&&(x.current=!1)});t3(()=>{Q()},[e.focusedKey,Q]),un(r,qB,f?P=>{var R;P.stopPropagation(),e.setFocused(!1),!((R=P.detail)===null||R===void 0)&&R.clearFocusKey&&e.setFocusedKey(null)}:void 0);const T=(0,wp.element.useRef)(i),B=(0,wp.element.useRef)(!1);(0,wp.element.useEffect)(()=>{if(T.current){var P,R;let F=null;var L;i==="first"&&(F=(L=(P=n.getFirstKey)===null||P===void 0?void 0:P.call(n))!==null&&L!==void 0?L:null);var k;i==="last"&&(F=(k=(R=n.getLastKey)===null||R===void 0?void 0:R.call(n))!==null&&k!==void 0?k:null);let N=e.selectedKeys;if(N.size){for(let z of N)if(e.canSelectItem(z)){F=z;break}}e.setFocused(!0),e.setFocusedKey(F),F==null&&!f&&r.current&&Ui(r.current),e.collection.size>0&&(T.current=!1,B.current=!0)}});let w=(0,wp.element.useRef)(e.focusedKey),M=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==w.current||B.current)&&m.current&&r.current){let P=zo(),R=Qd(r,e.focusedKey);if(!(R instanceof HTMLElement))return;(P==="keyboard"||B.current)&&(M.current&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame(()=>{m.current&&(i3(m.current,R),P!=="virtual"&&Yc(R,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&w.current!=null&&r.current&&Ui(r.current),w.current=e.focusedKey,B.current=!1}),(0,wp.element.useEffect)(()=>()=>{M.current&&cancelAnimationFrame(M.current)},[]),un(r,"react-aria-focus-scope-restore",P=>{P.preventDefault(),e.setFocused(!0)});let A={onKeyDown:y,onFocus:v,onBlur:S,onMouseDown(P){m.current===P.target&&P.preventDefault()}},{typeSelectProps:E}=tD({keyboardDelegate:n,selectionManager:e});d||(A=ne(E,A));let I;f||(I=e.focusedKey==null?0:-1);let D=UN(e.collection);return{collectionProps:ne(A,{tabIndex:I,"data-collection":D})}}u(nD,"$ae20dd8cbca75726$export$d6daf82dcd84e87c");function JN(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:l,shouldUseVirtualFocus:a,focus:o,isDisabled:s,onAction:c,allowsDifferentPressOrigin:d,linkBehavior:f="action"}=t,h=qc();e=Ie(e);let p=u(k=>{if(k.pointerType==="keyboard"&&Jg(k))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&i.current){let F=n.getItemProps(r);h.open(i.current,k,F.href,F.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):k&&k.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||k&&(fa(k)||k.pointerType==="touch"||k.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}},"onSelect");(0,wp.element.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(a?Fw(i.current):o?o():document.activeElement!==i.current&&i.current&&Ui(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,a]),s=s||n.isDisabled(r);let m={};!a&&!s?m={tabIndex:r===n.focusedKey?0:-1,onFocus(k){k.target===i.current&&n.setFocusedKey(r)}}:s&&(m.onMouseDown=k=>{k.preventDefault()});let g=n.isLink(r)&&f==="override",O=c&&t.UNSTABLE_itemBehavior==="action",b=n.isLink(r)&&f!=="selection"&&f!=="none",y=!s&&n.canSelectItem(r)&&!g&&!O,$=(c||b)&&!s,v=$&&(n.selectionBehavior==="replace"?!y:!y||n.isEmpty),S=$&&y&&n.selectionBehavior==="replace",x=v||S,C=(0,wp.element.useRef)(null),Q=x&&y,T=(0,wp.element.useRef)(!1),B=(0,wp.element.useRef)(!1),w=n.getItemProps(r),M=u(k=>{if(c){var F;c(),(F=i.current)===null||F===void 0||F.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}b&&i.current&&h.open(i.current,k,w.href,w.routerOptions)},"performAction"),A={ref:i};if(l?(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,k.pointerType==="keyboard"&&(!x||iD())&&p(k)},d?(A.onPressUp=v?void 0:k=>{k.pointerType==="mouse"&&y&&p(k)},A.onPress=v?M:k=>{k.pointerType!=="keyboard"&&k.pointerType!=="mouse"&&y&&p(k)}):A.onPress=k=>{if(v||S&&k.pointerType!=="mouse"){if(k.pointerType==="keyboard"&&!rD())return;M(k)}else k.pointerType!=="keyboard"&&y&&p(k)}):(A.onPressStart=k=>{C.current=k.pointerType,T.current=Q,B.current=v,y&&(k.pointerType==="mouse"&&!v||k.pointerType==="keyboard"&&(!$||iD()))&&p(k)},A.onPress=k=>{(k.pointerType==="touch"||k.pointerType==="pen"||k.pointerType==="virtual"||k.pointerType==="keyboard"&&x&&rD()||k.pointerType==="mouse"&&B.current)&&(x?M(k):y&&p(k))}),m["data-collection"]=GN(n.collection),m["data-key"]=r,A.preventFocusOnPress=a,a&&(A=ne(A,{onPressStart(k){k.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(k){k.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),w)for(let k of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])w[k]&&(A[k]=vr(A[k],w[k]));let{pressProps:E,isPressed:I}=jn(A),D=S?k=>{C.current==="mouse"&&(k.stopPropagation(),k.preventDefault(),M(k))}:void 0,{longPressProps:P}=P3({isDisabled:!Q,onLongPress(k){k.pointerType==="touch"&&(p(k),n.setSelectionBehavior("toggle"))}}),R=u(k=>{C.current==="touch"&&T.current&&k.preventDefault()},"onDragStartCapture"),L=f!=="none"&&n.isLink(r)?k=>{qi.isOpening||k.preventDefault()}:void 0;return{itemProps:ne(m,y||v||a&&!s?E:{},Q?P:{},{onDoubleClick:D,onDragStartCapture:R,onClick:L,id:e},a?{onMouseDown:k=>k.preventDefault()}:void 0),isPressed:I,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:s,allowsSelection:y,hasAction:x}}u(JN,"$880e95eb8b93ba9a$export$ecf600387e221c37");function rD(){let t=window.event;return t?.key==="Enter"}u(rD,"$880e95eb8b93ba9a$var$isActionKey");function iD(){let t=window.event;return t?.key===" "||t?.code==="Space"}u(iD,"$880e95eb8b93ba9a$var$isSelectionKey");const vv=class vv{getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?Qd(this.ref,e):null;if(!r)return null;let i=n.getBoundingClientRect(),l=r.getBoundingClientRect();return{x:l.left-i.left-n.clientLeft+n.scrollLeft,y:l.top-i.top-n.clientTop+n.scrollTop,width:l.width,height:l.height}}getContentSize(){let e=this.ref.current;var n,r;return{width:(n=e?.scrollWidth)!==null&&n!==void 0?n:0,height:(r=e?.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let e=this.ref.current;var n,r,i,l;return{x:(n=e?.scrollLeft)!==null&&n!==void 0?n:0,y:(r=e?.scrollTop)!==null&&r!==void 0?r:0,width:(i=e?.clientWidth)!==null&&i!==void 0?i:0,height:(l=e?.clientHeight)!==null&&l!==void 0?l:0}}constructor(e){this.ref=e}};u(vv,"$657e4dc4a6e88df0$export$8f5ed9ff9f511381");let Md=vv;const $v=class $v{isDisabled(e){var n;return this.disabledBehavior==="all"&&(((n=e.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,n){let r=e;for(;r!=null;){let i=this.collection.getItem(r);if(i?.type==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(e){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(e){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(e,n,r){let i=e,l=this.layoutDelegate.getItemRect(i);if(!l||i==null)return null;let a=l;do{if(i=n(i),i==null)break;l=this.layoutDelegate.getItemRect(i)}while(l&&r(a,l)&&i!=null);return i}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,n){return n?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!da(n))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let l=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let l=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>l&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!da(n))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let l=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xl||new hs({collection:n,disabledKeys:r,disabledBehavior:s,ref:i,collator:o,layoutDelegate:a}),[l,a,n,r,i,o,s]),{collectionProps:d}=nD({...t,ref:i,selectionManager:e,keyboardDelegate:c});return{listProps:d}}u(eF,"$982254629710d113$export$b95089534ab7c1fd");function lD(t,e,n){let r=yt(t,{labelable:!0}),i=t.selectionBehavior||"toggle",l=t.linkBehavior||(i==="replace"?"action":"override");i==="toggle"&&l==="action"&&(l="override");let{listProps:a}=eF({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:l}),{focusWithinProps:o}=Wt({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),s=Ie(t.id);Ad.set(e,{id:s,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:l,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:c,fieldProps:d}=Cd({...t,id:s,labelElementType:"span"});return{labelProps:c,listBoxProps:ne(r,o,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...ne(d,a)})}}u(lD,"$c132121280ec012d$export$50eacbbf140a3141");function aD(t){return null}u(aD,"$c1d7fb2ec91bae71$var$Item"),aD.getCollectionNode=u(function*(e,n){let{childItems:r,title:i,children:l}=e,a=e.title||e.children,o=e.textValue||(typeof a=="string"?a:"")||e["aria-label"]||"";!o&&!n?.suppressTextValueWarning&&process.env.NODE_ENV!=="production"&&console.warn(" with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:e,rendered:a,textValue:o,"aria-label":e["aria-label"],hasChildNodes:tF(e),*childNodes(){if(r)for(let s of r)yield{type:"item",value:s};else if(i){let s=[];wp.element.Children.forEach(l,c=>{s.push({type:"item",element:c})}),yield*s}}}},"getCollectionNode");function tF(t){return t.hasChildItems!=null?t.hasChildItems:!!(t.childItems||t.title&&wp.element.Children.count(t.children)>0)}u(tF,"$c1d7fb2ec91bae71$var$hasChildItems");let Qr=aD;function oD(t){return null}u(oD,"$9fc4852771d079eb$var$Section"),oD.getCollectionNode=u(function*(e){let{children:n,title:r,items:i}=e;yield{type:"section",props:e,hasChildNodes:!0,rendered:r,"aria-label":e["aria-label"],*childNodes(){if(typeof n=="function"){if(!i)throw new Error("props.children was a function but props.items is missing");for(let l of i)yield{type:"item",value:l,renderer:n}}else{let l=[];wp.element.Children.forEach(n,a=>{l.push({type:"item",element:a})}),yield*l}}}},"getCollectionNode");let nF=oD;const wv=class wv{build(e,n){return this.context=n,sD(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(wp.element.isValidElement(n)&&n.type===wp.element.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let l of r)yield*this.getFullNode({value:l,index:i},{renderer:n}),i++}else{let i=[];wp.element.Children.forEach(n,a=>{a&&i.push(a)});let l=0;for(let a of i){let o=this.getFullNode({element:a,index:l},{});for(let s of o)l++,yield s}}}getKey(e,n,r,i){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let l=n.value;if(l!=null){var a;let o=(a=l.key)!==null&&a!==void 0?a:l.id;if(o==null)throw new Error("No key found for item");return o}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,i){if(wp.element.isValidElement(e.element)&&e.element.type===wp.element.Fragment){let O=[];wp.element.Children.forEach(e.element.props.children,y=>{O.push(y)});var l;let b=(l=e.index)!==null&&l!==void 0?l:0;for(const y of O)yield*this.getFullNode({element:y,index:b++},n,r,i);return}let a=e.element;if(!a&&e.value&&n&&n.renderer){let O=this.cache.get(e.value);if(O&&(!O.shouldInvalidate||!O.shouldInvalidate(this.context))){O.index=e.index,O.parentKey=i?i.key:null,yield O;return}a=n.renderer(e.value)}if(wp.element.isValidElement(a)){let O=a.type;if(typeof O!="function"&&typeof O.getCollectionNode!="function"){let v=a.type;throw new Error(`Unknown element <${v}> in collection.`)}let b=O.getCollectionNode(a.props,this.context);var o;let y=(o=e.index)!==null&&o!==void 0?o:0,$=b.next();for(;!$.done&&$.value;){let v=$.value;e.index=y;var s;let S=(s=v.key)!==null&&s!==void 0?s:null;S==null&&(S=v.element?null:this.getKey(a,e,n,r));let C=[...this.getFullNode({...v,key:S,index:y,wrapper:rF(e.wrapper,v.wrapper)},this.getChildState(n,v),r?`${r}${a.key}`:a.key,i)];for(let Q of C){var c,d;Q.value=(d=(c=v.value)!==null&&c!==void 0?c:e.value)!==null&&d!==void 0?d:null,Q.value&&this.cache.set(Q.value,Q);var f;if(e.type&&Q.type!==e.type)throw new Error(`Unsupported type <${t0(Q.type)}> in <${t0((f=i?.type)!==null&&f!==void 0?f:"unknown parent type")}>. Only <${t0(e.type)}> is supported.`);y++,yield Q}$=b.next(C)}return}if(e.key==null||e.type==null)return;let h=this;var p,m;let g={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:(p=e.value)!==null&&p!==void 0?p:null,level:i?i.level+1:0,index:e.index,rendered:e.rendered,textValue:(m=e.textValue)!==null&&m!==void 0?m:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:sD(function*(){if(!e.hasChildNodes||!e.childNodes)return;let O=0;for(let b of e.childNodes()){b.key!=null&&(b.key=`${g.key}${b.key}`);let y=h.getFullNode({...b,index:O},h.getChildState(n,b),g.key,g);for(let $ of y)O++,yield $}})};yield g}constructor(){this.cache=new WeakMap}};u(wv,"$eb2240fc39a57fa5$export$bf788dd355e3a401");let e0=wv;function sD(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}u(sD,"$eb2240fc39a57fa5$var$iterable");function rF(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}u(rF,"$eb2240fc39a57fa5$var$compose");function t0(t){return t[0].toUpperCase()+t.slice(1)}u(t0,"$eb2240fc39a57fa5$var$capitalize");function iF(t,e,n){let r=(0,wp.element.useMemo)(()=>new e0,[]),{children:i,items:l,collection:a}=t;return(0,wp.element.useMemo)(()=>{if(a)return a;let s=r.build({children:i,items:l},n);return e(s)},[r,i,l,a,n,e])}u(iF,"$7613b1592d41b092$export$6cd28814d92fa9c9");function Bd(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}u(Bd,"$c5a24bc478652b5f$export$1005530eda016c13");function lF(t){return aF(t,0)}u(lF,"$c5a24bc478652b5f$export$fbdeaa6a76694f71");function aF(t,e){if(e<0)return;let n=0;for(let r of t){if(n===e)return r;n++}}u(aF,"$c5a24bc478652b5f$export$5f3398f8733f90e2");function n0(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...uD(t,e),e],i=[...uD(t,n),n],l=r.slice(0,i.length).findIndex((a,o)=>a!==i[o]);return l!==-1?(e=r[l],n=i[l],e.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===e)>=0,-1)}u(n0,"$c5a24bc478652b5f$export$8c434b3a7a4dad6");function uD(t,e){let n=[],r=e;for(;r?.parentKey!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}u(uD,"$c5a24bc478652b5f$var$getAncestors");const cD=new WeakMap;function dD(t){let e=cD.get(t);if(e!=null)return e;let n=0,r=u(i=>{for(let l of i)l.type==="section"?r(Bd(l,t)):l.type==="item"&&n++},"countItems");return r(t),cD.set(t,n),n}u(dD,"$453cc9f0df89c0a5$export$77d5aafae4e095b2");function oF(t,e,n){var r,i;let{key:l}=t,a=Ad.get(e);var o;let s=(o=t.isDisabled)!==null&&o!==void 0?o:e.selectionManager.isDisabled(l);var c;let d=(c=t.isSelected)!==null&&c!==void 0?c:e.selectionManager.isSelected(l);var f;let h=(f=t.shouldSelectOnPressUp)!==null&&f!==void 0?f:a?.shouldSelectOnPressUp;var p;let m=(p=t.shouldFocusOnHover)!==null&&p!==void 0?p:a?.shouldFocusOnHover;var g;let O=(g=t.shouldUseVirtualFocus)!==null&&g!==void 0?g:a?.shouldUseVirtualFocus;var b;let y=(b=t.isVirtualized)!==null&&b!==void 0?b:a?.isVirtualized,$=ca(),v=ca(),S={role:"option","aria-disabled":s||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?d:void 0};wr()&&gm()||(S["aria-label"]=t["aria-label"],S["aria-labelledby"]=$,S["aria-describedby"]=v);let x=e.collection.getItem(l);if(y){let P=Number(x?.index);S["aria-posinset"]=Number.isNaN(P)?void 0:P+1,S["aria-setsize"]=dD(e.collection)}let C=a?.onAction?()=>{var P;return a==null||(P=a.onAction)===null||P===void 0?void 0:P.call(a,l)}:void 0,Q=Jk(e,l),{itemProps:T,isPressed:B,isFocused:w,hasAction:M,allowsSelection:A}=JN({selectionManager:e.selectionManager,key:l,ref:n,shouldSelectOnPressUp:h,allowsDifferentPressOrigin:h&&m,isVirtualized:y,shouldUseVirtualFocus:O,isDisabled:s,onAction:C||!(x==null||(r=x.props)===null||r===void 0)&&r.onAction?vr(x==null||(i=x.props)===null||i===void 0?void 0:i.onAction,C):void 0,linkBehavior:a?.linkBehavior,UNSTABLE_itemBehavior:a?.UNSTABLE_itemBehavior,id:Q}),{hoverProps:E}=yR({isDisabled:s||!m,onHoverStart(){td()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l))}}),I=yt(x?.props);delete I.id;let D=FB(x?.props);return{optionProps:{...S,...ne(I,T,E,D),id:Q},labelProps:{id:$},descriptionProps:{id:v},isFocused:w,isFocusVisible:w&&e.selectionManager.isFocused&&td(),isSelected:d,isDisabled:s,isPressed:B,allowsSelection:A,hasAction:M}}u(oF,"$293f70390ea03370$export$497855f14858aa34");function sF(t){let{heading:e,"aria-label":n}=t,r=Ie();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}u(sF,"$af383d3bef1cfdc9$export$c3f9f39876e4bc7");var fD={};fD={longPressMessage:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u0627\u064B \u0623\u0648 \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 Alt + \u0627\u0644\u0633\u0647\u0645 \u0644\u0623\u0633\u0641\u0644 \u0644\u0641\u062A\u062D \u0627\u0644\u0642\u0627\u0626\u0645\u0629"};var hD={};hD={longPressMessage:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E \u0438\u043B\u0438 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Alt+ \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u0434\u043E\u043B\u0443, \u0437\u0430 \u0434\u0430 \u043E\u0442\u0432\u043E\u0440\u0438\u0442\u0435 \u043C\u0435\u043D\u044E\u0442\u043E"};var pD={};pD={longPressMessage:"Dlouh\xFDm stiskem nebo stisknut\xEDm kl\xE1ves Alt + \u0161ipka dol\u016F otev\u0159ete nab\xEDdku"};var mD={};mD={longPressMessage:"Langt tryk eller tryk p\xE5 Alt + pil ned for at \xE5bne menuen"};var gD={};gD={longPressMessage:"Dr\xFCcken Sie lange oder dr\xFCcken Sie Alt + Nach-unten, um das Men\xFC zu \xF6ffnen"};var OD={};OD={longPressMessage:"\u03A0\u03B9\u03AD\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03AE \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 Alt + \u03BA\u03AC\u03C4\u03C9 \u03B2\u03AD\u03BB\u03BF\u03C2 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B1\u03BD\u03BF\u03AF\u03BE\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BC\u03B5\u03BD\u03BF\u03CD"};var bD={};bD={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var yD={};yD={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xFA"};var vD={};vD={longPressMessage:"Men\xFC\xFC avamiseks vajutage pikalt v\xF5i vajutage klahve Alt + allanool"};var $D={};$D={longPressMessage:"Avaa valikko painamalla pohjassa tai n\xE4pp\xE4inyhdistelm\xE4ll\xE4 Alt + Alanuoli"};var wD={};wD={longPressMessage:"Appuyez de mani\xE8re prolong\xE9e ou appuyez sur Alt\xA0+\xA0Fl\xE8che vers le bas pour ouvrir le menu."};var xD={};xD={longPressMessage:"\u05DC\u05D7\u05E5 \u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05D0\u05D5 \u05D4\u05E7\u05E9 Alt + ArrowDown \u05DB\u05D3\u05D9 \u05DC\u05E4\u05EA\u05D5\u05D7 \u05D0\u05EA \u05D4\u05EA\u05E4\u05E8\u05D9\u05D8"};var SD={};SD={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var CD={};CD={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele ny\xEDl gombot a men\xFC megnyit\xE1s\xE1hoz"};var kD={};kD={longPressMessage:"Premere a lungo o premere Alt + Freccia gi\xF9 per aprire il menu"};var DD={};DD={longPressMessage:"\u9577\u62BC\u3057\u307E\u305F\u306F Alt+\u4E0B\u77E2\u5370\u30AD\u30FC\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u958B\u304F"};var PD={};PD={longPressMessage:"\uAE38\uAC8C \uB204\uB974\uAC70\uB098 Alt + \uC544\uB798\uCABD \uD654\uC0B4\uD45C\uB97C \uB20C\uB7EC \uBA54\uB274 \uC5F4\uAE30"};var ED={};ED={longPressMessage:"Nor\u0117dami atidaryti meniu, nuspaud\u0119 palaikykite arba paspauskite \u201EAlt + ArrowDown\u201C."};var TD={};TD={longPressMessage:"Lai atv\u0113rtu izv\u0113lni, turiet nospiestu vai nospiediet tausti\u0146u kombin\u0101ciju Alt + lejupv\u0113rst\u0101 bulti\u0146a"};var AD={};AD={longPressMessage:"Langt trykk eller trykk Alt + PilNed for \xE5 \xE5pne menyen"};var QD={};QD={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var MD={};MD={longPressMessage:"Naci\u015Bnij i przytrzymaj lub naci\u015Bnij klawisze Alt + Strza\u0142ka w d\xF3\u0142, aby otworzy\u0107 menu"};var BD={};BD={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var RD={};RD={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var VD={};VD={longPressMessage:"Ap\u0103sa\u021Bi lung sau ap\u0103sa\u021Bi pe Alt + s\u0103geat\u0103 \xEEn jos pentru a deschide meniul"};var ND={};ND={longPressMessage:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0438\u043B\u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 Alt + \u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E"};var FD={};FD={longPressMessage:"Ponuku otvor\xEDte dlh\xFDm stla\u010Den\xEDm alebo stla\u010Den\xEDm kl\xE1vesu Alt + kl\xE1vesu so \u0161\xEDpkou nadol"};var ID={};ID={longPressMessage:"Za odprtje menija pritisnite in dr\u017Eite gumb ali pritisnite Alt+pu\u0161\u010Dica navzdol"};var LD={};LD={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var zD={};zD={longPressMessage:"H\xE5ll nedtryckt eller tryck p\xE5 Alt + pil ned\xE5t f\xF6r att \xF6ppna menyn"};var ZD={};ZD={longPressMessage:"Men\xFCy\xFC a\xE7mak i\xE7in uzun bas\u0131n veya Alt + A\u015Fa\u011F\u0131 Ok tu\u015Funa bas\u0131n"};var XD={};XD={longPressMessage:"\u0414\u043E\u0432\u0433\u043E \u0430\u0431\u043E \u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E \u043D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u043A\u043E\u043C\u0431\u0456\u043D\u0430\u0446\u0456\u044E \u043A\u043B\u0430\u0432\u0456\u0448 Alt \u0456 \u0441\u0442\u0440\u0456\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0449\u043E\u0431 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u043C\u0435\u043D\u044E"};var jD={};jD={longPressMessage:"\u957F\u6309\u6216\u6309 Alt + \u5411\u4E0B\u65B9\u5411\u952E\u4EE5\u6253\u5F00\u83DC\u5355"};var qD={};qD={longPressMessage:"\u9577\u6309\u6216\u6309 Alt+\u5411\u4E0B\u9375\u4EE5\u958B\u555F\u529F\u80FD\u8868"};var WD={};WD={"ar-AE":fD,"bg-BG":hD,"cs-CZ":pD,"da-DK":mD,"de-DE":gD,"el-GR":OD,"en-US":bD,"es-ES":yD,"et-EE":vD,"fi-FI":$D,"fr-FR":wD,"he-IL":xD,"hr-HR":SD,"hu-HU":CD,"it-IT":kD,"ja-JP":DD,"ko-KR":PD,"lt-LT":ED,"lv-LV":TD,"nb-NO":AD,"nl-NL":QD,"pl-PL":MD,"pt-BR":BD,"pt-PT":RD,"ro-RO":VD,"ru-RU":ND,"sk-SK":FD,"sl-SI":ID,"sr-SP":LD,"sv-SE":zD,"tr-TR":ZD,"uk-UA":XD,"zh-CN":jD,"zh-TW":qD};function uF(t){return t&&t.__esModule?t.default:t}u(uF,"$parcel$interopDefault$6");function YD(t,e,n){let{type:r="menu",isDisabled:i,trigger:l="press"}=t,a=Ie(),{triggerProps:o,overlayProps:s}=us({type:r},e,n),c=u(p=>{if(!i&&!(l==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(l==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},"onKeyDown"),d=Yt(uF(WD),"@react-aria/menu"),{longPressProps:f}=P3({isDisabled:i||l!=="longPress",accessibilityDescription:d.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),h={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!i&&(Bt(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!i&&(Bt(p.target),e.toggle())}};return delete o.onPress,{menuTriggerProps:{...o,...l==="press"?h:f,id:a,onKeyDown:c},menuProps:{...s,"aria-labelledby":a,autoFocus:e.focusStrategy||!0,onClose:e.close}}}u(YD,"$168583247155ddda$export$dc9c12ed27dd1b49");function cF(t){return t&&t.__esModule?t.default:t}u(cF,"$parcel$interopDefault$5");function KD(t,e){let{buttonRef:n,popoverRef:r,inputRef:i,listBoxRef:l,keyboardDelegate:a,layoutDelegate:o,shouldFocusWrap:s,isReadOnly:c,isDisabled:d}=t,f=(0,wp.element.useRef)(null);n=n??f;let h=Yt(cF(tk),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:m}=YD({type:"listbox",isDisabled:d||c},e,n);Ad.set(e,{id:m.id});let{collection:g}=e,{disabledKeys:O}=e.selectionManager,b=(0,wp.element.useMemo)(()=>a||new hs({collection:g,disabledKeys:O,ref:l,layoutDelegate:o}),[a,o,g,O,l]),{collectionProps:y}=nD({selectionManager:e.selectionManager,keyboardDelegate:b,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:s,ref:i,isVirtualized:!0}),$=qc(),v=u(W=>{if(!W.nativeEvent.isComposing)switch(W.key){case"Enter":case"Tab":if(e.isOpen&&W.key==="Enter"&&W.preventDefault(),e.isOpen&&l.current&&e.selectionManager.focusedKey!=null){let Z=e.collection.getItem(e.selectionManager.focusedKey);if(Z?.props.href){let ee=l.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);W.key==="Enter"&&ee instanceof HTMLAnchorElement&&$.open(ee,W,Z.props.href,Z.props.routerOptions),e.close();break}else if(Z?.props.onAction){Z.props.onAction(),e.close();break}}e.commit();break;case"Escape":(e.selectedKey!==null||e.inputValue===""||t.allowsCustomValue)&&W.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},"onKeyDown"),S=u(W=>{var Z;let ee=n?.current&&n.current===W.relatedTarget,De=(Z=r.current)===null||Z===void 0?void 0:Z.contains(W.relatedTarget);ee||De||(t.onBlur&&t.onBlur(W),e.setFocused(!1))},"onBlur"),x=u(W=>{e.isFocused||(t.onFocus&&t.onFocus(W),e.setFocused(!0))},"onFocus"),{isInvalid:C,validationErrors:Q,validationDetails:T}=e.displayValidation,{labelProps:B,inputProps:w,descriptionProps:M,errorMessageProps:A}=si({...t,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:vr(e.isOpen&&y.onKeyDown,v,t.onKeyDown),onBlur:S,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:x,autoComplete:"off",validate:void 0,[Ar]:e},i),E=u(W=>{if(W.pointerType==="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(null,"manual")}},"onPress"),I=u(W=>{if(W.pointerType!=="touch"){var Z;(Z=i.current)===null||Z===void 0||Z.focus(),e.toggle(W.pointerType==="keyboard"||W.pointerType==="virtual"?"first":null,"manual")}},"onPressStart"),D=Xn({id:p.id,"aria-label":h.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),P=Xn({id:m.id,"aria-label":h.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||B.id}),R=(0,wp.element.useRef)(0),L=u(W=>{if(d||c)return;if(W.timeStamp-R.current<500){var Z;W.preventDefault(),(Z=i.current)===null||Z===void 0||Z.focus();return}let ee=W.target.getBoundingClientRect(),De=W.changedTouches[0],qt=Math.ceil(ee.left+.5*ee.width),ni=Math.ceil(ee.top+.5*ee.height);if(De.clientX===qt&&De.clientY===ni){var yr;W.preventDefault(),(yr=i.current)===null||yr===void 0||yr.focus(),e.toggle(null,"manual"),R.current=W.timeStamp}},"onTouchEnd"),k=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0;var F;let N=(F=k?.parentKey)!==null&&F!==void 0?F:null;var z;let G=(z=e.selectionManager.focusedKey)!==null&&z!==void 0?z:null,le=(0,wp.element.useRef)(N),ie=(0,wp.element.useRef)(G);(0,wp.element.useEffect)(()=>{if(jc()&&k!=null&&G!=null&&G!==ie.current){let Z=e.selectionManager.isSelected(G),ee=N!=null?e.collection.getItem(N):null,De=ee?.["aria-label"]||(typeof ee?.rendered=="string"?ee.rendered:"")||"";var W;let qt=h.format("focusAnnouncement",{isGroupChange:(W=ee&&N!==le.current)!==null&&W!==void 0?W:!1,groupTitle:De,groupCount:ee?[...Bd(ee,e.collection)].length:0,optionText:k["aria-label"]||k.textValue||"",isSelected:Z});xa(qt)}le.current=N,ie.current=G});let me=dD(e.collection),ve=(0,wp.element.useRef)(me),ce=(0,wp.element.useRef)(e.isOpen);(0,wp.element.useEffect)(()=>{let W=e.isOpen!==ce.current&&(e.selectionManager.focusedKey==null||jc());if(e.isOpen&&(W||me!==ve.current)){let Z=h.format("countAnnouncement",{optionCount:me});xa(Z)}ve.current=me,ce.current=e.isOpen});let K=(0,wp.element.useRef)(e.selectedKey);return(0,wp.element.useEffect)(()=>{if(jc()&&e.isFocused&&e.selectedItem&&e.selectedKey!==K.current){let W=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",Z=h.format("selectedAnnouncement",{optionText:W});xa(Z)}K.current=e.selectedKey}),(0,wp.element.useEffect)(()=>{if(e.isOpen)return Hg([i.current,r.current].filter(W=>W!=null))},[e.isOpen,i,r]),ym(()=>{!k&&i.current&&Ke(he(i.current))===i.current&&Tg(i.current,null)},[k]),un(l,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:B,buttonProps:{...p,...D,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:E,onPressStart:I,isDisabled:d||c},inputProps:ne(w,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?m.id:void 0,"aria-autocomplete":"list","aria-activedescendant":k?Jk(e,k.key):void 0,onTouchEnd:L,autoCorrect:"off",spellCheck:"false"}),listBoxProps:ne(m,P,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),descriptionProps:M,errorMessageProps:A,isInvalid:C,validationErrors:Q,validationDetails:T}}u(KD,"$c350ade66beef0af$export$8c18d1b4f7232bbf");var UD={};UD={calendar:"\u0627\u0644\u062A\u0642\u0648\u064A\u0645",day:"\u064A\u0648\u0645",dayPeriod:"\u0635/\u0645",endDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621",era:"\u0627\u0644\u0639\u0635\u0631",hour:"\u0627\u0644\u0633\u0627\u0639\u0627\u062A",minute:"\u0627\u0644\u062F\u0642\u0627\u0626\u0642",month:"\u0627\u0644\u0634\u0647\u0631",second:"\u0627\u0644\u062B\u0648\u0627\u0646\u064A",selectedDateDescription:t=>`\u062A\u0627\u0631\u064A\u062E \u0645\u062D\u062F\u062F: ${t.date}`,selectedRangeDescription:t=>`\u0627\u0644\u0645\u062F\u0649 \u0627\u0644\u0632\u0645\u0646\u064A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.startDate} \u0625\u0644\u0649 ${t.endDate}`,selectedTimeDescription:t=>`\u0627\u0644\u0648\u0642\u062A \u0627\u0644\u0645\u062D\u062F\u062F: ${t.time}`,startDate:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621",timeZoneName:"\u0627\u0644\u062A\u0648\u0642\u064A\u062A",weekday:"\u0627\u0644\u064A\u0648\u0645",year:"\u0627\u0644\u0633\u0646\u0629"};var GD={};GD={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D",dayPeriod:"\u043F\u0440.\u043E\u0431./\u0441\u043B.\u043E\u0431.",endDate:"\u041A\u0440\u0430\u0439\u043D\u0430 \u0434\u0430\u0442\u0430",era:"\u0435\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u0434\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0418\u0437\u0431\u0440\u0430\u043D\u043E \u0432\u0440\u0435\u043C\u0435: ${t.time}`,startDate:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430 \u0434\u0430\u0442\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0435\u043D \u043E\u0442 \u0441\u0435\u0434\u043C\u0438\u0446\u0430\u0442\u0430",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var _D={};_D={calendar:"Kalend\xE1\u0159",day:"den",dayPeriod:"\u010D\xE1st dne",endDate:"Kone\u010Dn\xE9 datum",era:"letopo\u010Det",hour:"hodina",minute:"minuta",month:"m\u011Bs\xEDc",second:"sekunda",selectedDateDescription:t=>`Vybran\xE9 datum: ${t.date}`,selectedRangeDescription:t=>`Vybran\xE9 obdob\xED: ${t.startDate} a\u017E ${t.endDate}`,selectedTimeDescription:t=>`Vybran\xFD \u010Das: ${t.time}`,startDate:"Po\u010D\xE1te\u010Dn\xED datum",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"den v t\xFDdnu",year:"rok"};var HD={};HD={calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xE6ra",hour:"time",minute:"minut",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt interval: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tidspunkt: ${t.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xE5r"};var JD={};JD={calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xE4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:t=>`Ausgew\xE4hltes Datum: ${t.date}`,selectedRangeDescription:t=>`Ausgew\xE4hlter Bereich: ${t.startDate} bis ${t.endDate}`,selectedTimeDescription:t=>`Ausgew\xE4hlte Zeit: ${t.time}`,startDate:"Startdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"};var e2={};e2={calendar:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BB\u03CC\u03B3\u03B9\u03BF",day:"\u03B7\u03BC\u03AD\u03C1\u03B1",dayPeriod:"\u03C0.\u03BC./\u03BC.\u03BC.",endDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2",era:"\u03C0\u03B5\u03C1\u03AF\u03BF\u03B4\u03BF\u03C2",hour:"\u03CE\u03C1\u03B1",minute:"\u03BB\u03B5\u03C0\u03C4\u03CC",month:"\u03BC\u03AE\u03BD\u03B1\u03C2",second:"\u03B4\u03B5\u03C5\u03C4\u03B5\u03C1\u03CC\u03BB\u03B5\u03C0\u03C4\u03BF",selectedDateDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1: ${t.date}`,selectedRangeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03BF \u03B5\u03CD\u03C1\u03BF\u03C2: ${t.startDate} \u03AD\u03C9\u03C2 ${t.endDate}`,selectedTimeDescription:t=>`\u0395\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03CE\u03C1\u03B1: ${t.time}`,startDate:"\u0397\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2",timeZoneName:"\u03B6\u03CE\u03BD\u03B7 \u03CE\u03C1\u03B1\u03C2",weekday:"\u03BA\u03B1\u03B8\u03B7\u03BC\u03B5\u03C1\u03B9\u03BD\u03AE",year:"\u03AD\u03C4\u03BF\u03C2"};var t2={};t2={era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:t=>`Selected Date: ${t.date}`,selectedRangeDescription:t=>`Selected Range: ${t.startDate} to ${t.endDate}`,selectedTimeDescription:t=>`Selected Time: ${t.time}`};var n2={};n2={calendar:"Calendario",day:"d\xEDa",dayPeriod:"a.\xA0m./p.\xA0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:t=>`Fecha seleccionada: ${t.date}`,selectedRangeDescription:t=>`Rango seleccionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora seleccionada: ${t.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xEDa de la semana",year:"a\xF1o"};var r2={};r2={calendar:"Kalender",day:"p\xE4ev",dayPeriod:"enne/p\xE4rast l\xF5unat",endDate:"L\xF5ppkuup\xE4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:t=>`Valitud kuup\xE4ev: ${t.date}`,selectedRangeDescription:t=>`Valitud vahemik: ${t.startDate} kuni ${t.endDate}`,selectedTimeDescription:t=>`Valitud aeg: ${t.time}`,startDate:"Alguskuup\xE4ev",timeZoneName:"ajav\xF6\xF6nd",weekday:"n\xE4dalap\xE4ev",year:"aasta"};var i2={};i2={calendar:"Kalenteri",day:"p\xE4iv\xE4",dayPeriod:"vuorokaudenaika",endDate:"P\xE4\xE4ttymisp\xE4iv\xE4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:t=>`Valittu p\xE4iv\xE4m\xE4\xE4r\xE4: ${t.date}`,selectedRangeDescription:t=>`Valittu aikav\xE4li: ${t.startDate} \u2013 ${t.endDate}`,selectedTimeDescription:t=>`Valittu aika: ${t.time}`,startDate:"Alkamisp\xE4iv\xE4",timeZoneName:"aikavy\xF6hyke",weekday:"viikonp\xE4iv\xE4",year:"vuosi"};var l2={};l2={calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xE8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:t=>`Date s\xE9lectionn\xE9e\xA0: ${t.date}`,selectedRangeDescription:t=>`Plage s\xE9lectionn\xE9e\xA0: ${t.startDate} au ${t.endDate}`,selectedTimeDescription:t=>`Heure choisie\xA0: ${t.time}`,startDate:"Date de d\xE9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xE9e"};var a2={};a2={calendar:"\u05DC\u05D5\u05D7 \u05E9\u05E0\u05D4",day:"\u05D9\u05D5\u05DD",dayPeriod:"\u05DC\u05E4\u05E0\u05D4\u05F4\u05E6/\u05D0\u05D7\u05D4\u05F4\u05E6",endDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05E1\u05D9\u05D5\u05DD",era:"\u05EA\u05E7\u05D5\u05E4\u05D4",hour:"\u05E9\u05E2\u05D4",minute:"\u05D3\u05E7\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",second:"\u05E9\u05E0\u05D9\u05D9\u05D4",selectedDateDescription:t=>`\u05EA\u05D0\u05E8\u05D9\u05DA \u05E0\u05D1\u05D7\u05E8: ${t.date}`,selectedRangeDescription:t=>`\u05D8\u05D5\u05D5\u05D7 \u05E0\u05D1\u05D7\u05E8: ${t.startDate} \u05E2\u05D3 ${t.endDate}`,selectedTimeDescription:t=>`\u05D6\u05DE\u05DF \u05E0\u05D1\u05D7\u05E8: ${t.time}`,startDate:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05EA\u05D7\u05DC\u05D4",timeZoneName:"\u05D0\u05D6\u05D5\u05E8 \u05D6\u05DE\u05DF",weekday:"\u05D9\u05D5\u05DD \u05D1\u05E9\u05D1\u05D5\u05E2",year:"\u05E9\u05E0\u05D4"};var o2={};o2={calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum zavr\u0161etka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:t=>`Odabrani datum: ${t.date}`,selectedRangeDescription:t=>`Odabrani raspon: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Odabrano vrijeme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"};var s2={};s2={calendar:"Napt\xE1r",day:"nap",dayPeriod:"napszak",endDate:"Befejez\u0151 d\xE1tum",era:"\xE9ra",hour:"\xF3ra",minute:"perc",month:"h\xF3nap",second:"m\xE1sodperc",selectedDateDescription:t=>`Kijel\xF6lt d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Kijel\xF6lt tartom\xE1ny: ${t.startDate}\u2013${t.endDate}`,selectedTimeDescription:t=>`Kijel\xF6lt id\u0151: ${t.time}`,startDate:"Kezd\u0151 d\xE1tum",timeZoneName:"id\u0151z\xF3na",weekday:"h\xE9t napja",year:"\xE9v"};var u2={};u2={calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:t=>`Data selezionata: ${t.date}`,selectedRangeDescription:t=>`Intervallo selezionato: da ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Ora selezionata: ${t.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"};var c2={};c2={calendar:"\u30AB\u30EC\u30F3\u30C0\u30FC",day:"\u65E5",dayPeriod:"\u5348\u524D/\u5348\u5F8C",endDate:"\u7D42\u4E86\u65E5",era:"\u6642\u4EE3",hour:"\u6642",minute:"\u5206",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u629E\u3057\u305F\u65E5\u4ED8 : ${t.date}`,selectedRangeDescription:t=>`\u9078\u629E\u7BC4\u56F2 : ${t.startDate} \u304B\u3089 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u629E\u3057\u305F\u6642\u9593 : ${t.time}`,startDate:"\u958B\u59CB\u65E5",timeZoneName:"\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3",weekday:"\u66DC\u65E5",year:"\u5E74"};var d2={};d2={calendar:"\uB2EC\uB825",day:"\uC77C",dayPeriod:"\uC624\uC804/\uC624\uD6C4",endDate:"\uC885\uB8CC\uC77C",era:"\uC5F0\uD638",hour:"\uC2DC",minute:"\uBD84",month:"\uC6D4",second:"\uCD08",selectedDateDescription:t=>`\uC120\uD0DD \uC77C\uC790: ${t.date}`,selectedRangeDescription:t=>`\uC120\uD0DD \uBC94\uC704: ${t.startDate} ~ ${t.endDate}`,selectedTimeDescription:t=>`\uC120\uD0DD \uC2DC\uAC04: ${t.time}`,startDate:"\uC2DC\uC791\uC77C",timeZoneName:"\uC2DC\uAC04\uB300",weekday:"\uC694\uC77C",year:"\uB144"};var f2={};f2={calendar:"Kalendorius",day:"diena",dayPeriod:"iki piet\u0173 / po piet\u0173",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minut\u0117",month:"m\u0117nuo",second:"sekund\u0117",selectedDateDescription:t=>`Pasirinkta data: ${t.date}`,selectedRangeDescription:t=>`Pasirinktas intervalas: nuo ${t.startDate} iki ${t.endDate}`,selectedTimeDescription:t=>`Pasirinktas laikas: ${t.time}`,startDate:"Prad\u017Eios data",timeZoneName:"laiko juosta",weekday:"savait\u0117s diena",year:"metai"};var h2={};h2={calendar:"Kalend\u0101rs",day:"diena",dayPeriod:"priek\u0161pusdien\u0101/p\u0113cpusdien\u0101",endDate:"Beigu datums",era:"\u0113ra",hour:"stundas",minute:"min\u016Btes",month:"m\u0113nesis",second:"sekundes",selectedDateDescription:t=>`Atlas\u012Btais datums: ${t.date}`,selectedRangeDescription:t=>`Atlas\u012Btais diapazons: no ${t.startDate} l\u012Bdz ${t.endDate}`,selectedTimeDescription:t=>`Atlas\u012Btais laiks: ${t.time}`,startDate:"S\u0101kuma datums",timeZoneName:"laika josla",weekday:"ned\u0113\u013Cas diena",year:"gads"};var p2={};p2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xE5ned",second:"sekund",selectedDateDescription:t=>`Valgt dato: ${t.date}`,selectedRangeDescription:t=>`Valgt omr\xE5de: ${t.startDate} til ${t.endDate}`,selectedTimeDescription:t=>`Valgt tid: ${t.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xE5r"};var m2={};m2={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:t=>`Geselecteerde datum: ${t.date}`,selectedRangeDescription:t=>`Geselecteerd bereik: ${t.startDate} tot ${t.endDate}`,selectedTimeDescription:t=>`Geselecteerde tijd: ${t.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"};var g2={};g2={calendar:"Kalendarz",day:"dzie\u0144",dayPeriod:"rano / po po\u0142udniu / wieczorem",endDate:"Data ko\u0144cowa",era:"era",hour:"godzina",minute:"minuta",month:"miesi\u0105c",second:"sekunda",selectedDateDescription:t=>`Wybrana data: ${t.date}`,selectedRangeDescription:t=>`Wybrany zakres: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Wybrany czas: ${t.time}`,startDate:"Data pocz\u0105tkowa",timeZoneName:"strefa czasowa",weekday:"dzie\u0144 tygodnia",year:"rok"};var O2={};O2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var b2={};b2={calendar:"Calend\xE1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xE9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xEAs",second:"segundo",selectedDateDescription:t=>`Data selecionada: ${t.date}`,selectedRangeDescription:t=>`Intervalo selecionado: ${t.startDate} a ${t.endDate}`,selectedTimeDescription:t=>`Hora selecionada: ${t.time}`,startDate:"Data de In\xEDcio",timeZoneName:"fuso hor\xE1rio",weekday:"dia da semana",year:"ano"};var y2={};y2={calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dat\u0103 final",era:"er\u0103",hour:"or\u0103",minute:"minut",month:"lun\u0103",second:"secund\u0103",selectedDateDescription:t=>`Dat\u0103 selectat\u0103: ${t.date}`,selectedRangeDescription:t=>`Interval selectat: de la ${t.startDate} p\xE2n\u0103 la ${t.endDate}`,selectedTimeDescription:t=>`Ora selectat\u0103: ${t.time}`,startDate:"Dat\u0103 \xEEnceput",timeZoneName:"fus orar",weekday:"ziua din s\u0103pt\u0103m\xE2n\u0103",year:"an"};var v2={};v2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C",day:"\u0434\u0435\u043D\u044C",dayPeriod:"AM/PM",endDate:"\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F",era:"\u044D\u0440\u0430",hour:"\u0447\u0430\u0441",minute:"\u043C\u0438\u043D\u0443\u0442\u0430",month:"\u043C\u0435\u0441\u044F\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D: \u0441 ${t.startDate} \u043F\u043E ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u043D\u0435\u0434\u0435\u043B\u0438",year:"\u0433\u043E\u0434"};var $2={};$2={calendar:"Kalend\xE1r",day:"de\u0148",dayPeriod:"AM/PM",endDate:"D\xE1tum ukon\u010Denia",era:"letopo\u010Det",hour:"hodina",minute:"min\xFAta",month:"mesiac",second:"sekunda",selectedDateDescription:t=>`Vybrat\xFD d\xE1tum: ${t.date}`,selectedRangeDescription:t=>`Vybrat\xFD rozsah: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Vybrat\xFD \u010Das: ${t.time}`,startDate:"D\xE1tum za\u010Datia",timeZoneName:"\u010Dasov\xE9 p\xE1smo",weekday:"de\u0148 t\xFD\u017Ed\u0148a",year:"rok"};var w2={};w2={calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:t=>`Izbrani datum: ${t.date}`,selectedRangeDescription:t=>`Izbrano obmo\u010Dje: ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izbrani \u010Das: ${t.time}`,startDate:"Datum za\u010Detka",timeZoneName:"\u010Dasovni pas",weekday:"dan v tednu",year:"leto"};var x2={};x2={calendar:"Kalendar",day:"\u0434\u0430\u043D",dayPeriod:"\u043F\u0440\u0435 \u043F\u043E\u0434\u043D\u0435/\u043F\u043E \u043F\u043E\u0434\u043D\u0435",endDate:"Datum zavr\u0161etka",era:"\u0435\u0440\u0430",hour:"\u0441\u0430\u0442",minute:"\u043C\u0438\u043D\u0443\u0442",month:"\u043C\u0435\u0441\u0435\u0446",second:"\u0441\u0435\u043A\u0443\u043D\u0434",selectedDateDescription:t=>`Izabrani datum: ${t.date}`,selectedRangeDescription:t=>`Izabrani opseg: od ${t.startDate} do ${t.endDate}`,selectedTimeDescription:t=>`Izabrano vreme: ${t.time}`,startDate:"Datum po\u010Detka",timeZoneName:"\u0432\u0440\u0435\u043C\u0435\u043D\u0441\u043A\u0430 \u0437\u043E\u043D\u0430",weekday:"\u0434\u0430\u043D \u0443 \u043D\u0435\u0434\u0435\u0459\u0438",year:"\u0433\u043E\u0434\u0438\u043D\u0430"};var S2={};S2={calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xE5nad",second:"sekund",selectedDateDescription:t=>`Valt datum: ${t.date}`,selectedRangeDescription:t=>`Valt intervall: ${t.startDate} till ${t.endDate}`,selectedTimeDescription:t=>`Vald tid: ${t.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xE5r"};var C2={};C2={calendar:"Takvim",day:"g\xFCn",dayPeriod:"\xD6\xD6/\xD6S",endDate:"Biti\u015F Tarihi",era:"\xE7a\u011F",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:t=>`Se\xE7ilen Tarih: ${t.date}`,selectedRangeDescription:t=>`Se\xE7ilen Aral\u0131k: ${t.startDate} - ${t.endDate}`,selectedTimeDescription:t=>`Se\xE7ilen Zaman: ${t.time}`,startDate:"Ba\u015Flang\u0131\xE7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftan\u0131n g\xFCn\xFC",year:"y\u0131l"};var k2={};k2={calendar:"\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",day:"\u0434\u0435\u043D\u044C",dayPeriod:"\u0434\u043F/\u043F\u043F",endDate:"\u0414\u0430\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F",era:"\u0435\u0440\u0430",hour:"\u0433\u043E\u0434\u0438\u043D\u0430",minute:"\u0445\u0432\u0438\u043B\u0438\u043D\u0430",month:"\u043C\u0456\u0441\u044F\u0446\u044C",second:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",selectedDateDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430: ${t.date}`,selectedRangeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D: ${t.startDate} \u2014 ${t.endDate}`,selectedTimeDescription:t=>`\u0412\u0438\u0431\u0440\u0430\u043D\u0438\u0439 \u0447\u0430\u0441: ${t.time}`,startDate:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443",timeZoneName:"\u0447\u0430\u0441\u043E\u0432\u0438\u0439 \u043F\u043E\u044F\u0441",weekday:"\u0434\u0435\u043D\u044C \u0442\u0438\u0436\u043D\u044F",year:"\u0440\u0456\u043A"};var D2={};D2={calendar:"\u65E5\u5386",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7ED3\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9009\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9009\u5B9A\u7684\u8303\u56F4\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9009\u5B9A\u7684\u65F6\u95F4\uFF1A${t.time}`,startDate:"\u5F00\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var P2={};P2={calendar:"\u65E5\u66C6",day:"\u65E5",dayPeriod:"\u4E0A\u5348/\u4E0B\u5348",endDate:"\u7D50\u675F\u65E5\u671F",era:"\u7EAA\u5143",hour:"\u5C0F\u65F6",minute:"\u5206\u949F",month:"\u6708",second:"\u79D2",selectedDateDescription:t=>`\u9078\u5B9A\u7684\u65E5\u671F\uFF1A${t.date}`,selectedRangeDescription:t=>`\u9078\u5B9A\u7684\u7BC4\u570D\uFF1A${t.startDate} \u81F3 ${t.endDate}`,selectedTimeDescription:t=>`\u9078\u5B9A\u7684\u6642\u9593\uFF1A${t.time}`,startDate:"\u958B\u59CB\u65E5\u671F",timeZoneName:"\u65F6\u533A",weekday:"\u5DE5\u4F5C\u65E5",year:"\u5E74"};var ps={};ps={"ar-AE":UD,"bg-BG":GD,"cs-CZ":_D,"da-DK":HD,"de-DE":JD,"el-GR":e2,"en-US":t2,"es-ES":n2,"et-EE":r2,"fi-FI":i2,"fr-FR":l2,"he-IL":a2,"hr-HR":o2,"hu-HU":s2,"it-IT":u2,"ja-JP":c2,"ko-KR":d2,"lt-LT":f2,"lv-LV":h2,"nb-NO":p2,"nl-NL":m2,"pl-PL":g2,"pt-BR":O2,"pt-PT":b2,"ro-RO":y2,"ru-RU":v2,"sk-SK":$2,"sl-SI":w2,"sr-SP":x2,"sv-SE":S2,"tr-TR":C2,"uk-UA":k2,"zh-CN":D2,"zh-TW":P2};function r0(t,e,n){let{direction:r}=Re(),i=(0,wp.element.useMemo)(()=>wd(e),[e]),l=u(s=>{if(s.currentTarget.contains(s.target)&&(s.altKey&&(s.key==="ArrowDown"||s.key==="ArrowUp")&&"setOpen"in t&&(s.preventDefault(),s.stopPropagation(),t.setOpen(!0)),!n))switch(s.key){case"ArrowLeft":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=E2(e.current,c.getBoundingClientRect().left,-1);d&&d.focus()}}else i.focusPrevious();break;case"ArrowRight":if(s.preventDefault(),s.stopPropagation(),r==="rtl"){if(e.current){let c=s.target,d=E2(e.current,c.getBoundingClientRect().left,1);d&&d.focus()}}else i.focusNext();break}},"onKeyDown"),a=u(()=>{var s;if(!e.current)return;let c=(s=window.event)===null||s===void 0?void 0:s.target,d=ut(e.current,{tabbable:!0});if(c&&(d.currentNode=c,c=d.previousNode()),!c){let f;do f=d.lastChild(),f&&(c=f);while(f)}for(;c?.hasAttribute("data-placeholder");){let f=d.previousNode();if(f&&f.hasAttribute("data-placeholder"))c=f;else break}c&&c.focus()},"focusLast"),{pressProps:o}=jn({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(s){s.pointerType==="mouse"&&a()},onPress(s){(s.pointerType==="touch"||s.pointerType==="pen")&&a()}});return ne(o,{onKeyDown:l})}u(r0,"$3dfb0f96be0d6a08$export$4a931266a3838b86");function E2(t,e,n){let r=ut(t,{tabbable:!0}),i=r.nextNode(),l=null,a=1/0;for(;i;){let s=i.getBoundingClientRect().left-e,c=Math.abs(s);Math.sign(s)===n&&c{var w;e.confirmPlaceholder(),e.value!==f.current&&e.commitValidation(),(w=t.onBlur)===null||w===void 0||w.call(t,B)},onFocusWithinChange:t.onFocusChange}),p=Yt(dF(ps),"@react-aria/datepicker"),m=e.maxGranularity==="hour"?"selectedTimeDescription":"selectedDateDescription",g=e.maxGranularity==="hour"?"time":"date",O=e.value?p.format(m,{[g]:e.formatValue({month:"long"})}):"",b=Fo(O),y=t[ms]==="presentation"?s["aria-describedby"]:[b["aria-describedby"],s["aria-describedby"]].filter(Boolean).join(" ")||void 0,$=t[A2],v=(0,wp.element.useMemo)(()=>$||wd(n),[$,n]),S=r0(e,n,t[ms]==="presentation");T2.set(e,{ariaLabel:t["aria-label"],ariaLabelledBy:[o.id,t["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:y,focusManager:v});let x=(0,wp.element.useRef)(t.autoFocus),C;t[ms]==="presentation"?C={role:"presentation"}:C=ne(s,{role:"group","aria-disabled":t.isDisabled||void 0,"aria-describedby":y}),(0,wp.element.useEffect)(()=>{x.current&&v.focusFirst(),x.current=!1},[v]),Sr(t.inputRef,e.defaultValue,e.setValue),as({...t,focus(){v.focusFirst()}},e,t.inputRef);let Q={type:"hidden",name:t.name,form:t.form,value:((r=e.value)===null||r===void 0?void 0:r.toString())||"",disabled:t.isDisabled};t.validationBehavior==="native"&&(Q.type="text",Q.hidden=!0,Q.required=t.isRequired,Q.onChange=()=>{});let T=yt(t);return{labelProps:{...o,onClick:()=>{v.focusFirst()}},fieldProps:ne(T,C,S,h,{onKeyDown(B){t.onKeyDown&&t.onKeyDown(B)},onKeyUp(B){t.onKeyUp&&t.onKeyUp(B)},style:{unicodeBidi:"isolate"}}),inputProps:Q,descriptionProps:c,errorMessageProps:d,isInvalid:i,validationErrors:l,validationDetails:a}}u(Q2,"$16f0b7bb276bc17e$export$5591b0b878c1a989");function fF(t,e,n){var r;let i=Q2(t,e,n);return i.inputProps.value=((r=e.timeValue)===null||r===void 0?void 0:r.toString())||"",i}u(fF,"$16f0b7bb276bc17e$export$4c842f6a241dc825");function hF(t){return t&&t.__esModule?t.default:t}u(hF,"$parcel$interopDefault$3");function pF(t,e,n){let r=Ie(),i=Ie(),l=Ie(),a=Yt(hF(ps),"@react-aria/datepicker"),{isInvalid:o,validationErrors:s,validationDetails:c}=e.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:h,errorMessageProps:p}=$t({...t,labelElementType:"span",isInvalid:o,errorMessage:t.errorMessage||s}),m=r0(e,n),g=f["aria-labelledby"]||f.id,{locale:O}=Re(),b=e.formatValue(O,{month:"long"}),y=b?a.format("selectedDateDescription",{date:b}):"",$=Fo(y),v=[$["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,S=yt(t),x=(0,wp.element.useMemo)(()=>wd(n),[n]),C=(0,wp.element.useRef)(!1),{focusWithinProps:Q}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:T=>{let B=document.getElementById(i);if(!B?.contains(T.relatedTarget)){var w,M;C.current=!1,(w=t.onBlur)===null||w===void 0||w.call(t,T),(M=t.onFocusChange)===null||M===void 0||M.call(t,!1)}},onFocusWithin:T=>{if(!C.current){var B,w;C.current=!0,(B=t.onFocus)===null||B===void 0||B.call(t,T),(w=t.onFocusChange)===null||w===void 0||w.call(t,!0)}}});return{groupProps:ne(S,m,f,$,Q,{role:"group","aria-disabled":t.isDisabled||null,"aria-labelledby":g,"aria-describedby":v,onKeyDown(T){e.isOpen||t.onKeyDown&&t.onKeyDown(T)},onKeyUp(T){e.isOpen||t.onKeyUp&&t.onKeyUp(T)}}),labelProps:{...d,onClick:()=>{x.focusFirst()}},fieldProps:{...f,id:l,[ms]:"presentation","aria-describedby":v,value:e.value,defaultValue:e.defaultValue,onChange:e.setValue,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,granularity:t.granularity,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior,[Ar]:e,autoFocus:t.autoFocus,name:t.name,form:t.form},descriptionProps:h,errorMessageProps:p,buttonProps:{...$,id:r,"aria-haspopup":"dialog","aria-label":a.format("calendar"),"aria-labelledby":`${r} ${g}`,"aria-describedby":v,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:i,"aria-labelledby":`${r} ${g}`},calendarProps:{autoFocus:!0,value:e.dateValue,onChange:e.setDateValue,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,defaultFocusedValue:e.dateValue?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:o,validationErrors:s,validationDetails:c}}u(pF,"$6057a3d2a53a12fd$export$42df105a73306d51");function mF(t){return t&&t.__esModule?t.default:t}u(mF,"$parcel$interopDefault$2");function gF(){let{locale:t}=Re(),e=B3(mF(ps),"@react-aria/datepicker");return(0,wp.element.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new i0(t,e)}},[t,e])}u(gF,"$3aeceb3a64eb8358$export$d42c60378c8168f8");const xv=class xv{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,n){this.locale=e,this.dictionary=n}};u(xv,"$3aeceb3a64eb8358$var$DisplayNamesPolyfill");let i0=xv;function OF(t,e,n){let r=(0,wp.element.useRef)(""),{locale:i,direction:l}=Re(),a=gF(),{ariaLabel:o,ariaLabelledBy:s,ariaDescribedBy:c,focusManager:d}=T2.get(e),f=t.isPlaceholder?"":t.text,h=(0,wp.element.useMemo)(()=>e.dateFormatter.resolvedOptions(),[e.dateFormatter]),p=qn({month:"long",timeZone:h.timeZone}),m=qn({hour:"numeric",hour12:h.hour12,timeZone:h.timeZone});if(t.type==="month"&&!t.isPlaceholder){let k=p.format(e.dateValue);f=k!==f?`${f} \u2013 ${k}`:k}else t.type==="hour"&&!t.isPlaceholder&&(f=m.format(e.dateValue));let{spinButtonProps:g}=jg({value:t.value,textValue:f,minValue:t.minValue,maxValue:t.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly||!t.isEditable,isRequired:e.isRequired,onIncrement:()=>{r.current="",e.increment(t.type)},onDecrement:()=>{r.current="",e.decrement(t.type)},onIncrementPage:()=>{r.current="",e.incrementPage(t.type)},onDecrementPage:()=>{r.current="",e.decrementPage(t.type)},onIncrementToMax:()=>{r.current="",t.maxValue!==void 0&&e.setSegment(t.type,t.maxValue)},onDecrementToMin:()=>{r.current="",t.minValue!==void 0&&e.setSegment(t.type,t.minValue)}}),O=(0,wp.element.useMemo)(()=>new es(i,{maximumFractionDigits:0}),[i]),b=u(()=>{if(t.text===t.placeholder&&d.focusPrevious(),O.isValidPartialNumber(t.text)&&!e.isReadOnly&&!t.isPlaceholder){let k=t.text.slice(0,-1),F=O.parse(k);k=F===0?"":k,k.length===0||F===0?e.clearSegment(t.type):e.setSegment(t.type,F),r.current=k}else t.type==="dayPeriod"&&e.clearSegment(t.type)},"backspace"),y=u(k=>{if(k.key==="a"&&(wr()?k.metaKey:k.ctrlKey)&&k.preventDefault(),!(k.ctrlKey||k.metaKey||k.shiftKey||k.altKey))switch(k.key){case"Backspace":case"Delete":k.preventDefault(),k.stopPropagation(),b();break}},"onKeyDown"),{startsWith:$}=Cg({sensitivity:"base"}),v=qn({hour:"numeric",hour12:!0}),S=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(0),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),x=(0,wp.element.useMemo)(()=>{let k=new Date;return k.setHours(12),v.formatToParts(k).find(F=>F.type==="dayPeriod").value},[v]),C=qn({year:"numeric",era:"narrow",timeZone:"UTC"}),Q=(0,wp.element.useMemo)(()=>{if(t.type!=="era")return[];let k=Ne(new Fe(1,1,1),e.calendar),F=e.calendar.getEras().map(z=>{let G=k.set({year:1,month:1,day:1,era:z}).toDate("UTC"),ie=C.formatToParts(G).find(me=>me.type==="era").value;return{era:z,formatted:ie}}),N=bF(F.map(z=>z.formatted));if(N)for(let z of F)z.formatted=z.formatted.slice(N);return F},[C,e.calendar,t.type]),T=u(k=>{if(e.isDisabled||e.isReadOnly)return;let F=r.current+k;switch(t.type){case"dayPeriod":if($(S,k))e.setSegment("dayPeriod",0);else if($(x,k))e.setSegment("dayPeriod",12);else break;d.focusNext();break;case"era":{let N=Q.find(z=>$(z.formatted,k));N&&(e.setSegment("era",N.era),d.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!O.isValidPartialNumber(F))return;let N=O.parse(F),z=N,G=t.minValue===0;if(t.type==="hour"&&e.dateFormatter.resolvedOptions().hour12){switch(e.dateFormatter.resolvedOptions().hourCycle){case"h11":N>11&&(z=O.parse(k));break;case"h12":G=!1,N>12&&(z=O.parse(k));break}t.value!==void 0&&t.value>=12&&N>1&&(N+=12)}else t.maxValue!==void 0&&N>t.maxValue&&(z=O.parse(k));if(isNaN(N))return;let le=z!==0||G;le&&e.setSegment(t.type,z),t.maxValue!==void 0&&(+(N+"0")>t.maxValue||F.length>=String(t.maxValue).length)?(r.current="",le&&d.focusNext()):r.current=F;break}}},"onInput"),B=u(()=>{r.current="",n.current&&Yc(n.current,{containingElement:Wc(n.current)});let k=window.getSelection();k?.collapse(n.current)},"onFocus"),w=(0,wp.element.useRef)(typeof document<"u"?document:null);un(w,"selectionchange",()=>{var k;let F=window.getSelection();F?.anchorNode&&(!((k=n.current)===null||k===void 0)&&k.contains(F?.anchorNode))&&F.collapse(n.current)});let M=(0,wp.element.useRef)("");un(n,"beforeinput",k=>{if(n.current)switch(k.preventDefault(),k.inputType){case"deleteContentBackward":case"deleteContentForward":O.isValidPartialNumber(t.text)&&!e.isReadOnly&&b();break;case"insertCompositionText":M.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:k.data!=null&&T(k.data);break}}),un(n,"input",k=>{let{inputType:F,data:N}=k;switch(F){case"insertCompositionText":n.current&&(n.current.textContent=M.current),N!=null&&($(S,N)||$(x,N))&&T(N);break}}),Pe(()=>{let k=n.current;return()=>{document.activeElement===k&&(d.focusPrevious()||d.focusNext())}},[n,d]);let A=ji()||t.type==="timeZoneName"?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{},E=(0,wp.element.useMemo)(()=>e.segments.find(k=>k.isEditable),[e.segments]);t!==E&&!e.isInvalid&&(c=void 0);let I=Ie(),D=!e.isDisabled&&!e.isReadOnly&&t.isEditable,P=t.type==="literal"?"":a.of(t.type),R=Xn({"aria-label":`${P}${o?`, ${o}`:""}${s?", ":""}`,"aria-labelledby":s});if(t.type==="literal")return{segmentProps:{"aria-hidden":!0}};let L={caretColor:"transparent"};if(l==="rtl"){L.unicodeBidi="embed";let k=h[t.type];(k==="numeric"||k==="2-digit")&&(L.direction="ltr")}return{segmentProps:ne(g,R,{id:I,...A,"aria-invalid":e.isInvalid?"true":void 0,"aria-describedby":c,"aria-readonly":e.isReadOnly||!t.isEditable?"true":void 0,"data-placeholder":t.isPlaceholder||void 0,contentEditable:D,suppressContentEditableWarning:D,spellCheck:D?"false":void 0,autoCorrect:D?"off":void 0,[parseInt(wp.element.version,10)>=17?"enterKeyHint":"enterkeyhint"]:D?"next":void 0,inputMode:e.isDisabled||t.type==="dayPeriod"||t.type==="era"||!D?void 0:"numeric",tabIndex:e.isDisabled?void 0:0,onKeyDown:y,onFocus:B,style:L,onPointerDown(k){k.stopPropagation()},onMouseDown(k){k.stopPropagation()}})}}u(OF,"$32489daedd52963e$export$1315d136e6f7581");function bF(t){t.sort();let e=t[0],n=t[t.length-1];for(let r=0;rwd(n,{accept:k=>k.id!==C}),[n,C]),M={[A2]:w,[ms]:"presentation","aria-describedby":B,placeholderValue:t.placeholderValue,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,granularity:t.granularity,shouldForceLeadingZeros:t.shouldForceLeadingZeros,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isRequired:t.isRequired,validationBehavior:t.validationBehavior},A=yt(t),E=(0,wp.element.useRef)(!1),{focusWithinProps:I}=Wt({...t,isDisabled:e.isOpen,onBlurWithin:k=>{let F=document.getElementById(Q);if(!F?.contains(k.relatedTarget)){var N,z;E.current=!1,(N=t.onBlur)===null||N===void 0||N.call(t,k),(z=t.onFocusChange)===null||z===void 0||z.call(t,!1)}},onFocusWithin:k=>{if(!E.current){var F,N;E.current=!0,(F=t.onFocus)===null||F===void 0||F.call(t,k),(N=t.onFocusChange)===null||N===void 0||N.call(t,!0)}}}),D=(0,wp.element.useRef)(tl),P=(0,wp.element.useRef)(tl);var R,L;return{groupProps:ne(A,T,p,v,I,{role:"group","aria-disabled":t.isDisabled||null,"aria-describedby":B,onKeyDown(k){e.isOpen||t.onKeyDown&&t.onKeyDown(k)},onKeyUp(k){e.isOpen||t.onKeyUp&&t.onKeyUp(k)}}),labelProps:{...h,onClick:()=>{w.focusFirst()}},buttonProps:{...v,id:C,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${C} ${O}`,"aria-describedby":B,"aria-expanded":e.isOpen,isDisabled:t.isDisabled||t.isReadOnly,onPress:()=>e.setOpen(!0)},dialogProps:{id:Q,"aria-labelledby":`${C} ${O}`},startFieldProps:{...S,...M,value:(R=(r=e.value)===null||r===void 0?void 0:r.start)!==null&&R!==void 0?R:null,defaultValue:(i=e.defaultValue)===null||i===void 0?void 0:i.start,onChange:k=>e.setDateTime("start",k),autoFocus:t.autoFocus,name:t.startName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){D.current=k,e.updateValidation(Sd(k,P.current))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},endFieldProps:{...x,...M,value:(L=(l=e.value)===null||l===void 0?void 0:l.end)!==null&&L!==void 0?L:null,defaultValue:(a=e.defaultValue)===null||a===void 0?void 0:a.end,onChange:k=>e.setDateTime("end",k),name:t.endName,form:t.form,[Ar]:{realtimeValidation:e.realtimeValidation,displayValidation:e.displayValidation,updateValidation(k){P.current=k,e.updateValidation(Sd(D.current,k))},resetValidation:e.resetValidation,commitValidation:e.commitValidation}},descriptionProps:m,errorMessageProps:g,calendarProps:{autoFocus:!0,value:!((o=e.dateRange)===null||o===void 0)&&o.start&&e.dateRange.end?e.dateRange:null,onChange:e.setDateRange,minValue:t.minValue,maxValue:t.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly,isDateUnavailable:t.isDateUnavailable,allowsNonContiguousRanges:t.allowsNonContiguousRanges,defaultFocusedValue:e.dateRange?void 0:t.placeholderValue,isInvalid:e.isInvalid,errorMessage:typeof t.errorMessage=="function"?t.errorMessage(e.displayValidation):t.errorMessage||e.displayValidation.validationErrors.join(" "),firstDayOfWeek:t.firstDayOfWeek,pageBehavior:t.pageBehavior},isInvalid:c,validationErrors:d,validationDetails:f}}u(M2,"$887cac91b7cc8801$export$12fd5f0e9f4bb192");function vF(t,e){let{role:n="dialog"}=t,r=ca();r=t["aria-label"]?void 0:r;let i=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{if(e.current&&!e.current.contains(document.activeElement)){Ui(e.current);let l=setTimeout(()=>{(document.activeElement===e.current||document.activeElement===document.body)&&(i.current=!0,e.current&&(e.current.blur(),Ui(e.current)),i.current=!1)},500);return()=>{clearTimeout(l)}}},[e]),Hk(),{dialogProps:{...yt(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||r,onBlur:l=>{i.current&&l.stopPropagation()}},titleProps:{id:r}}}u(vF,"$40df3f8667284809$export$d55e7ee900f34e93");var l0=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};function B2(){throw new Error("setTimeout has not been defined")}u(B2,"defaultSetTimout");function R2(){throw new Error("clearTimeout has not been defined")}u(R2,"defaultClearTimeout");var ui=B2,ci=R2;typeof l0.setTimeout=="function"&&(ui=setTimeout),typeof l0.clearTimeout=="function"&&(ci=clearTimeout);function V2(t){if(ui===setTimeout)return setTimeout(t,0);if((ui===B2||!ui)&&setTimeout)return ui=setTimeout,setTimeout(t,0);try{return ui(t,0)}catch{try{return ui.call(null,t,0)}catch{return ui.call(this,t,0)}}}u(V2,"runTimeout");function $F(t){if(ci===clearTimeout)return clearTimeout(t);if((ci===R2||!ci)&&clearTimeout)return ci=clearTimeout,clearTimeout(t);try{return ci(t)}catch{try{return ci.call(null,t)}catch{return ci.call(this,t)}}}u($F,"runClearTimeout");var Mr=[],Ea=!1,nl,Rd=-1;function wF(){!Ea||!nl||(Ea=!1,nl.length?Mr=nl.concat(Mr):Rd=-1,Mr.length&&N2())}u(wF,"cleanUpNextTick");function N2(){if(!Ea){var t=V2(wF);Ea=!0;for(var e=Mr.length;e;){for(nl=Mr,Mr=[];++Rd1)for(var n=1;n{I.stopPropagation(),e.setSelectedValue(r)},"onChange"),{pressProps:y,isPressed:$}=jn({onPressStart:o,onPressEnd:s,onPressChange:c,onPress:d,onPressUp:f,onClick:h,isDisabled:p}),{pressProps:v,isPressed:S}=jn({onPressStart:o,onPressEnd:s,onPressChange:c,onPressUp:f,onClick:h,isDisabled:p,onPress(I){var D;d?.(I),e.setSelectedValue(r),(D=n.current)===null||D===void 0||D.focus()}}),{focusableProps:x}=Xo(ne(t,{onFocus:()=>e.setLastFocusedValue(r)}),n),C=ne(y,x),Q=yt(t,{labelable:!0}),T=-1;e.selectedValue!=null?e.selectedValue===r&&(T=0):(e.lastFocusedValue===r||e.lastFocusedValue==null)&&(T=0),p&&(T=void 0);let{name:B,form:w,descriptionId:M,errorMessageId:A,validationBehavior:E}=I2.get(e);return Sr(n,e.defaultSelectedValue,e.setSelectedValue),as({validationBehavior:E},e,n),{labelProps:ne(v,(0,wp.element.useMemo)(()=>({onClick:I=>I.preventDefault(),onMouseDown:I=>I.preventDefault()}),[])),inputProps:ne(Q,{...C,type:"radio",name:B,form:w,tabIndex:T,disabled:p,required:e.isRequired&&E==="native",checked:O,value:r,onChange:b,"aria-describedby":[t["aria-describedby"],e.isInvalid?A:null,M].filter(Boolean).join(" ")||void 0}),isDisabled:p,isSelected:O,isPressed:$||S}}u(L2,"$0d5c49892c1215da$export$37b0961d2f4751e2");function z2(t,e){let{name:n,form:r,isReadOnly:i,isRequired:l,isDisabled:a,orientation:o="vertical",validationBehavior:s="aria"}=t,{direction:c}=Re(),{isInvalid:d,validationErrors:f,validationDetails:h}=e.displayValidation,{labelProps:p,fieldProps:m,descriptionProps:g,errorMessageProps:O}=$t({...t,labelElementType:"span",isInvalid:e.isInvalid,errorMessage:t.errorMessage||f}),b=yt(t,{labelable:!0}),{focusWithinProps:y}=Wt({onBlurWithin(S){var x;(x=t.onBlur)===null||x===void 0||x.call(t,S),e.selectedValue||e.setLastFocusedValue(null)},onFocusWithin:t.onFocus,onFocusWithinChange:t.onFocusChange}),$=u(S=>{let x;switch(S.key){case"ArrowRight":c==="rtl"&&o!=="vertical"?x="prev":x="next";break;case"ArrowLeft":c==="rtl"&&o!=="vertical"?x="next":x="prev";break;case"ArrowDown":x="next";break;case"ArrowUp":x="prev";break;default:return}S.preventDefault();let C=ut(S.currentTarget,{from:S.target,accept:T=>T instanceof bt(T).HTMLInputElement&&T.type==="radio"}),Q;x==="next"?(Q=C.nextNode(),Q||(C.currentNode=S.currentTarget,Q=C.firstChild())):(Q=C.previousNode(),Q||(C.currentNode=S.currentTarget,Q=C.lastChild())),Q&&(Q.focus(),e.setSelectedValue(Q.value))},"onKeyDown"),v=Ie(n);return I2.set(e,{name:v,form:r,descriptionId:g.id,errorMessageId:O.id,validationBehavior:s}),{radioGroupProps:ne(b,{role:"radiogroup",onKeyDown:$,"aria-invalid":e.isInvalid||void 0,"aria-errormessage":t["aria-errormessage"],"aria-readonly":i||void 0,"aria-required":l||void 0,"aria-disabled":a||void 0,"aria-orientation":o,...m,...y}),labelProps:p,descriptionProps:g,errorMessageProps:O,isInvalid:d,validationErrors:f,validationDetails:h}}u(z2,"$430f30ed08ec25fa$export$62b9571f283ff5c2");const o0=new WeakMap;function KF(t,e,n){let{keyboardDelegate:r,isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s="aria"}=t,c=Sg({usage:"search",sensitivity:"base"}),d=(0,wp.element.useMemo)(()=>r||new hs(e.collection,e.disabledKeys,n,c),[r,e.collection,e.disabledKeys,c,n]),{menuTriggerProps:f,menuProps:h}=YD({isDisabled:i,type:"listbox"},e,n),p=u(T=>{if(e.selectionManager.selectionMode!=="multiple")switch(T.key){case"ArrowLeft":{var B,w;T.preventDefault();let E=e.selectedKey!=null?(B=d.getKeyAbove)===null||B===void 0?void 0:B.call(d,e.selectedKey):(w=d.getFirstKey)===null||w===void 0?void 0:w.call(d);E&&e.setSelectedKey(E);break}case"ArrowRight":{var M,A;T.preventDefault();let E=e.selectedKey!=null?(M=d.getKeyBelow)===null||M===void 0?void 0:M.call(d,e.selectedKey):(A=d.getFirstKey)===null||A===void 0?void 0:A.call(d);E&&e.setSelectedKey(E);break}}},"onKeyDown"),{typeSelectProps:m}=tD({keyboardDelegate:d,selectionManager:e.selectionManager,onTypeSelect(T){e.setSelectedKey(T)}}),{isInvalid:g,validationErrors:O,validationDetails:b}=e.displayValidation,{labelProps:y,fieldProps:$,descriptionProps:v,errorMessageProps:S}=$t({...t,labelElementType:"span",isInvalid:g,errorMessage:t.errorMessage||O});m.onKeyDown=m.onKeyDownCapture,delete m.onKeyDownCapture,e.selectionManager.selectionMode==="multiple"&&(m={});let x=yt(t,{labelable:!0}),C=ne(m,f,$),Q=Ie();return o0.set(e,{isDisabled:i,isRequired:l,name:a,form:o,validationBehavior:s}),{labelProps:{...y,onClick:()=>{if(!t.isDisabled){var T;(T=n.current)===null||T===void 0||T.focus(),Bm("keyboard")}}},triggerProps:ne(x,{...C,isDisabled:i,onKeyDown:vr(C.onKeyDown,p,t.onKeyDown),onKeyUp:t.onKeyUp,"aria-labelledby":[Q,C["aria-labelledby"],C["aria-label"]&&!C["aria-labelledby"]?C.id:null].filter(Boolean).join(" "),onFocus(T){e.isFocused||(t.onFocus&&t.onFocus(T),t.onFocusChange&&t.onFocusChange(!0),e.setFocused(!0))},onBlur(T){e.isOpen||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:Q},menuProps:{...h,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:T=>{T.currentTarget.contains(T.relatedTarget)||(t.onBlur&&t.onBlur(T),t.onFocusChange&&t.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[$["aria-labelledby"],C["aria-label"]&&!$["aria-labelledby"]?C.id:null].filter(Boolean).join(" ")},descriptionProps:v,errorMessageProps:S,isInvalid:g,validationErrors:O,validationDetails:b,hiddenSelectProps:{isDisabled:i,name:a,label:t.label,state:e,triggerRef:n,form:o}}}u(KF,"$58aed456727eb0f3$export$e64b2f635402ca43");function UF(t,e,n){let r=o0.get(e)||{},{autoComplete:i,name:l=r.name,form:a=r.form,isDisabled:o=r.isDisabled}=t,{validationBehavior:s,isRequired:c}=r,{visuallyHiddenProps:d}=Dd({style:{position:"fixed",top:0,left:0}});Sr(t.selectRef,e.defaultValue,e.setValue),as({validationBehavior:s,focus:()=>{var m;return(m=n.current)===null||m===void 0?void 0:m.focus()}},e,t.selectRef);let f=e.setValue,h=(0,wp.element.useCallback)(m=>{m.target.multiple?f(Array.from(m.target.selectedOptions,g=>g.value)):f(m.currentTarget.value)},[f]);var p;return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:i,disabled:o,multiple:e.selectionManager.selectionMode==="multiple",required:s==="native"&&c,name:l,form:a,value:(p=e.value)!==null&&p!==void 0?p:"",onChange:h,onInput:h}}}u(UF,"$bdd25dc72710631f$export$f809e80f58e251d1");function GF(t){let{state:e,triggerRef:n,label:r,name:i,form:l,isDisabled:a}=t,o=(0,wp.element.useRef)(null),s=(0,wp.element.useRef)(null),{containerProps:c,selectProps:d}=UF({...t,selectRef:e.collection.size<=300?o:s},e,n);if(e.collection.size<=300)return wp.element.createElement("div",{...c,"data-testid":"hidden-select-container"},wp.element.createElement("label",null,r,wp.element.createElement("select",{...d,ref:o},wp.element.createElement("option",null),[...e.collection.getKeys()].map(f=>{let h=e.collection.getItem(f);if(h&&h.type==="item")return wp.element.createElement("option",{key:h.key,value:h.key},h.textValue)}))));if(i){let f=o0.get(e)||{},{validationBehavior:h}=f,p=Array.isArray(e.value)?e.value:[e.value];p.length===0&&(p=[null]);let m=p.map((g,O)=>{let b={type:"hidden",autoComplete:d.autoComplete,name:i,form:l,disabled:a,value:g??""};return h==="native"?wp.element.createElement("input",{key:O,...b,ref:O===0?s:null,style:{display:"none"},type:"text",required:O===0?d.required:!1,onChange:()=>{}}):wp.element.createElement("input",{key:O,...b,ref:O===0?s:null})});return wp.element.createElement(wp.element.Fragment,null,m)}return null}u(GF,"$bdd25dc72710631f$export$cbd84cdb2e668835");function _F(t){let e=yt(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}u(_F,"$f4b273590fab9f93$export$52210f68a14655d0");function HF(t,e,n){let{labelProps:r,inputProps:i,isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}=Cx(t,e,n);return{labelProps:r,inputProps:{...i,role:"switch",checked:l},isSelected:l,isPressed:a,isDisabled:o,isReadOnly:s}}u(HF,"$b418ec0c85c52f27$export$d853f7095ae95f88");var JF=Object.defineProperty,Z2=u((t,e)=>JF(t,"name",{value:e,configurable:!0}),"l$k");const eI=Z2((t,e=!1)=>{if(e===!1)return`[[${t}]]`;let n="";for(const r in e){const i=e[r];n+=`::${r}=${typeof i=="object"?JSON.stringify(i):i}`}return`[[${t}${n}]]`},"dynamicValueToString"),X2=Z2(t=>{if(typeof t!="string")return!1;const e=t.replace("[[","").replace("]]","").split("::");return e.length===0?!1:e.reduce((n,r,i)=>{if(i===0)return n;const l=r.split("=");return{...n,fields:{...n.fields,[l[0]]:l[1]}}},{type:e[0],settings:{}})},"stringToDynamicValue");var tI=Object.defineProperty,s0=u((t,e)=>tI(t,"name",{value:e,configurable:!0}),"r$d");const nI=["color-picker","conditional-panel","date-picker","number","text"],j2=/\[\[((?:(?!\]\]).)+\]?)\]\]/g,q2=s0(t=>typeof t=="string"?Array.from(t.matchAll(j2),e=>e[1]):[],"getDynamicStrings"),u0={"color-picker":{mode:{default:"replace",supported:["replace"]},types:["color"]},"conditional-panel":{mode:{default:"replace",supported:["replace","insert"],types:["text","date","color","number"]},types:["color"]},"date-picker":{mode:{default:"replace",supported:["replace"]},types:["date"]},number:{mode:{default:"replace",supported:["replace"]},types:["number"]},text:{mode:{default:"insert",supported:["insert","replace"]},types:["text","date","color","number"]}},rI=s0((t,e)=>u0[t].mode.supported.includes(e)?e:u0[t].mode.default,"getMode"),iI=s0((t,e,{dynamic:n,type:r})=>{const i=Zn().dynamics;return nI.includes(r)?{getTypes:()=>n.types??u0[r].types,getMode:()=>rI(r,n.mode??!1),getCategories:()=>n.categories??Object.keys(i.categories),getList:()=>i.values,getAll:()=>q2(t).map(X2),getLabel:l=>i.values[l]?i.values[l].label:l,stringify:eI,parse:X2,hasValues:()=>q2(t).length!==0,setValue:l=>e(l)}:!1},"dynamicValuesAPI");var lI=Object.defineProperty,di=u((t,e)=>lI(t,"name",{value:e,configurable:!0}),"e$5");const fi=di(()=>(Date.now()*1e3+Math.random()*1e3).toString(16).replace(/\./g,"").padEnd(14,"0"),"uniqid"),On=di((t,e=!1)=>{if(Array.isArray(t)||typeof t=="object")return t;if(t===""&&e)return e;try{return JSON.parse(t)}catch{return{}}},"initJSON"),W2=di(t=>t instanceof Set?t:Array.isArray(t)?new Set(t):t.startsWith("[")&&t.endsWith("]")?On(t,new Set):new Set(t.split(",")),"initSet"),il=di(t=>Object.keys(t).map(e=>t[e].choices?{...t[e],key:t[e].name,label:t[e].name,choices:Object.keys(t[e].choices).map(n=>({value:n,label:t[e].choices[n]}))}:{value:e,label:t[e]}),"getOptions"),Y2=di((t,e)=>e.filter(n=>n.value===t)[0]??!1,"getOption"),aI=di((t,e)=>JSON.stringify(t)===JSON.stringify(e),"areSameObjects"),c0=di(t=>JSON.parse(JSON.stringify(t)),"deepCopy"),oI=di(()=>({dispatcher:K2,init:U2}),"getRepeaterHelpers");var sI=Object.freeze({__proto__:null,areSameObjects:aI,deepCopy:c0,getOption:Y2,getOptions:il,getRepeaterHelpers:oI,initJSON:On,initSet:W2,uniqid:fi}),uI=Object.defineProperty,d0=u((t,e)=>uI(t,"name",{value:e,configurable:!0}),"a$i");const K2=d0((t,e,n)=>(r,i)=>{switch(i.callback&&setTimeout(i.callback),i.type){case"add":return r.length>=e?r:[...r,{key:fi(),...i.data??t}];case"insert":return r.length>=e?r:[...r.slice(0,i.position),{key:fi(),...i.data??t},...r.slice(i.position)];case"remove":return[...r.slice(0,i.item),...r.slice(i.item+1)];case"update":return r[i.item][i.control]=i.value,[...r];case"clone":return r.length>=e?r:[...r,{...f0(i.item,n),key:fi()}];case"clear":return[];case"bulkCheck":return r.map(l=>({...l,_bulkCheckbox:!0}));case"bulkUncheck":return r.map(l=>({...l,_bulkCheckbox:!1}));case"bulkUpdate":return r.map(l=>l._bulkCheckbox===!0?{...l,[i.control]:i.value}:l);case"bulkRemove":return r.filter(l=>l._bulkCheckbox!==!0);default:return r}},"repeaterDispatcher"),f0=d0((t,e)=>{if(typeof e?.clone?.exclude!="object")return t;const n={...t};return Object.keys(e.clone.exclude).map(r=>{const i=e.clone.exclude[r];i===!0&&delete n[r],typeof i=="object"&&(n[r]=Array.isArray(n[r])?n[r].map(l=>f0(l,{clone:{exclude:i}})):f0(n[r],{clone:{exclude:i}}))}),n},"formatClone"),U2=d0((t,e)=>{try{const n=Array.isArray(t)?t:JSON.parse(t);return Array.isArray(n)?n:[e]}catch{return[{key:fi(),...e}]}},"initDispatcher"),se=wp.element.forwardRef(({children:t,...e},n)=>{const r=wp.element.useRef(),i=n??r,l=e.content??t,a=e.buttonType??"button",o=e.layout?e.layout?`tf-button-${e.layout}`:"":e.type?`tf-button-${e.type}`:"",{buttonProps:s}=SV(e,n),c=e.context?`tf-button-is-${e.context}`:"",d=`tf-button ${o} ${c} ${e.className??""}`,f=e.changeTag&&e.changeTag=="span"?"span":"button";return wp.element.createElement(f,{className:d,style:e.style,...s,onClick:h=>{s.onClick(h),Xi("buttonPressed",{name:e.name??!1,props:e,event:h})},ref:i,type:a},e.contentVisuallyHidden?wp.element.createElement(gn,null,l):l)});var cI=Object.defineProperty,dI=u((t,e)=>cI(t,"name",{value:e,configurable:!0}),"i$q");const we=dI(({descriptionProps:t,parent:e,children:n,...r})=>{const i=e?.descriptionVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("div",{className:"tf-description",...t},l))},"Description");var fI=Object.defineProperty,hI=u((t,e)=>fI(t,"name",{value:e,configurable:!0}),"t$d");const gs=hI(({title:t,children:e,...n})=>{const r=wp.element.useRef(),{dialogProps:i}=vF(n,r);return wp.element.createElement("div",{className:"tf-dialog",...i,ref:r},t&&wp.element.createElement(zd,{level:4},t),wp.element.createElement("div",{className:"tf-dialog-content"},e))},"Dialog");var pI=Object.defineProperty,G2=u((t,e)=>pI(t,"name",{value:e,configurable:!0}),"l$i");const _2=G2(t=>{const[e,n]=wp.element.useState(!0);wp.element.useEffect(()=>{t.isOpen!==e&&n(t.isOpen)},[t.isOpen]);const r=G2(()=>{n(!e),t.onChange&&t.onChange(!e)},"toggle");let i="tf-panel";return i+=` tf-panel-${e?"open":"closed"}`,i+=t.className?` ${t.className}`:"",i+=t.class?` ${t.class}`:"",i+=t.footer?"":" tf-panel-no-footer",wp.element.createElement("div",{className:i,"data-status":e?"open":"closed"},wp.element.createElement(se,{className:"tf-panel-header",type:"action",onClick:r},wp.element.createElement("div",{className:"tf-panel-header-left"},t.headerLeft?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerLeft):null,t.title?wp.element.createElement("div",{className:"tf-panel-header-title"},wp.element.isValidElement(t.title)?t.title:wp.element.createElement("strong",null,t.title)):null),wp.element.createElement("div",{className:"tf-panel-header-right"},t.headerRight?wp.element.createElement("div",{className:"tf-panel-header-before-title"},t.headerRight):null,wp.element.createElement("span",{className:"tf-panel-arrow"}))),e||t?.behavior==="hide"?wp.element.createElement("div",{className:"tf-panel-content"},t.children):null,t.footer?wp.element.createElement("div",{className:"tf-panel-footer"},t.footer):null)},"ExpandablePanel");var mI=Object.defineProperty,gI=u((t,e)=>mI(t,"name",{value:e,configurable:!0}),"t$c");const xe=gI(({labelProps:t,parent:e,children:n,...r})=>{const i=e?.labelVisuallyHidden?gn:wp.element.Fragment,l=r.content??n;return wp.element.createElement(i,null,wp.element.createElement("label",{className:"tf-label",...t,htmlFor:e?.name??""},l))},"Label");var OI=Object.defineProperty,bI=u((t,e)=>OI(t,"name",{value:e,configurable:!0}),"i$p");const h0=bI(({item:t,state:e})=>{const n=wp.element.useRef(),{optionProps:r,isSelected:i,isFocused:l,isDisabled:a}=oF({key:t.key},e,n),{focusProps:o}=rs();let s="tf-list-box-option";return i&&(s=s+=" tf-list-box-option-selected"),a&&(s=s+=" tf-list-box-option-disabled"),l&&(s=s+=" tf-list-box-option-focus"),wp.element.createElement("li",{...ne(r,o),ref:n,className:s},t.rendered)},"Option");var yI=Object.defineProperty,vI=u((t,e)=>yI(t,"name",{value:e,configurable:!0}),"a$f");const $I=vI(({section:t,state:e})=>{const{itemProps:n,headingProps:r,groupProps:i}=sF({heading:t.rendered,"aria-label":t["aria-label"]}),{separatorProps:l}=_F({elementType:"li"}),a=t.key===e.collection.getFirstKey();return wp.element.createElement(wp.element.Fragment,null,!a&&wp.element.createElement("li",{className:"tf-list-box-section-separator",...l}),wp.element.createElement("li",{className:"tf-list-box-section",...n},t.rendered&&wp.element.createElement("span",{...r},t.rendered),wp.element.createElement("ul",{...i},[...t.childNodes].map(o=>wp.element.createElement(h0,{key:o.key??o.name,item:o,state:e})))))},"Section");var wI=Object.defineProperty,xI=u((t,e)=>wI(t,"name",{value:e,configurable:!0}),"l$h");const Vd=xI(t=>{const e=wp.element.useRef(),{listBoxRef:n=e,state:r}=t,{listBoxProps:i}=lD(t,r,n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("ul",{...i,ref:n,className:"tf-list-box"},["loading","filtering"].includes(t?.loadingState)?wp.element.createElement(h0,{key:"_loading",state:r,item:{rendered:"Loading...",isDisabled:!0},shouldUseVirtualFocus:!0}):[...r.collection].map(l=>l.type==="section"?wp.element.createElement($I,{key:l.key??l.level,section:l,state:r,shouldUseVirtualFocus:!0}):wp.element.createElement(h0,{key:l.key??l.name,item:l,state:r,shouldUseVirtualFocus:!0}))),wp.element.createElement(ds,{onDismiss:r.close}))},"ListBox");var SI=Object.defineProperty,CI=u((t,e)=>SI(t,"name",{value:e,configurable:!0}),"a$d");const kI=CI(({state:t,children:e,...n})=>{const r=wp.element.useContext(Zl),i=wp.element.useRef(null),{modalProps:l,underlayProps:a}=YN(n,t,i);return wp.element.createElement(_k,{portalContainer:r.portalContainer},wp.element.createElement("div",{className:r.wrapper},wp.element.createElement("div",{className:"tf-modal",...a,style:{zIndex:1e6}},wp.element.createElement("div",{className:"tf-modal-container",ref:i,...l},e))))},"Modal");function Aa(t,e,n){return e!=null&&t.compare(e)<0||n!=null&&t.compare(n)>0}u(Aa,"$f62d864046160412$export$eac50920cf2fd59a");function p0(t,e,n,r,i){let l={};for(let o in e)l[o]=Math.floor(e[o]/2),l[o]>0&&e[o]%2===0&&l[o]--;let a=ll(t,e,n).subtract(l);return Os(t,a,e,n,r,i)}u(p0,"$f62d864046160412$export$f4a51ff076cc9a09");function ll(t,e,n,r,i){let l=t;return e.years?l=NR(t):e.months?l=_i(t):e.weeks&&(l=Yo(t,n)),Os(t,l,e,n,r,i)}u(ll,"$f62d864046160412$export$144a00ba6044eb9");function m0(t,e,n,r,i){let l={...e};l.days?l.days--:l.weeks?l.weeks--:l.months?l.months--:l.years&&l.years--;let a=ll(t,e,n).subtract(l);return Os(t,a,e,n,r,i)}u(m0,"$f62d864046160412$export$530edbfc915b2b04");function Os(t,e,n,r,i,l){if(i&&t.compare(i)>=0){let a=Xm(e,ll(vt(i),n,r));a&&(e=a)}if(l&&t.compare(l)<=0){let a=Zm(e,m0(vt(l),n,r));a&&(e=a)}return e}u(Os,"$f62d864046160412$export$5bb865b12696a77d");function hi(t,e,n){if(e){let r=Xm(t,vt(e));r&&(t=r)}if(n){let r=Zm(t,vt(n));r&&(t=r)}return t}u(hi,"$f62d864046160412$export$4f5203c0d889109e");function H2(t,e,n){if(!n)return t;for(;t.compare(e)>=0&&n(t);)t=t.subtract({days:1});return t.compare(e)>=0?t:null}u(H2,"$f62d864046160412$export$a1d3911297b952d7");function J2(t){let e=(0,wp.element.useMemo)(()=>new Rt(t.locale),[t.locale]),n=(0,wp.element.useMemo)(()=>e.resolvedOptions(),[e]),{locale:r,createCalendar:i,visibleDuration:l={months:1},minValue:a,maxValue:o,selectionAlignment:s,isDateUnavailable:c,pageBehavior:d="visible",firstDayOfWeek:f}=t,h=(0,wp.element.useMemo)(()=>i(n.calendar),[i,n.calendar]);var p;let[m,g]=je(t.value,(p=t.defaultValue)!==null&&p!==void 0?p:null,t.onChange),O=(0,wp.element.useMemo)(()=>m?Ne(vt(m),h):null,[m,h]),b=(0,wp.element.useMemo)(()=>m&&"timeZone"in m?m.timeZone:n.timeZone,[m,n.timeZone]),y=(0,wp.element.useMemo)(()=>t.focusedValue?hi(Ne(vt(t.focusedValue),h),a,o):void 0,[t.focusedValue,h,a,o]),$=(0,wp.element.useMemo)(()=>hi(t.defaultFocusedValue?Ne(vt(t.defaultFocusedValue),h):O||Ne(Cr(b),h),a,o),[t.defaultFocusedValue,O,b,h,a,o]),[v,S]=je(y,$,t.onFocusChange),[x,C]=(0,wp.element.useState)(()=>{switch(s){case"start":return ll(v,l,r,a,o);case"end":return m0(v,l,r,a,o);case"center":default:return p0(v,l,r,a,o)}}),[Q,T]=(0,wp.element.useState)(t.autoFocus||!1),B=(0,wp.element.useMemo)(()=>{let F={...l};return F.days?F.days--:F.days=-1,x.add(F)},[x,l]),[w,M]=(0,wp.element.useState)(h);if(!od(h,w)){let F=Ne(v,h);C(p0(F,l,r,a,o)),S(F),M(h)}Aa(v,a,o)?S(hi(v,a,o)):v.compare(x)<0?C(m0(v,l,r,a,o)):v.compare(B)>0&&C(ll(v,l,r,a,o));function A(F){F=hi(F,a,o),S(F)}u(A,"focusCell");function E(F){if(!t.isDisabled&&!t.isReadOnly){let N=F;if(N===null){g(null);return}if(N=hi(N,a,o),N=H2(N,x,c),!N)return;N=Ne(N,m?.calendar||new tt),m&&"hour"in m?g(m.set(N)):g(N)}}u(E,"setValue");let I=(0,wp.element.useMemo)(()=>O?c&&c(O)?!0:Aa(O,a,o):!1,[O,c,a,o]),D=t.isInvalid||t.validationState==="invalid"||I,P=D?"invalid":null,R=(0,wp.element.useMemo)(()=>d==="visible"?l:g0(l),[d,l]);var L,k;return{isDisabled:(L=t.isDisabled)!==null&&L!==void 0?L:!1,isReadOnly:(k=t.isReadOnly)!==null&&k!==void 0?k:!1,value:O,setValue:E,visibleRange:{start:x,end:B},minValue:a,maxValue:o,focusedDate:v,timeZone:b,validationState:P,isValueInvalid:D,setFocusedDate(F){A(F),T(!0)},focusNextDay(){A(v.add({days:1}))},focusPreviousDay(){A(v.subtract({days:1}))},focusNextRow(){l.days?this.focusNextPage():(l.weeks||l.months||l.years)&&A(v.add({weeks:1}))},focusPreviousRow(){l.days?this.focusPreviousPage():(l.weeks||l.months||l.years)&&A(v.subtract({weeks:1}))},focusNextPage(){let F=x.add(R);S(hi(v.add(R),a,o)),C(ll(Os(v,F,R,r,a,o),R,r))},focusPreviousPage(){let F=x.subtract(R);S(hi(v.subtract(R),a,o)),C(ll(Os(v,F,R,r,a,o),R,r))},focusSectionStart(){l.days?A(x):l.weeks?A(Yo(v,r)):(l.months||l.years)&&A(_i(v))},focusSectionEnd(){l.days?A(B):l.weeks?A(LR(v,r)):(l.months||l.years)&&A(Oa(v))},focusNextSection(F){if(!F&&!l.days){A(v.add(g0(l)));return}l.days?this.focusNextPage():l.weeks?A(v.add({months:1})):(l.months||l.years)&&A(v.add({years:1}))},focusPreviousSection(F){if(!F&&!l.days){A(v.subtract(g0(l)));return}l.days?this.focusPreviousPage():l.weeks?A(v.subtract({months:1})):(l.months||l.years)&&A(v.subtract({years:1}))},selectFocusedDate(){c&&c(v)||E(v)},selectDate(F){E(F)},isFocused:Q,setFocused:T,isInvalid(F){return Aa(F,a,o)},isSelected(F){return O!=null&&Ue(F,O)&&!this.isCellDisabled(F)&&!this.isCellUnavailable(F)},isCellFocused(F){return Q&&v&&Ue(F,v)},isCellDisabled(F){return t.isDisabled||F.compare(x)<0||F.compare(B)>0||this.isInvalid(F)},isCellUnavailable(F){return t.isDateUnavailable?t.isDateUnavailable(F):!1},isPreviousVisibleRangeInvalid(){let F=x.subtract({days:1});return Ue(F,x)||this.isInvalid(F)},isNextVisibleRangeInvalid(){let F=B.add({days:1});return Ue(F,B)||this.isInvalid(F)},getDatesInWeek(F,N=x){let z=N.add({weeks:F}),G=[];z=Yo(z,r,f);let le=Im(z,r,f);for(let ie=0;ie0&&(m="start")}let g=(0,wp.element.useRef)(null),[O,b]=(0,wp.element.useState)(null),y=(0,wp.element.useMemo)(()=>Xm(o,O?.start),[o,O]),$=(0,wp.element.useMemo)(()=>Zm(s,O?.end),[s,O]),v=J2({...c,value:d&&d.start,createCalendar:i,locale:l,visibleDuration:a,minValue:y,maxValue:$,selectionAlignment:t.selectionAlignment||m}),S=u(P=>{if(P&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const R=tP(P,v,-1),L=tP(P,v,1);g.current={start:R,end:L},b(g.current)}else g.current=null,b(null)},"updateAvailableRange"),[x,C]=(0,wp.element.useState)(v.visibleRange);(!Fm(v.visibleRange.start,x.start)||!Fm(v.visibleRange.end,x.end))&&(S(h),C(v.visibleRange));let Q=u(P=>{P?(p(P),S(P)):(p(null),S(null))},"setAnchorDate"),T=h?O0(h,v.focusedDate):d&&O0(d.start,d.end),B=u(P=>{if(t.isReadOnly)return;const R=hi(P,y,$),L=H2(R,v.visibleRange.start,t.isDateUnavailable);if(L)if(!h)Q(L);else{let k=O0(h,L);k&&f({start:eP(k.start,d?.start),end:eP(k.end,d?.end)}),Q(null)}},"selectDate"),[w,M]=(0,wp.element.useState)(!1),{isDateUnavailable:A}=t,E=(0,wp.element.useMemo)(()=>!d||h?!1:A&&(A(d.start)||A(d.end))?!0:Aa(d.start,o,s)||Aa(d.end,o,s),[A,d,h,o,s]),I=t.isInvalid||t.validationState==="invalid"||E;return{...v,value:d,setValue:f,anchorDate:h,setAnchorDate:Q,highlightedRange:T,validationState:I?"invalid":null,isValueInvalid:I,selectFocusedDate(){B(v.focusedDate)},selectDate:B,highlightDate(P){h&&v.setFocusedDate(P)},isSelected(P){return!!(T&&P.compare(T.start)>=0&&P.compare(T.end)<=0&&!v.isCellDisabled(P)&&!v.isCellUnavailable(P))},isInvalid(P){var R,L;return v.isInvalid(P)||Aa(P,(R=g.current)===null||R===void 0?void 0:R.start,(L=g.current)===null||L===void 0?void 0:L.end)},isDragging:w,setDragging:M}}u(DI,"$9a36b6ba2fb1a7c5$export$9a987164d97ecc90");function O0(t,e){return!t||!e?null:(e.compare(t)<0&&([t,e]=[e,t]),{start:vt(t),end:vt(e)})}u(O0,"$9a36b6ba2fb1a7c5$var$makeRange");function eP(t,e){return t=Ne(t,e?.calendar||new tt),e&&"hour"in e?e.set(t):t}u(eP,"$9a36b6ba2fb1a7c5$var$convertValue");function tP(t,e,n){let r=t.add({days:n});for(;(n<0?r.compare(e.visibleRange.start)>=0:r.compare(e.visibleRange.end)<=0)&&!e.isCellUnavailable(r);)r=r.add({days:n});if(e.isCellUnavailable(r))return r.add({days:-n})}u(tP,"$9a36b6ba2fb1a7c5$var$nextUnavailableDate");const Sv=class Sv{*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(e){let n=this.keyMap.get(e);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return n?.childNodes||[]}constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=u(o=>{if(this.keyMap.set(o.key,o),o.childNodes&&o.type==="section")for(let s of o.childNodes)n(s)},"visit");for(let o of e)n(o);let r=null,i=0,l=0;for(let[o,s]of this.keyMap)r?(r.nextKey=o,s.prevKey=r.key):(this.firstKey=o,s.prevKey=void 0),s.type==="item"&&(s.index=i++),(s.type==="section"||s.type==="item")&&l++,r=s,r.nextKey=void 0;this._size=l;var a;this.lastKey=(a=r?.key)!==null&&a!==void 0?a:null}};u(Sv,"$a02d57049d202695$export$d085fb9e920b5ca7");let bs=Sv;const Op=class Op extends Set{constructor(e,n,r){super(e),e instanceof Op?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};u(Op,"$e40ea825a81a3709$export$52baac22726c72bf");let En=Op;function PI(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}u(PI,"$7af3f5b51489e0b5$var$equalSets");function EI(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:l="all"}=t,a=(0,wp.element.useRef)(!1),[,o]=(0,wp.element.useState)(!1),s=(0,wp.element.useRef)(null),c=(0,wp.element.useRef)(null),[,d]=(0,wp.element.useState)(null),f=(0,wp.element.useMemo)(()=>nP(t.selectedKeys),[t.selectedKeys]),h=(0,wp.element.useMemo)(()=>nP(t.defaultSelectedKeys,new En),[t.defaultSelectedKeys]),[p,m]=je(f,h,t.onSelectionChange),g=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[O,b]=(0,wp.element.useState)(i);i==="replace"&&O==="toggle"&&typeof p=="object"&&p.size===0&&b("replace");let y=(0,wp.element.useRef)(i);return(0,wp.element.useEffect)(()=>{i!==y.current&&(b(i),y.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:O,setSelectionBehavior:b,get isFocused(){return a.current},setFocused($){a.current=$,o($)},get focusedKey(){return s.current},get childFocusStrategy(){return c.current},setFocusedKey($,v="first"){s.current=$,c.current=v,d($)},selectedKeys:p,setSelectedKeys($){(r||!PI($,p))&&m($)},disabledKeys:g,disabledBehavior:l}}u(EI,"$7af3f5b51489e0b5$export$253fe78d46329472");function nP(t,e){return t?t==="all"?"all":new En(t):e}u(nP,"$7af3f5b51489e0b5$var$convertSelection");const bp=class bp{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&n0(this.collection,i,e)<0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&n0(this.collection,i,e)>0)&&(e=i)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new En([n],n,n);else{let a=this.state.selectedKeys;var i;let o=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new En(a,o,n);var l;for(let s of this.getKeyRange(o,(l=a.currentKey)!==null&&l!==void 0?l:n))r.delete(s);for(let s of this.getKeyRange(n,o))this.canSelectItem(s)&&r.add(s)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),i=this.collection.getItem(n);return r&&i?n0(this.collection,r,i)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let i=[],l=e;for(;l!=null;){let a=this.collection.getItem(l);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(l),l===n)return i;l=this.collection.getKeyAfter(l)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new En(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new En([n],n,n):new En;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new En;for(let r of e){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=[],n=u(r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);a?.type==="item"&&e.push(r);var l;a?.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((l=(i=lF(Bd(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&l!==void 0?l:null)}r=this.collection.getKeyAfter(r)}},"addKeys");return n(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new En)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=this.collection.getItem(e);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(e){var n,r;return!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))===null||n===void 0?void 0:n.props}withCollection(e){return new bp(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,n,r){this.collection=e,this.state=n;var i;this.allowsCellSelection=(i=r?.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null}};u(bp,"$d496c0a20b6e58ec$export$6c8a5aaad13c9852");let b0=bp;function y0(t){let{filter:e,layoutDelegate:n}=t,r=EI(t),i=(0,wp.element.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=(0,wp.element.useCallback)(c=>e?new bs(e(c)):new bs(c),[e]),a=(0,wp.element.useMemo)(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),o=iF(t,l,a),s=(0,wp.element.useMemo)(()=>new b0(o,r,{layoutDelegate:n}),[o,r,n]);return TI(o,s),{collection:o,disabledKeys:i,selectionManager:s}}u(y0,"$e72dd72e1c76a225$export$2f645645f7bca764");function TI(t,e){const n=(0,wp.element.useRef)(null);(0,wp.element.useEffect)(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){const d=n.current.getItem(e.focusedKey),f=[...n.current.getKeys()].map(b=>{const y=n.current.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null),h=[...t.getKeys()].map(b=>{const y=t.getItem(b);return y?.type==="item"?y:null}).filter(b=>b!==null);var r,i;const p=((r=f?.length)!==null&&r!==void 0?r:0)-((i=h?.length)!==null&&i!==void 0?i:0);var l,a,o;let m=Math.min(p>1?Math.max(((l=d?.index)!==null&&l!==void 0?l:0)-p+1,0):(a=d?.index)!==null&&a!==void 0?a:0,((o=h?.length)!==null&&o!==void 0?o:0)-1),g=null,O=!1;for(;m>=0;){if(!e.isDisabled(h[m].key)){g=h[m];break}if(m((s=d?.index)!==null&&s!==void 0?s:0)&&(m=(c=d?.index)!==null&&c!==void 0?c:0),m--}}e.setFocusedKey(g?g.key:null)}n.current=t},[t,e])}u(TI,"$e72dd72e1c76a225$var$useFocusedKeyReset");function AI(t){var e;let[n,r]=je(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),i=(0,wp.element.useMemo)(()=>n!=null?[n]:[],[n]),{collection:l,disabledKeys:a,selectionManager:o}=y0({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:c=>{if(c==="all")return;var d;let f=(d=c.values().next().value)!==null&&d!==void 0?d:null;f===n&&t.onSelectionChange&&t.onSelectionChange(f),r(f)}}),s=n!=null?l.getItem(n):null;return{collection:l,disabledKeys:a,selectionManager:o,selectedKey:n,setSelectedKey:r,selectedItem:s}}u(AI,"$a0d645289fe9b86b$export$e7f05e985daf4b5f");function pi(t){let[e,n]=je(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=(0,wp.element.useCallback)(()=>{n(!0)},[n]),i=(0,wp.element.useCallback)(()=>{n(!1)},[n]),l=(0,wp.element.useCallback)(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:i,toggle:l}}u(pi,"$fc909762b330b746$export$61c6a8c84e605fb6");function rP(t){var e;let{defaultFilter:n,menuTrigger:r="input",allowsEmptyCollection:i=!1,allowsCustomValue:l,shouldCloseOnBlur:a=!0}=t,[o,s]=(0,wp.element.useState)(!1),[c,d]=(0,wp.element.useState)(!1),[f,h]=(0,wp.element.useState)(null),p=u(oe=>{t.onSelectionChange&&t.onSelectionChange(oe),oe===b&&(z(),k())},"onSelectionChange");var m;let{collection:g,selectionManager:O,selectedKey:b,setSelectedKey:y,selectedItem:$,disabledKeys:v}=AI({...t,onSelectionChange:p,items:(m=t.items)!==null&&m!==void 0?m:t.defaultItems}),[S,x]=je(t.inputValue,lP(t.defaultInputValue,b,g)||"",t.onInputChange),[C]=(0,wp.element.useState)(b),[Q]=(0,wp.element.useState)(S),T=g,B=(0,wp.element.useMemo)(()=>t.items!=null||!n?g:QI(g,S,n),[g,S,n,t.items]),[w,M]=(0,wp.element.useState)(B),A=(0,wp.element.useRef)("focus"),I=pi({...t,onOpenChange:u(oe=>{t.onOpenChange&&t.onOpenChange(oe,oe?A.current:void 0),O.setFocused(oe),oe||O.setFocusedKey(null)},"onOpenChange"),isOpen:void 0,defaultOpen:void 0}),D=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";(i||B.size>0||$e&&T.size>0||t.items)&&($e&&!I.isOpen&&t.items===void 0&&s(!0),A.current=ge,h(oe),I.open())},"open"),P=u((oe=null,ge)=>{let $e=ge==="manual"||ge==="focus"&&r==="focus";!(i||B.size>0||$e&&T.size>0||t.items)&&!I.isOpen||($e&&!I.isOpen&&t.items===void 0&&s(!0),I.isOpen||(A.current=ge),L(oe))},"toggle"),R=(0,wp.element.useCallback)(()=>{M(o?T:B)},[o,T,B]),L=(0,wp.element.useCallback)((oe=null)=>{I.isOpen&&R(),h(oe),I.toggle()},[I,R]),k=(0,wp.element.useCallback)(()=>{I.isOpen&&(R(),I.close())},[I,R]),[F,N]=(0,wp.element.useState)(S),z=u(()=>{var oe,ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";N($e),x($e)},"resetInputValue");var G,le;let ie=(0,wp.element.useRef)((le=(G=t.selectedKey)!==null&&G!==void 0?G:t.defaultSelectedKey)!==null&&le!==void 0?le:null);var me;let ve=(0,wp.element.useRef)(b!=null&&(me=(e=g.getItem(b))===null||e===void 0?void 0:e.textValue)!==null&&me!==void 0?me:"");(0,wp.element.useEffect)(()=>{var oe;c&&(B.size>0||i)&&!I.isOpen&&S!==F&&r!=="manual"&&D(null,"input"),!o&&!i&&I.isOpen&&B.size===0&&k(),b!=null&&b!==ie.current&&k(),S!==F&&(O.setFocusedKey(null),s(!1),S===""&&(t.inputValue===void 0||t.selectedKey===void 0)&&y(null)),b!==ie.current&&(t.inputValue===void 0||t.selectedKey===void 0)?z():F!==S&&N(S);var ge;let $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";!c&&b!=null&&t.inputValue===void 0&&b===ie.current&&ve.current!==$e&&(N($e),x($e)),ie.current=b,ve.current=$e});let ce=Yn({...t,value:(0,wp.element.useMemo)(()=>({inputValue:S,selectedKey:b}),[S,b])}),K=u(()=>{l&&b==null?W():Z()},"revert"),W=u(()=>{ie.current=null,y(null),k()},"commitCustomValue"),Z=u(()=>{if(t.selectedKey!==void 0&&t.inputValue!==void 0){var oe,ge;(oe=t.onSelectionChange)===null||oe===void 0||oe.call(t,b);var $e;let Zi=b!=null&&($e=(ge=g.getItem(b))===null||ge===void 0?void 0:ge.textValue)!==null&&$e!==void 0?$e:"";N(Zi),k()}else z(),k()},"commitSelection");const ee=u(()=>{if(l){var oe,ge;const $e=b!=null&&(ge=(oe=g.getItem(b))===null||oe===void 0?void 0:oe.textValue)!==null&&ge!==void 0?ge:"";S===$e?Z():W()}else Z()},"commitValue");let De=u(()=>{I.isOpen&&O.focusedKey!=null?b===O.focusedKey?Z():y(O.focusedKey):ee()},"commit"),qt=(0,wp.element.useRef)(S),ni=u(oe=>{oe?(qt.current=S,r==="focus"&&!t.isReadOnly&&D(null,"focus")):(a&&ee(),S!==qt.current&&ce.commitValidation()),d(oe)},"setFocused"),yr=(0,wp.element.useMemo)(()=>I.isOpen?o?T:B:w,[I.isOpen,T,B,o,w]);var oa;let q=(oa=t.defaultSelectedKey)!==null&&oa!==void 0?oa:C;var fe;return{...ce,...I,focusStrategy:f,toggle:P,open:D,close:ee,selectionManager:O,selectedKey:b,defaultSelectedKey:q,setSelectedKey:y,disabledKeys:v,isFocused:c,setFocused:ni,selectedItem:$,collection:yr,inputValue:S,defaultInputValue:(fe=lP(t.defaultInputValue,q,g))!==null&&fe!==void 0?fe:Q,setInputValue:x,commit:De,revert:K}}u(rP,"$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e");function QI(t,e,n){return new bs(iP(t,t,e,n))}u(QI,"$a9e7382a7d111cb5$var$filterCollection");function iP(t,e,n,r){let i=[];for(let l of e)if(l.type==="section"&&l.hasChildNodes){let a=iP(t,Bd(l,t),n,r);[...a].some(o=>o.type==="item")&&i.push({...l,childNodes:a})}else l.type==="item"&&r(l.textValue,n)?i.push({...l}):l.type!=="item"&&i.push({...l});return i}u(iP,"$a9e7382a7d111cb5$var$filterNodes");function lP(t,e,n){if(t==null){var r,i;if(e!=null)return(i=(r=n.getItem(e))===null||r===void 0?void 0:r.textValue)!==null&&i!==void 0?i:""}return t}u(lP,"$a9e7382a7d111cb5$var$getDefaultInputValue");var aP={};aP={rangeOverflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.maxValue} \u0623\u0648 \u0642\u0628\u0644 \u0630\u0644\u0643.`,rangeReversed:"\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0628\u062F\u0621 \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0642\u0628\u0644 \u062A\u0627\u0631\u064A\u062E \u0627\u0644\u0627\u0646\u062A\u0647\u0627\u0621.",rangeUnderflow:t=>`\u064A\u062C\u0628 \u0623\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u0642\u064A\u0645\u0629 ${t.minValue} \u0623\u0648 \u0628\u0639\u062F \u0630\u0644\u0643.`,unavailableDate:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0645\u062D\u062F\u062F\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629."};var oP={};oP={rangeOverflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.maxValue} \u0438\u043B\u0438 \u043F\u043E-\u0440\u0430\u043D\u043D\u0430.`,rangeReversed:"\u041D\u0430\u0447\u0430\u043B\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 \u043F\u0440\u0435\u0434\u0438 \u043A\u0440\u0430\u0439\u043D\u0430\u0442\u0430.",rangeUnderflow:t=>`\u0421\u0442\u043E\u0439\u043D\u043E\u0441\u0442\u0442\u0430 \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0435 ${t.minValue} \u0438\u043B\u0438 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.`,unavailableDate:"\u0418\u0437\u0431\u0440\u0430\u043D\u0430\u0442\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435 \u0435 \u043D\u0430\u043B\u0438\u0447\u043D\u0430."};var sP={};sP={rangeOverflow:t=>`Hodnota mus\xED b\xFDt ${t.maxValue} nebo d\u0159\xEDv\u011Bj\u0161\xED.`,rangeReversed:"Datum zah\xE1jen\xED mus\xED p\u0159edch\xE1zet datu ukon\u010Den\xED.",rangeUnderflow:t=>`Hodnota mus\xED b\xFDt ${t.minValue} nebo pozd\u011Bj\u0161\xED.`,unavailableDate:"Vybran\xE9 datum nen\xED k dispozici."};var uP={};uP={rangeOverflow:t=>`V\xE6rdien skal v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xE6re f\xF8r slutdatoen.",rangeUnderflow:t=>`V\xE6rdien skal v\xE6re ${t.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xE6ngelig."};var cP={};cP={rangeOverflow:t=>`Der Wert muss ${t.maxValue} oder fr\xFCher sein.`,rangeReversed:"Das Startdatum muss vor dem Enddatum liegen.",rangeUnderflow:t=>`Der Wert muss ${t.minValue} oder sp\xE4ter sein.`,unavailableDate:"Das ausgew\xE4hlte Datum ist nicht verf\xFCgbar."};var dP={};dP={rangeOverflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.maxValue} \u03AE \u03C0\u03B1\u03BB\u03B1\u03B9\u03CC\u03C4\u03B5\u03C1\u03B7.`,rangeReversed:"\u0397 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03AD\u03BD\u03B1\u03C1\u03BE\u03B7\u03C2 \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BB\u03AE\u03BE\u03B7\u03C2.",rangeUnderflow:t=>`\u0397 \u03C4\u03B9\u03BC\u03AE \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${t.minValue} \u03AE \u03BC\u03B5\u03C4\u03B1\u03B3\u03B5\u03BD\u03AD\u03C3\u03C4\u03B5\u03C1\u03B7.`,unavailableDate:"\u0397 \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03B7 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03B7."};var fP={};fP={rangeUnderflow:t=>`Value must be ${t.minValue} or later.`,rangeOverflow:t=>`Value must be ${t.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."};var hP={};hP={rangeOverflow:t=>`El valor debe ser ${t.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xF3n.",rangeUnderflow:t=>`El valor debe ser ${t.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."};var pP={};pP={rangeOverflow:t=>`V\xE4\xE4rtus peab olema ${t.maxValue} v\xF5i varasem.`,rangeReversed:"Alguskuup\xE4ev peab olema enne l\xF5ppkuup\xE4eva.",rangeUnderflow:t=>`V\xE4\xE4rtus peab olema ${t.minValue} v\xF5i hilisem.`,unavailableDate:"Valitud kuup\xE4ev pole saadaval."};var mP={};mP={rangeOverflow:t=>`Arvon on oltava ${t.maxValue} tai sit\xE4 aikaisempi.`,rangeReversed:"Aloitusp\xE4iv\xE4n on oltava ennen lopetusp\xE4iv\xE4\xE4.",rangeUnderflow:t=>`Arvon on oltava ${t.minValue} tai sit\xE4 my\xF6h\xE4isempi.`,unavailableDate:"Valittu p\xE4iv\xE4m\xE4\xE4r\xE4 ei ole k\xE4ytett\xE4viss\xE4."};var gP={};gP={rangeOverflow:t=>`La valeur doit \xEAtre ${t.maxValue} ou ant\xE9rieure.`,rangeReversed:"La date de d\xE9but doit \xEAtre ant\xE9rieure \xE0 la date de fin.",rangeUnderflow:t=>`La valeur doit \xEAtre ${t.minValue} ou ult\xE9rieure.`,unavailableDate:"La date s\xE9lectionn\xE9e n\u2019est pas disponible."};var OP={};OP={rangeOverflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.maxValue} \u05D0\u05D5 \u05DE\u05D5\u05E7\u05D3\u05DD \u05D9\u05D5\u05EA\u05E8.`,rangeReversed:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05D4\u05EA\u05D7\u05DC\u05D4 \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05E0\u05D9 \u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E1\u05D9\u05D5\u05DD.",rangeUnderflow:t=>`\u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${t.minValue} \u05D0\u05D5 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.`,unavailableDate:"\u05D4\u05EA\u05D0\u05E8\u05D9\u05DA \u05D4\u05E0\u05D1\u05D7\u05E8 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF."};var bP={};bP={rangeOverflow:t=>`Vrijednost mora biti ${t.maxValue} ili ranije.`,rangeReversed:"Datum po\u010Detka mora biti prije datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrijednost mora biti ${t.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."};var yP={};yP={rangeOverflow:t=>`Az \xE9rt\xE9knek ${t.maxValue} vagy kor\xE1bbinak kell lennie.`,rangeReversed:"A kezd\u0151 d\xE1tumnak a befejez\u0151 d\xE1tumn\xE1l kor\xE1bbinak kell lennie.",rangeUnderflow:t=>`Az \xE9rt\xE9knek ${t.minValue} vagy k\xE9s\u0151bbinek kell lennie.`,unavailableDate:"A kiv\xE1lasztott d\xE1tum nem \xE9rhet\u0151 el."};var vP={};vP={rangeOverflow:t=>`Il valore deve essere ${t.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:t=>`Il valore deve essere ${t.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."};var $P={};$P={rangeOverflow:t=>`\u5024\u306F ${t.maxValue} \u4EE5\u4E0B\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u306F\u7D42\u4E86\u65E5\u3088\u308A\u524D\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",rangeUnderflow:t=>`\u5024\u306F ${t.minValue} \u4EE5\u4E0A\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`,unavailableDate:"\u9078\u629E\u3057\u305F\u65E5\u4ED8\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002"};var wP={};wP={rangeOverflow:t=>`\uAC12\uC740 ${t.maxValue} \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,rangeReversed:"\uC2DC\uC791\uC77C\uC740 \uC885\uB8CC\uC77C \uC774\uC804\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.",rangeUnderflow:t=>`\uAC12\uC740 ${t.minValue} \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`,unavailableDate:"\uC120\uD0DD\uD55C \uB0A0\uC9DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."};var xP={};xP={rangeOverflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.maxValue} arba ankstesn\u0117.`,rangeReversed:"Prad\u017Eios data turi b\u016Bti ankstesn\u0117 nei pabaigos data.",rangeUnderflow:t=>`Reik\u0161m\u0117 turi b\u016Bti ${t.minValue} arba naujesn\u0117.`,unavailableDate:"Pasirinkta data nepasiekiama."};var SP={};SP={rangeOverflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.maxValue} vai agr\u0101kai.`,rangeReversed:"S\u0101kuma datumam ir j\u0101b\u016Bt pirms beigu datuma.",rangeUnderflow:t=>`V\u0113rt\u012Bbai ir j\u0101b\u016Bt ${t.minValue} vai v\u0113l\u0101kai.`,unavailableDate:"Atlas\u012Btais datums nav pieejams."};var CP={};CP={rangeOverflow:t=>`Verdien m\xE5 v\xE6re ${t.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xE5 v\xE6re f\xF8r sluttdatoen.",rangeUnderflow:t=>`Verdien m\xE5 v\xE6re ${t.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."};var kP={};kP={rangeOverflow:t=>`Waarde moet ${t.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:t=>`Waarde moet ${t.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."};var DP={};DP={rangeOverflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.maxValue} lub wcze\u015Bniejsz\u0105.`,rangeReversed:"Data rozpocz\u0119cia musi by\u0107 wcze\u015Bniejsza ni\u017C data zako\u0144czenia.",rangeUnderflow:t=>`Warto\u015B\u0107 musi mie\u0107 warto\u015B\u0107 ${t.minValue} lub p\xF3\u017Aniejsz\u0105.`,unavailableDate:"Wybrana data jest niedost\u0119pna."};var PP={};PP={rangeOverflow:t=>`O valor deve ser ${t.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xE0 data final.",rangeUnderflow:t=>`O valor deve ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var EP={};EP={rangeOverflow:t=>`O valor tem de ser ${t.maxValue} ou anterior.`,rangeReversed:"A data de in\xEDcio deve ser anterior \xE0 data de fim.",rangeUnderflow:t=>`O valor tem de ser ${t.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xEDvel."};var TP={};TP={rangeOverflow:t=>`Valoarea trebuie s\u0103 fie ${t.maxValue} sau anterioar\u0103.`,rangeReversed:"Data de \xEEnceput trebuie s\u0103 fie anterioar\u0103 datei de sf\xE2r\u0219it.",rangeUnderflow:t=>`Valoarea trebuie s\u0103 fie ${t.minValue} sau ulterioar\u0103.`,unavailableDate:"Data selectat\u0103 nu este disponibil\u0103."};var AP={};AP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u043F\u043E\u0437\u0436\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0434\u0430\u0442\u0435 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043D\u0435 \u0440\u0430\u043D\u044C\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u0430\u044F \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var QP={};QP={rangeOverflow:t=>`Hodnota mus\xED by\u0165 ${t.maxValue} alebo skor\u0161ia.`,rangeReversed:"D\xE1tum za\u010Diatku mus\xED by\u0165 skor\u0161\xED ako d\xE1tum konca.",rangeUnderflow:t=>`Hodnota mus\xED by\u0165 ${t.minValue} alebo neskor\u0161ia.`,unavailableDate:"Vybrat\xFD d\xE1tum je nedostupn\xFD."};var MP={};MP={rangeOverflow:t=>`Vrednost mora biti ${t.maxValue} ali starej\u0161a.`,rangeReversed:"Za\u010Detni datum mora biti pred kon\u010Dnim datumom.",rangeUnderflow:t=>`Vrednost mora biti ${t.minValue} ali novej\u0161a.`,unavailableDate:"Izbrani datum ni na voljo."};var BP={};BP={rangeOverflow:t=>`Vrednost mora da bude ${t.maxValue} ili starija.`,rangeReversed:"Datum po\u010Detka mora biti pre datuma zavr\u0161etka.",rangeUnderflow:t=>`Vrednost mora da bude ${t.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."};var RP={};RP={rangeOverflow:t=>`V\xE4rdet m\xE5ste vara ${t.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xE5ste vara f\xF6re slutdatumet.",rangeUnderflow:t=>`V\xE4rdet m\xE5ste vara ${t.minValue} eller senare.`,unavailableDate:"Det valda datumet \xE4r inte tillg\xE4ngligt."};var VP={};VP={rangeOverflow:t=>`De\u011Fer, ${t.maxValue} veya \xF6ncesi olmal\u0131d\u0131r.`,rangeReversed:"Ba\u015Flang\u0131\xE7 tarihi biti\u015F tarihinden \xF6nce olmal\u0131d\u0131r.",rangeUnderflow:t=>`De\u011Fer, ${t.minValue} veya sonras\u0131 olmal\u0131d\u0131r.`,unavailableDate:"Se\xE7ilen tarih kullan\u0131lam\u0131yor."};var NP={};NP={rangeOverflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u043F\u0456\u0437\u043D\u0456\u0448\u0435 ${t.maxValue}.`,rangeReversed:"\u0414\u0430\u0442\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443 \u043C\u0430\u0454 \u043F\u0435\u0440\u0435\u0434\u0443\u0432\u0430\u0442\u0438 \u0434\u0430\u0442\u0456 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F.",rangeUnderflow:t=>`\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0435 \u0440\u0430\u043D\u0456\u0448\u0435 ${t.minValue}.`,unavailableDate:"\u0412\u0438\u0431\u0440\u0430\u043D\u0430 \u0434\u0430\u0442\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430."};var FP={};FP={rangeOverflow:t=>`\u503C\u5FC5\u987B\u662F ${t.maxValue} \u6216\u66F4\u65E9\u65E5\u671F\u3002`,rangeReversed:"\u5F00\u59CB\u65E5\u671F\u5FC5\u987B\u65E9\u4E8E\u7ED3\u675F\u65E5\u671F\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u987B\u662F ${t.minValue} \u6216\u66F4\u665A\u65E5\u671F\u3002`,unavailableDate:"\u6240\u9009\u65E5\u671F\u4E0D\u53EF\u7528\u3002"};var IP={};IP={rangeOverflow:t=>`\u503C\u5FC5\u9808\u662F ${t.maxValue} \u6216\u66F4\u65E9\u3002`,rangeReversed:"\u958B\u59CB\u65E5\u671F\u5FC5\u9808\u5728\u7D50\u675F\u65E5\u671F\u4E4B\u524D\u3002",rangeUnderflow:t=>`\u503C\u5FC5\u9808\u662F ${t.minValue} \u6216\u66F4\u665A\u3002`,unavailableDate:"\u6240\u9078\u65E5\u671F\u7121\u6CD5\u4F7F\u7528\u3002"};var LP={};LP={"ar-AE":aP,"bg-BG":oP,"cs-CZ":sP,"da-DK":uP,"de-DE":cP,"el-GR":dP,"en-US":fP,"es-ES":hP,"et-EE":pP,"fi-FI":mP,"fr-FR":gP,"he-IL":OP,"hr-HR":bP,"hu-HU":yP,"it-IT":vP,"ja-JP":$P,"ko-KR":wP,"lt-LT":xP,"lv-LV":SP,"nb-NO":CP,"nl-NL":kP,"pl-PL":DP,"pt-BR":PP,"pt-PT":EP,"ro-RO":TP,"ru-RU":AP,"sk-SK":QP,"sl-SI":MP,"sr-SP":BP,"sv-SE":RP,"tr-TR":VP,"uk-UA":NP,"zh-CN":FP,"zh-TW":IP};function MI(t){return t&&t.__esModule?t.default:t}u(MI,"$parcel$interopDefault");const zP=new dn(MI(LP));function ZP(){let t=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return t}u(ZP,"$35a22f14a1f04b11$var$getLocale");function Nd(t,e,n,r,i){let l=t!=null&&n!=null&&t.compare(n)>0,a=t!=null&&e!=null&&t.compare(e)<0,o=t!=null&&r?.(t)||!1,s=l||a||o,c=[];if(s){let d=ZP(),f=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||zP,h=new qo(d,f),p=new Rt(d,Br({},i)),m=p.resolvedOptions().timeZone;a&&e!=null&&c.push(h.format("rangeUnderflow",{minValue:p.format(e.toDate(m))})),l&&n!=null&&c.push(h.format("rangeOverflow",{maxValue:p.format(n.toDate(m))})),o&&c.push(h.format("unavailableDate"))}return{isInvalid:s,validationErrors:c,validationDetails:{badInput:o,customError:!1,patternMismatch:!1,rangeOverflow:l,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!s}}}u(Nd,"$35a22f14a1f04b11$export$f18627323ab57ac0");function BI(t,e,n,r,i){var l;let a=Nd((l=t?.start)!==null&&l!==void 0?l:null,e,n,r,i);var o;let s=Nd((o=t?.end)!==null&&o!==void 0?o:null,e,n,r,i),c=Sd(a,s);if(t?.end!=null&&t.start!=null&&t.end.compare(t.start)<0){let d=dn.getGlobalDictionaryForPackage("@react-stately/datepicker")||zP;c=Sd(c,{isInvalid:!0,validationErrors:[d.getStringForLocale("rangeReversed",ZP())],validationDetails:{...xd,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return c}u(BI,"$35a22f14a1f04b11$export$80ff8fc0ae339c13");const RI={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},VI={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function Br(t,e){t={...e.shouldForceLeadingZeros?VI:RI,...t};let r=e.granularity||"minute",i=Object.keys(t);var l;let a=i.indexOf((l=e.maxGranularity)!==null&&l!==void 0?l:"year");a<0&&(a=0);let o=i.indexOf(r);if(o<0&&(o=2),a>o)throw new Error("maxGranularity must be greater than granularity");let s=i.slice(a,o+1).reduce((d,f)=>(d[f]=t[f],d),{});return e.hourCycle!=null&&(s.hour12=e.hourCycle===12),s.timeZone=e.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&e.timeZone&&!e.hideTimeZone&&(s.timeZoneName="short"),e.showEra&&a===0&&(s.era="short"),s}u(Br,"$35a22f14a1f04b11$export$7e319ea407e63bc0");function Qa(t){return t&&"hour"in t?t:new Tr}u(Qa,"$35a22f14a1f04b11$export$c5221a78ef73c5e9");function XP(t,e){if(t===null)return null;if(t)return Ne(t,e)}u(XP,"$35a22f14a1f04b11$export$61a490a80c552550");function ys(t,e,n,r){if(t)return XP(t,n);let i=Ne(V3(r??kr()).set({hour:0,minute:0,second:0,millisecond:0}),n);return e==="year"||e==="month"||e==="day"?vt(i):r?i:Pn(i)}u(ys,"$35a22f14a1f04b11$export$66aa2b09de4b1ea5");function v0(t,e){let n=t&&"timeZone"in t?t.timeZone:void 0,r=t&&"minute"in t?"minute":"day";if(t&&e&&!(e in t))throw new Error("Invalid granularity "+e+" for value "+t.toString());let[i,l]=(0,wp.element.useState)([r,n]);t&&(i[0]!==r||i[1]!==n)&&l([r,n]),e||(e=t?r:i[0]);let a=t?n:i[1];return[e,a]}u(v0,"$35a22f14a1f04b11$export$2440da353cedad43");function NI(t){let e=pi(t),[n,r]=je(t.value,t.defaultValue||null,t.onChange),[i]=(0,wp.element.useState)(n),l=n||t.placeholderValue||null,[a,o]=v0(l,t.granularity),s=n!=null?n.toDate(o??"UTC"):null,c=a==="hour"||a==="minute"||a==="second";var d;let f=(d=t.shouldCloseOnSelect)!==null&&d!==void 0?d:!0,[h,p]=(0,wp.element.useState)(null),[m,g]=(0,wp.element.useState)(null);if(n&&(h=n,"hour"in n&&(m=n)),l&&!(a in l))throw new Error("Invalid granularity "+a+" for value "+l.toString());let O=n?.calendar.identifier==="gregory"&&n.era==="BC",b=(0,wp.element.useMemo)(()=>({granularity:a,timeZone:o,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:O}),[a,t.hourCycle,t.shouldForceLeadingZeros,o,t.hideTimeZone,O]),{minValue:y,maxValue:$,isDateUnavailable:v}=t,S=(0,wp.element.useMemo)(()=>Nd(n,y,$,v,b),[n,y,$,v,b]),x=Yn({...t,value:n,builtinValidation:S}),C=x.displayValidation.isInvalid,Q=t.validationState||(C?"invalid":null),T=u((A,E)=>{r("timeZone"in E?E.set(vt(A)):Pn(A,E)),p(null),g(null),x.commitValidation()},"commitValue"),B=u(A=>{let E=typeof f=="function"?f():f;c?m||E?T(A,m||Qa(t.defaultValue||t.placeholderValue)):p(A):(r(A),x.commitValidation()),E&&e.setOpen(!1)},"selectDate"),w=u(A=>{h&&A?T(h,A):g(A)},"selectTime");var M;return{...x,value:n,defaultValue:(M=t.defaultValue)!==null&&M!==void 0?M:i,setValue:r,dateValue:h,timeValue:m,setDateValue:B,setTimeValue:w,granularity:a,hasTime:c,...e,setOpen(A){!A&&!n&&h&&c&&T(h,m||Qa(t.defaultValue||t.placeholderValue)),e.setOpen(A)},validationState:Q,isInvalid:C,formatValue(A,E){if(!s)return"";let I=Br(E,b);return new Rt(A,I).format(s)},getDateFormatter(A,E){let I={...b,...E},D=Br({},I);return new Rt(A,D)}}}u(NI,"$ab5bf3f618090389$export$87194bb378cc3ac2");const FI=new dn({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"\u12D3\u12D3\u12D3\u12D3",month:"\u121A\u121C",day:"\u1240\u1240"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"\u0633\u0646\u0629",month:"\u0634\u0647\u0631",day:"\u064A\u0648\u0645"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bg:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},bn:{year:"yyyy",month:"\u09AE\u09BF\u09AE\u09BF",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"\u0633\u0627\u06B5",month:"\u0645\u0627\u0646\u06AF",day:"\u0695\u06C6\u0698"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"\u017A\u017A"},el:{year:"\u03B5\u03B5\u03B5\u03B5",month:"\u03BC\u03BC",day:"\u03B7\u03B7"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"\u0633\u0627\u0644",month:"\u0645\u0627\u0647",day:"\u0631\u0648\u0632"},ff:{year:"hhhh",month:"ll",day:"\xF1\xF1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"\u05E9\u05E0\u05D4",month:"\u05D7\u05D5\u05D3\u05E9",day:"\u05D9\u05D5\u05DD"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xE9\xE9\xE9\xE9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"\u5E74",month:"\u6708",day:"\u65E5"},ka:{year:"\u10EC\u10EC\u10EC\u10EC",month:"\u10D7\u10D7",day:"\u10E0\u10E0"},kk:{year:"\u0436\u0436\u0436\u0436",month:"\u0430\u0430",day:"\u043A\u043A"},kn:{year:"\u0CB5\u0CB5\u0CB5\u0CB5",month:"\u0CAE\u0CBF\u0CAE\u0CC0",day:"\u0CA6\u0CBF\u0CA6\u0CBF"},ko:{year:"\uC5F0\uB3C4",month:"\uC6D4",day:"\uC77C"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"\u0E9B\u0E9B\u0E9B\u0E9B",month:"\u0E94\u0E94",day:"\u0EA7\u0EA7"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"\u0D35\u0D7C\u0D37\u0D02",month:"\u0D2E\u0D3E\u0D38\u0D02",day:"\u0D24\u0D40\u0D2F\u0D24\u0D3F"},ms:{year:"tttt",month:"mm",day:"hh"},nb:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},no:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"\u0433\u0433\u0433\u0433",month:"\u043C\u043C",day:"\u0434\u0434"},sv:{year:"\xE5\xE5\xE5\xE5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"\u0441\u0441\u0441\u0441",month:"\u043C\u043C",day:"\u0440\u0440"},th:{year:"\u0E1B\u0E1B\u0E1B\u0E1B",month:"\u0E14\u0E14",day:"\u0E27\u0E27"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"\u0440\u0440\u0440\u0440",month:"\u043C\u043C",day:"\u0434\u0434"},"zh-CN":{year:"\u5E74",month:"\u6708",day:"\u65E5"},"zh-TW":{year:"\u5E74",month:"\u6708",day:"\u65E5"}},"en");function II(t,e,n){return t==="era"||t==="dayPeriod"?e:t==="year"||t==="month"||t==="day"?FI.getStringForLocale(t,n):"\u2013\u2013"}u(II,"$3e3ed55ab2966714$export$d3f5c5e0a5023fa0");const Fd={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},jP={year:5,month:2,day:7,hour:2,minute:15,second:15},qP={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function WP(t){let{locale:e,createCalendar:n,hideTimeZone:r,isDisabled:i=!1,isReadOnly:l=!1,isRequired:a=!1,minValue:o,maxValue:s,isDateUnavailable:c}=t,d=t.value||t.defaultValue||t.placeholderValue||null,[f,h]=v0(d,t.granularity),p=h||"UTC";if(d&&!(f in d))throw new Error("Invalid granularity "+f+" for value "+d.toString());let m=(0,wp.element.useMemo)(()=>new Rt(e),[e]),g=(0,wp.element.useMemo)(()=>n(m.resolvedOptions().calendar),[n,m]);var O;let[b,y]=je(t.value,(O=t.defaultValue)!==null&&O!==void 0?O:null,t.onChange),[$]=(0,wp.element.useState)(b),v=(0,wp.element.useMemo)(()=>{var K;return(K=XP(b,g))!==null&&K!==void 0?K:null},[b,g]),[S,x]=(0,wp.element.useState)(()=>ys(t.placeholderValue,f,g,h)),C=v||S,Q=g.identifier==="gregory"&&C.era==="BC",T=(0,wp.element.useMemo)(()=>{var K;return{granularity:f,maxGranularity:(K=t.maxGranularity)!==null&&K!==void 0?K:"year",timeZone:h,hideTimeZone:r,hourCycle:t.hourCycle,showEra:Q,shouldForceLeadingZeros:t.shouldForceLeadingZeros}},[t.maxGranularity,f,t.hourCycle,t.shouldForceLeadingZeros,h,r,Q]),B=(0,wp.element.useMemo)(()=>Br({},T),[T]),w=(0,wp.element.useMemo)(()=>new Rt(e,B),[e,B]),M=(0,wp.element.useMemo)(()=>w.resolvedOptions(),[w]),A=(0,wp.element.useMemo)(()=>w.formatToParts(new Date).filter(K=>Fd[K.type]).reduce((K,W)=>(K[qP[W.type]||W.type]=!0,K),{}),[w]),[E,I]=(0,wp.element.useState)(()=>t.value||t.defaultValue?{...A}:{}),D=(0,wp.element.useRef)(null),P=(0,wp.element.useRef)(g);(0,wp.element.useEffect)(()=>{od(g,P.current)||(P.current=g,x(K=>Object.keys(E).length>0?Ne(K,g):ys(t.placeholderValue,f,g,h)))},[g,f,E,h,t.placeholderValue]),b&&Object.keys(E).length=Object.keys(A).length?v:S,L=u(K=>{if(t.isDisabled||t.isReadOnly)return;let W=Object.keys(E),Z=Object.keys(A);K==null?(y(null),x(ys(t.placeholderValue,f,g,h)),I({})):W.length===0&&D.current==null||W.length>=Z.length||W.length===Z.length-1&&A.dayPeriod&&!E.dayPeriod&&D.current!=="dayPeriod"?(W.length===0&&(E={...A},I(E)),K=Ne(K,d?.calendar||new tt),y(K)):x(K),D.current=null},"setValue"),k=(0,wp.element.useMemo)(()=>R.toDate(p),[R,p]),F=(0,wp.element.useMemo)(()=>LI(k,E,w,M,R,g,e,f),[k,E,w,M,R,g,e,f]);A.era&&E.year&&!E.era?(E.era=!0,I({...E})):!A.era&&E.era&&(delete E.era,I({...E}));let N=u(K=>{E[K]=!0,K==="year"&&A.era&&(E.era=!0),I({...E})},"markValid"),z=u((K,W)=>{if(E[K])L(zI(R,K,W,M));else{N(K);let Z=Object.keys(E),ee=Object.keys(A);(Z.length>=ee.length||Z.length===ee.length-1&&A.dayPeriod&&!E.dayPeriod)&&L(R)}},"adjustSegment"),G=(0,wp.element.useMemo)(()=>Nd(b,o,s,c,T),[b,o,s,c,T]),le=Yn({...t,value:b,builtinValidation:G}),ie=le.displayValidation.isInvalid,me=t.validationState||(ie?"invalid":null);var ve,ce;return{...le,value:v,defaultValue:(ve=t.defaultValue)!==null&&ve!==void 0?ve:$,dateValue:k,calendar:g,setValue:L,segments:F,dateFormatter:w,validationState:me,isInvalid:ie,granularity:f,maxGranularity:(ce=t.maxGranularity)!==null&&ce!==void 0?ce:"year",isDisabled:i,isReadOnly:l,isRequired:a,increment(K){z(K,1)},decrement(K){z(K,-1)},incrementPage(K){z(K,jP[K]||1)},decrementPage(K){z(K,-(jP[K]||1))},setSegment(K,W){N(K),L(ZI(R,K,W,M))},confirmPlaceholder(){if(t.isDisabled||t.isReadOnly)return;let K=Object.keys(E),W=Object.keys(A);K.length===W.length-1&&A.dayPeriod&&!E.dayPeriod&&(E={...A},I(E),L(R.copy()))},clearSegment(K){delete E[K],D.current=K,I({...E});let W=ys(t.placeholderValue,f,g,h),Z=R;if(K==="dayPeriod"&&"hour"in R&&"hour"in W){let ee=R.hour>=12,De=W.hour>=12;ee&&!De?Z=R.set({hour:R.hour-12}):!ee&&De&&(Z=R.set({hour:R.hour+12}))}else K==="hour"&&"hour"in R&&R.hour>=12&&E.dayPeriod?Z=R.set({hour:W.hour+12}):K in R&&(Z=R.set({[K]:W[K]}));y(null),L(Z)},formatValue(K){if(!v)return"";let W=Br(K,T);return new Rt(e,W).format(k)},getDateFormatter(K,W){let Z={...T,...W},ee=Br({},Z);return new Rt(K,ee)}}}u(WP,"$3c0fc76039f1c516$export$60e84778edff6d26");function LI(t,e,n,r,i,l,a,o){let s=["hour","minute","second"],c=n.formatToParts(t),d=[];for(let f of c){let h=qP[f.type]||f.type,p=Fd[h];h==="era"&&l.getEras().length===1&&(p=!1);let m=Fd[h]&&!e[h],g=Fd[h]?II(h,f.value,a):null,O={type:h,text:m?g:f.value,...Id(i,h,r),isPlaceholder:m,placeholder:g,isEditable:p};h==="hour"?(d.push({type:"literal",text:"\u2066",...Id(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(O),h===o&&d.push({type:"literal",text:"\u2069",...Id(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(h)&&h===o?(d.push(O),d.push({type:"literal",text:"\u2069",...Id(i,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(O)}return d}u(LI,"$3c0fc76039f1c516$var$processSegments");function Id(t,e,n){switch(e){case"era":{let r=t.calendar.getEras();return{value:r.indexOf(t.era),minValue:0,maxValue:r.length-1}}case"year":return{value:t.year,minValue:1,maxValue:t.calendar.getYearsInEra(t)};case"month":return{value:t.month,minValue:FR(t),maxValue:t.calendar.getMonthsInYear(t)};case"day":return{value:t.day,minValue:IR(t),maxValue:t.calendar.getDaysInMonth(t)}}if("hour"in t)switch(e){case"dayPeriod":return{value:t.hour>=12?12:0,minValue:0,maxValue:12};case"hour":if(n.hour12){let r=t.hour>=12;return{value:t.hour,minValue:r?12:0,maxValue:r?23:11}}return{value:t.hour,minValue:0,maxValue:23};case"minute":return{value:t.minute,minValue:0,maxValue:59};case"second":return{value:t.second,minValue:0,maxValue:59}}return{}}u(Id,"$3c0fc76039f1c516$var$getSegmentLimits");function zI(t,e,n,r){switch(e){case"era":case"year":case"month":case"day":return t.cycle(e,n,{round:e==="year"})}if("hour"in t)switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return t.set({hour:l?i-12:i+12})}case"hour":case"minute":case"second":return t.cycle(e,n,{round:e!=="hour",hourCycle:r.hour12?12:24})}throw new Error("Unknown segment: "+e)}u(zI,"$3c0fc76039f1c516$var$addSegment");function ZI(t,e,n,r){switch(e){case"day":case"month":case"year":case"era":return t.set({[e]:n})}if("hour"in t&&typeof n=="number")switch(e){case"dayPeriod":{let i=t.hour,l=i>=12;return n>=12===l?t:t.set({hour:l?i-12:i+12})}case"hour":if(r.hour12){let l=t.hour>=12;!l&&n===12&&(n=0),l&&n<12&&(n+=12)}case"minute":case"second":return t.set({[e]:n})}throw new Error("Unknown segment: "+e)}u(ZI,"$3c0fc76039f1c516$var$setSegment");function XI(t){var e,n;let r=pi(t),[i,l]=je(t.value,t.defaultValue||null,t.onChange),[a]=(0,wp.element.useState)(i),[o,s]=(0,wp.element.useState)(()=>i||{start:null,end:null});i==null&&o.start&&o.end&&(o={start:null,end:null},s(o));let c=i||o,d=u(R=>{c=R||{start:null,end:null},s(c),al(c)?l(c):l(null)},"setValue"),f=c?.start||c?.end||t.placeholderValue||null,[h,p]=v0(f,t.granularity),m=h==="hour"||h==="minute"||h==="second";var g;let O=(g=t.shouldCloseOnSelect)!==null&&g!==void 0?g:!0,[b,y]=(0,wp.element.useState)(null),[$,v]=(0,wp.element.useState)(null);c&&al(c)&&(b=c,"hour"in c.start&&($=c));let S=u((R,L)=>{d({start:"timeZone"in L.start?L.start.set(vt(R.start)):Pn(R.start,L.start),end:"timeZone"in L.end?L.end.set(vt(R.end)):Pn(R.end,L.end)}),y(null),v(null),E.commitValidation()},"commitValue"),x=u(R=>{let L=typeof O=="function"?O():O;m?al(R)&&(L||$?.start&&$?.end)?S(R,{start:$?.start||Qa(t.placeholderValue),end:$?.end||Qa(t.placeholderValue)}):y(R):al(R)?(d(R),E.commitValidation()):y(R),L&&r.setOpen(!1)},"setDateRange"),C=u(R=>{al(b)&&al(R)?S(b,R):v(R)},"setTimeRange"),Q=(c==null||(e=c.start)===null||e===void 0?void 0:e.calendar.identifier)==="gregory"&&c.start.era==="BC"||(c==null||(n=c.end)===null||n===void 0?void 0:n.calendar.identifier)==="gregory"&&c.end.era==="BC",T=(0,wp.element.useMemo)(()=>({granularity:h,timeZone:p,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,shouldForceLeadingZeros:t.shouldForceLeadingZeros,showEra:Q}),[h,t.hourCycle,t.shouldForceLeadingZeros,p,t.hideTimeZone,Q]),{minValue:B,maxValue:w,isDateUnavailable:M}=t,A=(0,wp.element.useMemo)(()=>BI(c,B,w,M,T),[c,B,w,M,T]),E=Yn({...t,value:i,name:(0,wp.element.useMemo)(()=>[t.startName,t.endName].filter(R=>R!=null),[t.startName,t.endName]),builtinValidation:A}),I=E.displayValidation.isInvalid,D=t.validationState||(I?"invalid":null);var P;return{...E,value:c,defaultValue:(P=t.defaultValue)!==null&&P!==void 0?P:a,setValue:d,dateRange:b,timeRange:$,granularity:h,hasTime:m,setDate(R,L){var k,F;x(R==="start"?{start:L,end:(k=b?.end)!==null&&k!==void 0?k:null}:{start:(F=b?.start)!==null&&F!==void 0?F:null,end:L})},setTime(R,L){var k,F;C(R==="start"?{start:L,end:(k=$?.end)!==null&&k!==void 0?k:null}:{start:(F=$?.start)!==null&&F!==void 0?F:null,end:L})},setDateTime(R,L){var k,F;d(R==="start"?{start:L,end:(k=c?.end)!==null&&k!==void 0?k:null}:{start:(F=c?.start)!==null&&F!==void 0?F:null,end:L})},setDateRange:x,setTimeRange:C,...r,setOpen(R){!R&&!(c?.start&&c?.end)&&al(b)&&m&&S(b,{start:$?.start||Qa(t.placeholderValue),end:$?.end||Qa(t.placeholderValue)}),r.setOpen(R)},validationState:D,isInvalid:I,formatValue(R,L){if(!c||!c.start||!c.end)return null;let k="timeZone"in c.start?c.start.timeZone:void 0,F=t.granularity||(c.start&&"minute"in c.start?"minute":"day"),N="timeZone"in c.end?c.end.timeZone:void 0,z=t.granularity||(c.end&&"minute"in c.end?"minute":"day"),G=Br(L,{granularity:F,timeZone:k,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle,showEra:c.start.calendar.identifier==="gregory"&&c.start.era==="BC"||c.end.calendar.identifier==="gregory"&&c.end.era==="BC"}),le=c.start.toDate(k||"UTC"),ie=c.end.toDate(N||"UTC"),me=new Rt(R,G),ve;if(k===N&&F===z&&c.start.compare(c.end)!==0){try{let ce=me.formatRangeToParts(le,ie),K=-1;for(let ee=0;eeK&&(Z+=ce[ee].value);return{start:W,end:Z}}catch{}ve=me}else{let ce=Br(L,{granularity:z,timeZone:N,hideTimeZone:t.hideTimeZone,hourCycle:t.hourCycle});ve=new Rt(R,ce)}return{start:me.format(le),end:ve.format(ie)}},getDateFormatter(R,L){let k={...T,...L},F=Br({},k);return new Rt(R,F)}}}u(XI,"$93c38a5e28be6249$export$e50a61c1de9f574");function al(t){return t?.start!=null&&t.end!=null}u(al,"$93c38a5e28be6249$var$isCompleteRange");function jI(t){let{placeholderValue:e=new Tr,minValue:n,maxValue:r,defaultValue:i,granularity:l,validate:a}=t,[o,s]=je(t.value,i??null,t.onChange),c=o||e,d=c&&"day"in c?c:void 0,f=i&&"timeZone"in i?i.timeZone:void 0,h=(0,wp.element.useMemo)(()=>{let v=c&&"timeZone"in c?c.timeZone:void 0;return(v||f)&&e?K3(Ma(e),v||f):Ma(e)},[e,c,f]),p=(0,wp.element.useMemo)(()=>Ma(n,d),[n,d]),m=(0,wp.element.useMemo)(()=>Ma(r,d),[r,d]),g=(0,wp.element.useMemo)(()=>o&&"day"in o?Y3(o):o,[o]),O=(0,wp.element.useMemo)(()=>o==null?null:Ma(o),[o]),b=(0,wp.element.useMemo)(()=>i==null?null:Ma(i),[i]);return{...WP({...t,value:O,defaultValue:b,minValue:p,maxValue:m,onChange:u(v=>{s(d||f?v:v&&Y3(v))},"onChange"),granularity:l||"minute",maxGranularity:"hour",placeholderValue:h??void 0,createCalendar:()=>new tt,validate:(0,wp.element.useCallback)(()=>a?.(o),[a,o])}),timeValue:g}}u(jI,"$eff5d8ee529ac4bb$export$fd53cef0cc796101");function Ma(t,e=Cr(kr())){return t?"day"in t?t:Pn(e,t):null}u(Ma,"$eff5d8ee529ac4bb$var$convertValue");function qI(t,e){let{cursor:n,getKey:r}=t;return{setSelectedKeys(i){e(l=>({...l,selectedKeys:i}))},addKeysToSelection(i){e(l=>l.selectedKeys==="all"?l:i==="all"?{...l,selectedKeys:"all"}:{...l,selectedKeys:new Set([...l.selectedKeys,...i])})},removeKeysFromSelection(i){e(l=>{if(i==="all")return{...l,selectedKeys:new Set};let a=l.selectedKeys==="all"?new Set(l.items.map(r)):new Set(l.selectedKeys);for(let o of i)a.delete(o);return{...l,selectedKeys:a}})},setFilterText(i){e(l=>({...l,filterText:i}))},insert(i,...l){e(a=>vs(a,i,...l))},insertBefore(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return vs(a,o,...l)})},insertAfter(i,...l){e(a=>{let o=a.items.findIndex(s=>r?.(s)===i);if(o===-1)if(a.items.length===0)o=0;else return a;return vs(a,o+1,...l)})},prepend(...i){e(l=>vs(l,0,...i))},append(...i){e(l=>vs(l,l.items.length,...i))},remove(...i){e(l=>{let a=new Set(i),o=l.items.filter(c=>!a.has(r(c))),s="all";if(l.selectedKeys!=="all"){s=new Set(l.selectedKeys);for(let c of i)s.delete(c)}return n==null&&o.length===0&&(s=new Set),{...l,items:o,selectedKeys:s}})},removeSelectedItems(){e(i=>{if(i.selectedKeys==="all")return{...i,items:[],selectedKeys:new Set};let l=i.selectedKeys,a=i.items.filter(o=>!l.has(r(o)));return{...i,items:a,selectedKeys:new Set}})},move(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let s=a.items.slice(),[c]=s.splice(o,1);return s.splice(l,0,c),{...a,items:s}})},moveBefore(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return YP(a,c,o)})},moveAfter(i,l){e(a=>{let o=a.items.findIndex(d=>r(d)===i);if(o===-1)return a;let c=(Array.isArray(l)?l:[...l]).map(d=>a.items.findIndex(f=>r(f)===d)).sort((d,f)=>d-f);return YP(a,c,o+1)})},update(i,l){e(a=>{let o=a.items.findIndex(s=>r(s)===i);return o===-1?a:{...a,items:[...a.items.slice(0,o),l,...a.items.slice(o+1)]}})}}}u(qI,"$0d86e9c8f07f9a7b$export$79c0c687a5963b0a");function vs(t,e,...n){return{...t,items:[...t.items.slice(0,e),...n,...t.items.slice(e)]}}u(vs,"$0d86e9c8f07f9a7b$var$insert");function YP(t,e,n){n-=e.filter(l=>l({from:l,to:n++}));for(let l=0;la&&r[o].from--}for(let l=0;ll;o--){let s=r[o];s.fromf.id||f.key,"getKey"),initialFilterText:a=""}=t;let[o,s]=(0,wp.element.useReducer)(WI,{state:"idle",error:void 0,items:[],selectedKeys:r==="all"?"all":new Set(r),sortDescriptor:i,filterText:a});const c=u(async(f,h)=>{let p=new AbortController;try{s({...f,abortController:p});var m;let b=(m=f.filterText)!==null&&m!==void 0?m:o.filterText;var g;let y=await h({items:o.items.slice(),selectedKeys:o.selectedKeys,sortDescriptor:(g=f.sortDescriptor)!==null&&g!==void 0?g:o.sortDescriptor,signal:p.signal,cursor:f.type==="loadingMore"?o.cursor:void 0,filterText:b,loadingState:o.state});var O;let $=(O=y.filterText)!==null&&O!==void 0?O:b;s({type:"success",...y,abortController:p}),$&&$!==b&&!p.signal.aborted&&c({type:"filtering",filterText:$},e)}catch(b){s({type:"error",error:b,abortController:p})}},"dispatchFetch");let d=(0,wp.element.useRef)(!1);return(0,wp.element.useEffect)(()=>{d.current||(c({type:"loading"},e),d.current=!0)},[]),{items:o.items,selectedKeys:o.selectedKeys,sortDescriptor:o.sortDescriptor,isLoading:o.state==="loading"||o.state==="loadingMore"||o.state==="sorting"||o.state==="filtering",loadingState:o.state,error:o.error,filterText:o.filterText,getItem(f){return o.items.find(h=>l(h)===f)},reload(){c({type:"loading"},e)},loadMore(){o.state==="loading"||o.state==="loadingMore"||o.state==="filtering"||o.cursor==null||c({type:"loadingMore"},e)},sort(f){c({type:"sorting",sortDescriptor:f},n||e)},...qI({...t,getKey:l,cursor:o.cursor},f=>{s({type:"update",updater:f})}),setFilterText(f){c({type:"filtering",filterText:f},e)}}}u(YI,"$f86e6c1ec7da6ebb$export$bc3384a35de93d66");let KI=Math.round(Math.random()*1e10),UI=0;function KP(t){let e=(0,wp.element.useMemo)(()=>t.name||`radio-group-${KI}-${++UI}`,[t.name]);var n;let[r,i]=je(t.value,(n=t.defaultValue)!==null&&n!==void 0?n:null,t.onChange),[l]=(0,wp.element.useState)(r),[a,o]=(0,wp.element.useState)(null),s=Yn({...t,value:r}),c=u(h=>{!t.isReadOnly&&!t.isDisabled&&(i(h),s.commitValidation())},"setSelectedValue"),d=s.displayValidation.isInvalid;var f;return{...s,name:e,selectedValue:r,defaultSelectedValue:t.value!==void 0?l:(f=t.defaultValue)!==null&&f!==void 0?f:null,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:t.isDisabled||!1,isReadOnly:t.isReadOnly||!1,isRequired:t.isRequired||!1,validationState:t.validationState||(d?"invalid":null),isInvalid:d}}u(KP,"$a54cdc5c1942b639$export$bca9d026f8e704eb");function GI(t){let{selectionMode:e="single"}=t,n=pi(t),[r,i]=(0,wp.element.useState)(null),l=(0,wp.element.useMemo)(()=>{var v;return t.defaultValue!==void 0?t.defaultValue:e==="single"?(v=t.defaultSelectedKey)!==null&&v!==void 0?v:null:[]},[t.defaultValue,t.defaultSelectedKey,e]),a=(0,wp.element.useMemo)(()=>t.value!==void 0?t.value:e==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,e]),[o,s]=je(a,l,t.onChange),c=e==="single"&&Array.isArray(o)?o[0]:o,d=u(v=>{if(e==="single"){var S,x;let C=Array.isArray(v)?(x=v[0])!==null&&x!==void 0?x:null:v;s(C),C!==c&&((S=t.onSelectionChange)===null||S===void 0||S.call(t,C))}else{let C=[];Array.isArray(v)?C=v:v!=null&&(C=[v]),s(C)}},"setValue"),f=y0({...t,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:(0,wp.element.useMemo)(()=>_I(c),[c]),onSelectionChange:v=>{if(v!=="all"){if(e==="single"){var S;let x=(S=v.values().next().value)!==null&&S!==void 0?S:null;d(x),n.close()}else d([...v]);m.commitValidation()}}}),h=f.selectionManager.firstSelectedKey,p=(0,wp.element.useMemo)(()=>[...f.selectionManager.selectedKeys].map(v=>f.collection.getItem(v)).filter(v=>v!=null),[f.selectionManager.selectedKeys,f.collection]),m=Yn({...t,value:Array.isArray(c)&&c.length===0?null:c}),[g,O]=(0,wp.element.useState)(!1),[b]=(0,wp.element.useState)(c);var y,$;return{...m,...f,...n,value:c,defaultValue:l??b,setValue:d,selectedKey:h,setSelectedKey:d,selectedItem:(y=p[0])!==null&&y!==void 0?y:null,selectedItems:p,defaultSelectedKey:($=t.defaultSelectedKey)!==null&&$!==void 0?$:t.selectionMode==="single"?b:null,focusStrategy:r,open(v=null){f.collection.size!==0&&(i(v),n.open())},toggle(v=null){f.collection.size!==0&&(i(v),n.toggle())},isFocused:g,setFocused:O}}u(GI,"$2bc3a590c5373a4e$export$5159ec8b34d4ec12");function _I(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}u(_I,"$2bc3a590c5373a4e$var$convertValue");var HI=Object.defineProperty,JI=u((t,e)=>HI(t,"name",{value:e,configurable:!0}),"n$o");const $s=JI(t=>{const e=t.content??t.children,n=pi(t),{triggerProps:r,overlayProps:i}=us({type:"dialog"},n);return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(se,{...r,type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},t.label??"Open modal"),n.isOpen&&wp.element.createElement(kI,{className:"tf-modal",state:n},wp.element.createElement(gs,{title:t.title,...i},e,wp.element.createElement("div",{className:"tf-modal-actions"},wp.element.createElement(se,{type:"danger",onPress:()=>{n.close(),t.onValidate&&t.onValidate()}},t.confirmText??t.label),wp.element.createElement(se,{type:"action",onPress:()=>{n.close(),t.onCancel&&t.onCancel()}},t.cancelText??"Cancel")))))},"ModalTrigger");var eL=Object.defineProperty,tL=u((t,e)=>eL(t,"name",{value:e,configurable:!0}),"s$i");function UP({message:t,type:e,onDismiss:n}){return wp.element.createElement("div",{className:`tf-notice ${e} tf-is-dismissible`},wp.element.createElement("p",null,t),wp.element.createElement("button",{type:"button",className:"tf-notice-dismiss",onClick:n}))}u(UP,"n$n"),tL(UP,"Notice");var nL=Object.defineProperty,rL=u((t,e)=>nL(t,"name",{value:e,configurable:!0}),"i$o");function Rr({children:t,state:e,style:n,className:r="",...i}){const l=wp.element.useRef(null),{popoverProps:a,underlayProps:o}=WN({...i,popoverRef:l},e),s=wp.element.useContext(Zl);return wp.element.createElement(_k,{portalContainer:s.portalContainer},wp.element.createElement("div",{className:s.wrapper},!i.isNonModal&&wp.element.createElement("div",{...o,className:"tf-underlay"}),wp.element.createElement("div",{...a,ref:l,style:{...a.style,...n,zIndex:1e6,boxSizing:"border-box"},className:`tf-popover ${r}`},t,wp.element.createElement(ds,{onDismiss:e.close}))))}u(Rr,"y$6"),rL(Rr,"Popover");var iL=Object.defineProperty,lL=u((t,e)=>iL(t,"name",{value:e,configurable:!0}),"o$i");const Ld=lL(t=>t.choices?wp.element.createElement(nF,{key:t.key??t.name,title:t.label??"",items:t.choices??[]},e=>wp.element.createElement(Qr,{key:e.value??""},e.label??"")):wp.element.createElement(Qr,{key:t.value??""},t.label??""),"RenderChoices");var aL=Object.defineProperty,mi=u((t,e)=>aL(t,"name",{value:e,configurable:!0}),"e$4");const oL=mi(t=>wp.element.createElement("div",{className:"tf-tab-container "+(t.className??"")},t.children),"Container"),sL=mi(t=>wp.element.createElement("div",{className:"tf-tab-header"},wp.element.createElement("div",{className:"tf-tab-items "+(t.className??"")},t.children),t.actions&&wp.element.createElement("div",{className:"tf-tab-actions "+(t.actionsClassName??"")},t.actions)),"Header"),uL=mi(t=>wp.element.createElement("div",{className:"tf-tab-item "+(t.className??""),"data-open":t.isOpen??!1},wp.element.createElement(se,{type:"text-action",onPress:t.onPress},t.children)),"Title"),cL=mi(t=>{const[e,n]=wp.element.useState(t.isActive??!1);if(wp.element.useEffect(()=>{t.isActive!==e&&n(t.isActive)},[t.isActive]),!!e)return wp.element.createElement("div",{className:"tf-tab-content "+(t.className??"")},t.children)},"Content"),dL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row "+(t.className??"")},t.children),"Row"),fL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title tf-tab-row-title-section "+(t.className??"")},t.children),"RowTitle"),hL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-title "+(t.className??"")},wp.element.createElement("span",{className:"tf-label"},t.children)),"RowLabel"),pL=mi(t=>wp.element.createElement("div",{className:"tf-tab-row-field "+(t.className??"")},t.children),"RowField");var GP=Object.freeze({__proto__:null,Container:oL,Content:cL,Header:sL,Row:dL,RowField:pL,RowLabel:hL,RowTitle:fL,Title:uL}),mL=Object.defineProperty,gL=u((t,e)=>mL(t,"name",{value:e,configurable:!0}),"l$g");const zd=gL(t=>{const e=`h${t.level??"3"}`,n=t.content??t.children;return wp.element.createElement("div",{className:"tf-title"},wp.element.createElement(e,{className:t.className},n))},"Title");var OL=Object.defineProperty,bL=u((t,e)=>OL(t,"name",{value:e,configurable:!0}),"n$k");const yL=bL(t=>{const e=t.content??t.children,n=t.placement??"top",r=t.theme&&t.theme==="dark"?"dark":"light";return wp.element.createElement("div",{className:`tf-tooltip tf-tooltip-${n}`},wp.element.createElement("div",{className:`tf-tooltip-content tf-tooltip-content-${n} ${r}`},e))},"Tooltip");var vL=Object.defineProperty,_P=u((t,e)=>vL(t,"name",{value:e,configurable:!0}),"n$j");const $L=_P(t=>{const e=t.layout??"button",n=t.label??"Open tooltip",r=t.children??!1;return wp.element.createElement("div",{className:"tf-tooltip-trigger"},wp.element.createElement("div",{className:"tf-tooltip-trigger-content"},r||_P(()=>e==="button"?wp.element.createElement(se,{type:"action",isDisabled:t.isDisabled,...t.buttonProps??{}},n):wp.element.createElement("span",null,n),"renderContent")(),wp.element.createElement(yL,{...t})))},"TooltipTrigger");var wL=Object.defineProperty,xL=u((t,e)=>wL(t,"name",{value:e,configurable:!0}),"t$b");const SL=xL(({content:t,children:e})=>wp.element.createElement(wp.element.Fragment,null,t??e),"Wrapper");var CL=Object.defineProperty,ol=u((t,e)=>CL(t,"name",{value:e,configurable:!0}),"o$f");const HP=ol(t=>{const e={},n=["sectionTitle"],r=t.dependent?.callback??!1,i=t.dependent?.callbackData??!1;for(const l in t){if(n.includes(l))continue;const a=t[l];if(a&&typeof a=="object"&&!Array.isArray(a)){const o=HP(a);if(Object.keys(o).length===0)continue;for(const s in o)e[s]||(e[s]={}),e[s][l]={__isWrapped:!0,...o[s]}}if(typeof a=="string")for(const o of eE(a)){const s=DL(o,r,i);s&&(e[s.name]||(e[s.name]={}),e[s.name][l]=s.config)}}return e},"getDependentFields"),kL=ol((t=!0)=>t?/(\{\{.+?}\})/g:/\{\{(.+?)}\}/g,"dependentAttributeRegex"),JP=ol(t=>eE(t).length>0,"isDependentString"),eE=ol((t,e=!0)=>typeof t=="string"?Array.from(t.matchAll(kL(e)),n=>n[1]):[],"getDependentStrings"),DL=ol((t,e,n)=>{if(!JP(t))return!1;const r=t.slice(2,t.length-2).trim();if(!r.includes("."))return{name:r,config:{__returnedType:"full",__callback:e,__callbackData:n}};const[i,l]=r.split(".");return{name:i,config:{__returnedType:"partial",__returnedAttribute:l,__callback:e,__callbackData:n}}},"getDependentValue"),tE=ol((t,e,n,r,i)=>{const l=e.__returnedType==="partial"?n()?.[e.__returnedAttribute]:n();let a=e.__callback??!1;typeof a=="string"&&(a=G1.dependent.__callbacks[a]??!1);const o=a?a({attribute:t,value:l,...e.__callbackData??{}}):l;return typeof o=="string"&&typeof i=="string"?i.replace(e.__returnedType==="partial"?`{{${r}.${e.__returnedAttribute}}}`:`{{${r}}}`,o):o},"getFieldValue"),PL=ol((t,e,n)=>{if(e===!1)return{...t};const r={...t};for(const i in e){const l=e[i];for(const a in l){const o=l[a];if(o.__isWrapped){for(const s in o){if(s==="__isWrapped")continue;const c=tE(s,o[s],()=>n(i),i,r[a][s]);r[a]={...r[a],[s]:c}}continue}r[a]=tE(a,o,()=>n(i),i,r[a])}}return r},"mergeDependentProps");var EL=Object.defineProperty,nE=u((t,e)=>EL(t,"name",{value:e,configurable:!0}),"o$e");const rE=nE(({itemProps:t,refresh:e,data:n,children:r})=>{const i=Object.assign({},t);delete i.value,delete i.onChange,delete i.class,delete i.wrapper;const l=wp.element.useMemo(()=>t.dependent?Object.assign({},HP(t)):!1,[]),a=nE(c=>{!t.dependent||!l||Object.keys(l).includes(c)&&e()},"maybeUpdateProps"),o=wp.element.useCallback(c=>{c.props?.itemType!=="subfield"&&a(c.name)},[]);wp.element.useEffect(()=>{const c=sa("valueChange",o);return()=>cm("valueChange",c)},[o]),wp.element.useEffect(()=>{n.watcher&&n.watcher(c=>{a(c)})},[o]);const s=wp.element.useMemo(()=>PL(i,l,n.getValue),[]);return r(s)},"DependendWrapper");var TL=Object.defineProperty,AL=u((t,e)=>TL(t,"name",{value:e,configurable:!0}),"u$d");const iE=AL(t=>{const e=[];if(t.length===0)return!0;for(const n in t){const r=t[n];if(["_and","_or"].includes(n)){const i=r.map(iE);if(i.length===0){e.push(!1);continue}switch(n){case"_or":e.push(i.filter(Boolean).length>0);break;case"_and":e.push(i.length===i.filter(Boolean).length);break}continue}Object.entries(r).forEach(([i,l])=>{switch(i){case"_eq":e.push(n==l);break;case"_neq":e.push(n!=l);break;case"_lt":e.push(nl);break;case"_lte":e.push(n<=l);break;case"_gte":e.push(n>=l);break;case"_in":e.push(l.includes(n));break;case"_nin":e.push(!l.includes(n));break;case"_contains":e.push(n.includes(l));break;case"_ncontains":e.push(!n.includes(l));break;case"_re":e.push(new RegExp(l).test(n));break;default:e.push(!1)}})}return e.length>0&&e.length===e.filter(Boolean).length},"evaluateCondition");var QL=Object.defineProperty,Zd=u((t,e)=>QL(t,"name",{value:e,configurable:!0}),"i$m");const ML=Zd((t,e)=>(t=typeof t=="object"?lE(t,e):{},iE(t)),"evaluateFieldVisibility"),lE=Zd((t,e)=>{const n={};for(const r in t){if(["_and","_or"].includes(r)){n[r]=t[r].map(l=>lE(l,e));continue}const i=r.includes(".")?BL(r,e):e(r);n[i]=t[r]}return n},"replaceFieldValue"),BL=Zd((t,e)=>{const[n,r]=t.split(".");let i=e(n);if(typeof i=="string")try{i=JSON.parse(i)}catch{return""}return i[r]??""},"getPartialValue"),aE=Zd(t=>{const e=[];for(const n in t){if(["_and","_or"].includes(n)){for(const r in t[n])e.push(aE(t[n][r]));continue}e.push(n)}return e.flat().map(n=>n.split(".")[0])},"getTriggerFields");var RL=Object.defineProperty,oE=u((t,e)=>RL(t,"name",{value:e,configurable:!0}),"o$d");const sE=oE(({visibility:t,data:e,...n})=>{const[r,i]=wp.element.useState(!1),l=oE(()=>{if(!t.condition){i(!0);return}const o=e.getValue??control.getValue,s=ML(t.condition,o);i(t.action!=="hide"?s:!s)},"evaluateVisibility");wp.element.useEffect(()=>{l(),!(!t.condition||!a)&&(sa("valueChange",o=>{o.props?.itemType!=="subfield"&&a.includes(o.name)&&setTimeout(l)}),e.watcher&&e.watcher(o=>{a.includes(o)&&l()}),sa("evaluateVisibility",()=>l()))},[]);const a=wp.element.useMemo(()=>t.condition?aE(t.condition):!1,[]);return r?n.children:wp.element.createElement(wp.element.Fragment,null)},"VisibilityWrapper");var VL=Object.defineProperty,Xd=u((t,e)=>VL(t,"name",{value:e,configurable:!0}),"r$a");const uE=Xd(({children:t,itemType:e,setValue:n=!1,name:r})=>{const[i,l]=wp.element.useState(0),a=Xd(()=>l(i+1),"refreshRender"),o=Xd(c=>{!r||r!==c.name||(a(),n&&n(c.value))},"fieldValueChanged"),s=Xd(c=>{c===r&&a()},"maybeRerender");return wp.element.useEffect(()=>{if(e!=="field")return;const c=sa("_refreshFieldValue",o),d=sa("_fieldRerender",s);return()=>{cm("_refreshFieldValue",c),cm("_fieldRerender",d)}},[i]),wp.element.createElement(wp.element.Fragment,{key:i},t(a))},"RenderWrapper");var NL=Object.defineProperty,FL=u((t,e)=>NL(t,"name",{value:e,configurable:!0}),"i$l");const $0=FL(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Zl),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class,wp.element.useEffect(()=>{n&&n()},[]);const a=Hr.get(r.type??!1,"element");return a?wp.element.createElement(pk,{...l},wp.element.createElement(sE,{visibility:t,data:e},wp.element.createElement(uE,{itemType:r.itemType??"field",name:r.name??!1},o=>wp.element.createElement(rE,{refresh:o,data:e,itemProps:r},s=>wp.element.createElement(a,{...s,data:e}))))):wp.element.createElement(wp.element.Fragment,null)},"Element");var IL=Object.defineProperty,LL=u((t,e)=>IL(t,"name",{value:e,configurable:!0}),"n$i");const zL=LL(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?$0:hp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...a,...t})},"Item");var cE={common:{add:"Add item",clone:"Clone",delete:"Remove"},layoutOveride:{advanced:{clone:"Duplicate",delete:"Delete"},tab:{add:"+ Add Item"}}},ZL=Object.defineProperty,Vr=u((t,e)=>ZL(t,"name",{value:e,configurable:!0}),"l$b");const dE=Vr(t=>{const e=t.fields??[],n=t.layout&&Object.keys(Hr._types.repeater).includes(t.layout)?t.layout:"table",r=Hr.get(n,"repeater"),i=t.repeatable??!0,l=t.maxlength??1/0,a=e.map(S=>{const x=Object.assign({},S);return n==="table"?(x.labelVisuallyHidden=!0,x.descriptionVisuallyHidden=!0):n==="tab"&&(x.labelVisuallyHidden=!0),delete x.value,delete x.onChange,x}),o={};e.forEach(S=>{o[S.name]=t.newItem?t.newItem[S.name]??"":""});const[s,c]=wp.element.useReducer(K2(o,l,t),t.value??"",S=>U2(S,o)),d=Vr(S=>a.map(x=>x.name??!1).includes(S),"hasField"),[f,h]=wp.element.useState([]),p=Vr((S,x)=>{f.forEach(C=>C(S,x))},"triggerRowCallbackEvents"),m=wp.element.useRef();m.current=s;const g=Vr((S,x,C)=>wp.element.createElement(zL,{key:x.key+C,values:x,config:{...S,repeaterRow:C},onChange:Q=>c({type:"update",item:C,control:S.name,value:Q,callback:()=>p(x.key,S.name)}),data:{getValue:Q=>d(Q)?m.current[C][Q]??"":t.data.getValue(Q??""),watcher:Q=>h(T=>[...T,(B,w)=>{B===x.key&&S.name&&Q(w,x.key)}])}}),"renderItem"),O=Vr(()=>s.map(({_bulkCheckbox:S,...x})=>x),"getSavedValue"),b=Vr(S=>({...cE.common,...cE.layoutOveride[n]??{},...t.strings??{}})[S]??S,"string"),y=Vr(()=>i&&wp.element.createElement("div",{className:"tf-repeater-actions"},wp.element.createElement(se,{type:"action",onPress:()=>c({type:"add"}),isDisabled:l<=s.length},b("add")),wp.element.createElement($s,{title:"Confirmation",label:"Remove all",isDisabled:s.length<=0,onValidate:()=>c({type:"clear"})},"Are you sure you want to clear all item(s)?")),"renderFooterActions"),$=Vr((S,x,C)=>{const Q=typeof t.parts.actions[S]=="string"?Hr.get(t.parts.actions[S],"element"):t.parts.actions[S];return wp.element.createElement(Q,{dispatch:c,item:x,items:s,...C})},"renderCustomComponent"),v=Vr((S,x,C={})=>{if(!i)return wp.element.createElement(wp.element.Fragment,null);if(t?.parts?.actions?.[S])return $(S,x,C);switch(S){case"delete":return wp.element.createElement($s,{label:b("delete"),title:"Confirmation",onValidate:()=>c({type:"remove",item:x}),buttonProps:{type:"danger"},...C},"Are you sure you want to remove item ",x+1,"?");case"clone":return wp.element.createElement(se,{type:"action",isDisabled:l<=s.length,onPress:()=>c({type:"clone",item:s[x]}),...C},b("clone"))}},"renderAction");return wp.element.useEffect(()=>t.onChange&&t.onChange(O()),[s]),wp.element.createElement("div",{className:`tf-repeater tf-repeater-${n}`},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(O())}),t.label&&wp.element.createElement(zd,{level:2,className:"tf-repeater-title"},t.label),wp.element.createElement("div",{className:`tf-repeater-container tf-repeater-${n}-container`},wp.element.createElement(r,{items:s,fields:e,dispatch:c,rowFields:a,headerFields:t.headerFields,renderItem:g,maxLength:i?l:void 0,title:t.sectionTitle??!1,useSwitch:t.useSwitch,useBulk:t.useBulk,afterRow:t.afterRow,beforeRow:t.beforeRow,name:t.name??"",renderFooterActions:y,renderAction:v,parent:t,string:b})))},"Repeater");var XL=Object.defineProperty,fE=u((t,e)=>XL(t,"name",{value:e,configurable:!0}),"o$c");const jL={_eq:"Is",_neq:"Is not",_lt:"Less than",_gt:"Greater than",_lte:"Less than or equal",_gte:"Greater than or equal",_in:"In array",_nin:"Not in array",_contains:"Contains",_ncontains:"Not contain",_re:"Regex"},hE=fE(t=>{const e=t.filter(n=>n.name==="operator")[0]??!1;return!e||typeof e.choices!="object"?"":Object.keys(e.choices)[0]??""},"getInitialOperator"),qL=fE(({dynamic:t,operators:e=void 0,fields:n=void 0})=>n&&n.length>0?n:[{label:"Text",type:"text",name:"left_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0},{label:"Operator",type:"select",name:"operator",choices:e??jL,labelVisuallyHidden:!0},{label:"Text",type:"text",name:"right_value",dynamic:t?{mode:t.getMode(),types:t.getTypes(),categories:t.getCategories()}:{mode:"replace"},labelVisuallyHidden:!0}],"getFields");var WL=Object.defineProperty,pE=u((t,e)=>WL(t,"name",{value:e,configurable:!0}),"e$2");const YL=pE(t=>wp.element.createElement("div",{className:"tf-conditional-panel-conditions"},wp.element.createElement(dE,{...t,type:"repeater",layout:"bare",afterRow:pE((e,n,r)=>wp.element.createElement("div",{className:"tf-conditional-panel-condition-actions"},wp.element.createElement(se,{type:"action",onPress:()=>r({type:"insert",position:n+1,data:{operator:hE(t.fields)}})},"And"),wp.element.createElement(se,{type:"danger",onPress:()=>r({type:"remove",item:n}),isDisabled:!t.canDelete,contentVisuallyHidden:!0},"Delete condition")),"afterRow"),repeatable:!1})),"ConditionGroup");var KL=Object.defineProperty,ws=u((t,e)=>KL(t,"name",{value:e,configurable:!0}),"i$j");const UL=ws(t=>{const e=wp.element.useMemo(()=>qL(t),[]),n=ws(()=>({key:fi(),data:[{key:fi(),operator:hE(e)}]}),"emptyRow"),r=ws(()=>On(t.value??"",[n()]),"initialValue"),[i,l]=wp.element.useState(r()),[a,o]=wp.element.useState(r());wp.element.useEffect(()=>{t.onChange&&t.onChange(t.useModal?i:a)},[t.useModal?i:a]),wp.element.useEffect(()=>{if(a.length===1)return;const h=a.filter(p=>p.data.length!==0);h.length!==a.length&&o([...h])},[a]);const s=ws(h=>o([...a.slice(0,h),n(),...a.slice(h)]),"insertGroup"),c=ws((h,p)=>{const m=a;m[p].data=h,o([...m])},"updateGroup"),d=t.useModal?$s:wp.element.Fragment,f=t.useModal?{title:"Conditional rules",label:"Open conditional panel",confirmText:"Save",onCancel:()=>{o([...c0(i)])},onValidate:()=>{l([...c0(a)])}}:{};return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(t.useModal?i:a)}),wp.element.createElement("div",{className:"tf-label"},t.label??""),wp.element.createElement(d,{...f},wp.element.createElement("div",{className:"tf-conditional-panel"},wp.element.createElement("div",{className:"tf-conditional-panel-container"},wp.element.createElement("div",{className:"tf-conditional-groups"},a.map((h,p)=>wp.element.createElement("div",{key:h.key,className:"tf-conditional-group"},wp.element.createElement(YL,{canDelete:a.length!==1||h.data.length!==1,value:h.data,onChange:m=>c(m,p),fields:e}),wp.element.createElement("div",{className:"tf-conditional-group-actions"},wp.element.createElement("strong",null,"Or"),wp.element.createElement(se,{type:"primary",onPress:()=>s(p+1)},"Add group")))))))))},"ConditionalPanel");var GL=Object.defineProperty,mE=u((t,e)=>GL(t,"name",{value:e,configurable:!0}),"t$a");const _L=mE(t=>{const[e,n]=wp.element.useState(On(t.value));wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=mE(l=>{n({...e,enabled:l===!0||l==="on"?"on":"off"})},"isEnabled"),i=t.useSwitch?wp.element.createElement("div",{onClick:l=>l.stopPropagation()},wp.element.createElement(K1,{value:e.enabled??"off",onChange:r,label:"Toggle accordion",labelVisuallyHidden:!0})):null;return wp.element.createElement("div",{className:"tf-accordion"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(e)}),wp.element.createElement(_2,{title:t.title??!1,headerLeft:i,behavior:"show",isOpen:t.isOpen??!1},wp.element.createElement(Y1,{...t,name:null,fields:t.fields,value:e,onChange:n})))},"Accordion");var HL=Object.defineProperty,JL=u((t,e)=>HL(t,"name",{value:e,configurable:!0}),"t$9");const gE=wp.element.createContext(null),OE=JL(t=>{const e=KP(t),{radioGroupProps:n,labelProps:r,descriptionProps:i}=z2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-radio-group"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("div",{className:"tf-radio-group-container",...n},wp.element.createElement(gE.Provider,{value:e},t.children)),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"RadioGroup");var ez=Object.defineProperty,tz=u((t,e)=>ez(t,"name",{value:e,configurable:!0}),"r$7");const bE=tz(t=>{const e=wp.element.useContext(gE),n=wp.element.useRef(null),{inputProps:r}=L2(t,e,n);return wp.element.createElement("label",{className:"tf-radio"},wp.element.createElement("input",{...r,ref:n}),t.children)},"Radio");var nz=Object.defineProperty,rz=u((t,e)=>nz(t,"name",{value:e,configurable:!0}),"i$h");const iz=rz(t=>{const[e,n]=wp.element.useState(t.value??""),r=["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"];return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement("div",{className:"tf-alignment-matrix"},wp.element.createElement(OE,{...t,onChange:n},wp.element.createElement("div",{className:"tf-alignment-matrix-container"},r.map(i=>wp.element.createElement(bE,{key:i,id:i,value:i},wp.element.createElement(gn,null,i))))))},"AlignmentMatrix");var lz=Object.defineProperty,xs=u((t,e)=>lz(t,"name",{value:e,configurable:!0}),"a$a");const yE=xs(t=>{if(t.config===!1)return t.children;const{dynamics:e}=Zn(),n=wp.element.useRef(),r=wp.element.useRef(),[i,l]=wp.element.useState(!1),[a,o]=wp.element.useState(!1),[s,c]=wp.element.useState({}),[d,f]=wp.element.useState(!1),h=pi({}),{triggerProps:p,overlayProps:m}=us({type:"dialog"},h,n);wp.element.useEffect(()=>{t.isOpen?h.open():h.close()},[t.isOpen]),wp.element.useEffect(()=>{d!==!1&&(t?.onValueSelection(d),f(!1))},[d]);const g=xs(T=>{if(!T)return;const B=e.values[T]?.fields;if(l(T),!Array.isArray(B)||B.length===0)return O(T);o(B)},"saveDynamicValue"),O=xs(T=>{f(t.config.stringify(T,s??!1)),b()},"selectAndClose"),b=xs(()=>{l(!1),o(!1),c(!1),h.close()},"resetAndClose"),y=wp.element.useMemo(()=>{const T=t.config.getTypes();return t.config.getCategories().map(B=>{const w=e.categories[B],M=Object.keys(e.values).filter(A=>w.values.includes(A)&&T.includes(e.values[A]?.type)).reduce((A,E)=>({...A,[E]:e.values[E].label??E}),{});return{name:w.label,choices:M}}).filter(B=>Object.keys(B.choices).length!==0)},[]),$=wp.element.useRef(s),v=xs((T,B)=>{c($.current={...s,[T]:B})},"updateSettings"),S=t.buttonType??"outside",x=!(t.readOnly||t.inputMasking)&&(S==="outside"||!t.remove||t.remove.isDisabled),C=!(t.readOnly||t.inputMasking)&&(S==="outside"||t.remove&&t.remove.isDisabled===!1),Q=`tf-dynamic-wrapper tf-dynamic-wrapper-buttons-${S} ${t.className??""}`;return wp.element.createElement("div",{className:Q,"data-dynamic":"true"},t.children,x&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-insert",ref:n,contentVisuallyHidden:S==="inside",...p},"Insert"),C&&wp.element.createElement(se,{type:S==="outside"?"action":"icon",className:"tf-dynamic-wrapper-clear",contentVisuallyHidden:S==="inside",...t.remove},"Clear"),h.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover",ref:r,...m},a?wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-form"},wp.element.createElement(zd,{level:4},"Dynamic value settings"),e.values[i].description&&wp.element.createElement("i",null,e.values[i].description),a.map(T=>wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-field"},wp.element.createElement(hp,{...T,value:s[T.name]??"",onChange:B=>v(T.name,B),visibility:{condition:T.condition?.condition??!1,action:T.condition?.action??"show"},data:{getValue:B=>$.current[B]??""}}))),wp.element.createElement("div",{className:"tf-dynamic-wrapper-popover-buttons"},wp.element.createElement(se,{type:"action",onPress:()=>O(i)},"Add"),wp.element.createElement(se,{type:"action",onPress:b},"Close"))):wp.element.createElement(xh,{choices:y,label:"Select dynamic value to insert",labelVisuallyHidden:!0,autoFocus:!0,showButton:!1,onChange:g,onFocusChange:T=>T?!h.isOpen&&h.open():h.close()}),wp.element.createElement(ds,{onDismiss:h.close})))},"BaseWrapper");var az=Object.defineProperty,oz=u((t,e)=>az(t,"name",{value:e,configurable:!0}),"u$a");const Ss=wp.element.forwardRef(({inputProps:t={},...e},n)=>{const[r,i]=wp.element.useState(e.dynamic?e.dynamic.hasValues():!1),l=oz(a=>{const o=e.dynamic.parse(a);return o&&o.type?e.dynamic.getLabel(o.type):""},"getLabel");return wp.element.createElement(yE,{className:"tf-dynamic-field-wrapper",config:e.dynamic??!1,onValueSelection:a=>{i(!0),e.onValueSelection(a)},remove:{isDisabled:r===!1,onPress:()=>{i(!1),e.onValueRemove&&e.onValueRemove()}},buttonType:e.buttonType??"outside",readOnly:e.readOnly??!1},r?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"text",className:"tf-dynamic-value-input",value:l(e.value),disabled:!0}),wp.element.createElement("input",{...t,name:e.name??"",value:e.value??"",type:"hidden",ref:n})):e.children)});let w0=[],vE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=vE[r])e=r+1;else return!0;if(e==n)return!1}}u(sz,"isExtendingChar");function $E(t){return t>=127462&&t<=127487}u($E,"isRegionalIndicator");const wE=8205;function uz(t,e,n=!0,r=!0){return(n?xE:cz)(t,e,r)}u(uz,"findClusterBreak$1");function xE(t,e,n){if(e==t.length)return e;e&&SE(t.charCodeAt(e))&&CE(t.charCodeAt(e-1))&&e--;let r=x0(t,e);for(e+=kE(r);e=0&&$E(x0(t,a));)l++,a-=2;if(l%2==0)break;e+=2}else break}return e}u(xE,"nextClusterBreak");function cz(t,e,n){for(;e>0;){let r=xE(t,e-2,n);if(r=56320&&t<57344}u(SE,"surrogateLow$1");function CE(t){return t>=55296&&t<56320}u(CE,"surrogateHigh$1");function kE(t){return t<65536?1:2}u(kE,"codePointSize$1");const yp=class yp{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Ba(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),jd.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ba(this,e,n);let r=[];return this.decompose(e,n,r,0),jd.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new sl(this),l=new sl(e);for(let a=n,o=n;;){if(i.next(a),l.next(a),a=0,i.lineBreak!=l.lineBreak||i.done!=l.done||i.value!=l.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new sl(this,e)}iterRange(e,n=this.length){return new Wd(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Yd(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?yp.empty:e.length<=32?new Kt(e):jd.from(Kt.split(e,[]))}};u(yp,"Text");let pe=yp;const Dn=class Dn extends pe{constructor(e,n=dz(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let l=0;;l++){let a=this.text[l],o=i+a.length;if((n?r:o)>=e)return new S0(i,o,r,a);i=o+1,r++}}decompose(e,n,r,i){let l=e<=0&&n>=this.length?this:new Dn(DE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=qd(l.text,a.text.slice(),0,l.length);if(o.length<=32)r.push(new Dn(o,a.length+l.length));else{let s=o.length>>1;r.push(new Dn(o.slice(0,s)),new Dn(o.slice(s)))}}else r.push(l)}replace(e,n,r){if(!(r instanceof Dn))return super.replace(e,n,r);[e,n]=Ba(this,e,n);let i=qd(this.text,qd(r.text,DE(this.text,0,e)),n),l=this.length+r.length-(n-e);return i.length<=32?new Dn(i,l):jd.from(Dn.split(i,[]),l)}sliceString(e,n=this.length,r=` `){[e,n]=Ba(this,e,n);let i="";for(let l=0,a=0;l<=n&&ae&&a&&(i+=r),el&&(i+=o.slice(Math.max(0,e-l),n-l)),l=s+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let l of e)r.push(l),i+=l.length+1,r.length==32&&(n.push(new Dn(r,i)),r=[],i=-1);return i>-1&&n.push(new Dn(r,i)),n}};u(Dn,"TextLeaf");let Kt=Dn,jd=(mr=class extends pe{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let l=0;;l++){let a=this.children[l],o=i+a.length,s=r+a.lines-1;if((n?s:o)>=e)return a.lineInner(e,n,r,i);i=o+1,r=s+1}}decompose(e,n,r,i){for(let l=0,a=0;a<=n&&l=a){let c=i&((a<=e?1:0)|(s>=n?2:0));a>=e&&s<=n&&!c?r.push(o):o.decompose(e-a,n-a,r,c)}a=s+1}}replace(e,n,r){if([e,n]=Ba(this,e,n),r.lines=l&&n<=o){let s=a.replace(e-l,n-l,r),c=this.lines-a.lines+s.lines;if(s.lines>4&&s.lines>c>>6){let d=this.children.slice();return d[i]=s,new mr(d,this.length-(n-e)+r.length)}return super.replace(l,o,s)}l=o+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` `){[e,n]=Ba(this,e,n);let i="";for(let l=0,a=0;le&&l&&(i+=r),ea&&(i+=o.sliceString(e-a,n-a,r)),a=s+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof mr))return 0;let r=0,[i,l,a,o]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,l+=n){if(i==a||l==o)return r;let s=this.children[i],c=e.children[l];if(s!=c)return r+s.scanIdentical(c,n);r+=s.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let p of e)r+=p.lines;if(r<32){let p=[];for(let m of e)m.flatten(p);return new Kt(p,n)}let i=Math.max(32,r>>5),l=i<<1,a=i>>1,o=[],s=0,c=-1,d=[];function f(p){let m;if(p.lines>l&&p instanceof mr)for(let g of p.children)f(g);else p.lines>a&&(s>a||!s)?(h(),o.push(p)):p instanceof Kt&&s&&(m=d[d.length-1])instanceof Kt&&p.lines+m.lines<=32?(s+=p.lines,c+=p.length+1,d[d.length-1]=new Kt(m.text.concat(p.text),m.length+1+p.length)):(s+p.lines>i&&h(),s+=p.lines,c+=p.length+1,d.push(p))}u(f,"add");function h(){s!=0&&(o.push(d.length==1?d[0]:mr.from(d,c)),c=-1,s=d.length=0)}u(h,"flush");for(let p of e)f(p);return h(),o.length==1?o[0]:new mr(o,n)}},u(mr,"TextNode"),mr);pe.empty=new Kt([""],0);function dz(t){let e=-1;for(let n of t)e+=n.length+1;return e}u(dz,"textLength");function qd(t,e,n=0,r=1e9){for(let i=0,l=0,a=!0;l=n&&(s>r&&(o=o.slice(0,r-i)),i0?1:(e instanceof Kt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],l=this.offsets[r],a=l>>1,o=i instanceof Kt?i.text.length:i.children.length;if(a==(n>0?o:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((l&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof Kt){let s=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,s.length>Math.max(0,e))return this.value=e==0?s:n>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{let s=i.children[a+(n<0?-1:0)];e>s.length?(e-=s.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(s),this.offsets.push(n>0?1:(s instanceof Kt?s.text.length:s.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}};u(Cv,"RawTextCursor");let sl=Cv;const kv=class kv{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new sl(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}};u(kv,"PartialTextCursor");let Wd=kv;const Dv=class Dv{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}};u(Dv,"LineCursor");let Yd=Dv;typeof Symbol<"u"&&(pe.prototype[Symbol.iterator]=function(){return this.iter()},sl.prototype[Symbol.iterator]=Wd.prototype[Symbol.iterator]=Yd.prototype[Symbol.iterator]=function(){return this});const Pv=class Pv{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};u(Pv,"Line");let S0=Pv;function Ba(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}u(Ba,"clip");function wt(t,e,n=!0,r=!0){return uz(t,e,n,r)}u(wt,"findClusterBreak");function fz(t){return t>=56320&&t<57344}u(fz,"surrogateLow");function hz(t){return t>=55296&&t<56320}u(hz,"surrogateHigh");function Ft(t,e){let n=t.charCodeAt(e);if(!hz(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return fz(r)?(n-55296<<10)+(r-56320)+65536:n}u(Ft,"codePointAt");function C0(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}u(C0,"fromCodePoint");function Gn(t){return t<65536?1:2}u(Gn,"codePointSize");const k0=/\r\n?|\n/;var ct=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(ct||(ct={}));const wo=class wo{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return l+(e-i);l+=o}else{if(r!=ct.Simple&&c>=e&&(r==ct.TrackDel&&ie||r==ct.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!o)return e==i||n<0?l:l+s;l+=s}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return l}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&o>=e)return in?"cover":!0;i=o}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new wo(e)}static create(e){return new wo(e)}};u(wo,"ChangeDesc");let gi=wo;const gr=class gr extends gi{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return D0(this,(n,r,i,l,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return P0(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,l=0;i=0){n[i]=o,n[i+1]=a;let s=i>>1;for(;r.length0&&Oi(r,n,l.text),l.forward(d),o+=d}let c=e[a++];for(;o>1].toJSON()))}return e}static of(e,n,r){let i=[],l=[],a=0,o=null;function s(d=!1){if(!d&&!i.length)return;ah||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let m=p?typeof p=="string"?pe.of(p.split(r||k0)):p:pe.empty,g=m.length;if(f==h&&g==0)return;fa&&dt(i,f-a,-1),dt(i,h-f,g),Oi(l,i,m),a=h}}return u(c,"process"),c(e),s(!o),o}static empty(e){return new gr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;io&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(l.length==1)n.push(l[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}u(dt,"addSection");function Oi(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)o=t.sections[a++],s=t.sections[a++];e(i,c,l,d,f),i=c,l=d}}}u(D0,"iterChanges");function P0(t,e,n,r=!1){let i=[],l=r?[]:null,a=new ul(t),o=new ul(e);for(let s=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let c=Math.min(a.len,o.len);dt(i,c,-1),a.forward(c),o.forward(c)}else if(o.ins>=0&&(a.ins<0||s==a.i||a.off==0&&(o.len=0&&s=0){let c=0,d=a.len;for(;d;)if(o.ins==-1){let f=Math.min(d,o.len);c+=f,d-=f,o.forward(f)}else if(o.ins==0&&o.lens||a.ins>=0&&a.len>s)&&(o||r.length>c),l.forward2(s),a.forward(s)}}}}u(PE,"composeSets");const Ev=class Ev{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?pe.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?pe.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}};u(Ev,"SectionIter");let ul=Ev,Kd=(Xl=class{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Xl(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return X.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return X.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return X.range(e.anchor,e.head)}static create(e,n,r){return new Xl(e,n,r)}},u(Xl,"SelectionRange"),Xl);const Qt=class Qt{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Qt.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Qt(e.ranges.map(n=>Kd.fromJSON(n)),e.main)}static single(e,n=e){return new Qt([Qt.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|l)}static normalized(e,n=0){let r=e[n];e.sort((i,l)=>i.from-l.from),n=e.indexOf(r);for(let i=1;il.head?Qt.range(s,o):Qt.range(o,s))}}return new Qt(e,n)}};u(Qt,"EditorSelection");let X=Qt;function EE(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}u(EE,"checkSelection");let E0=0;const vp=class vp{constructor(e,n,r,i,l){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=E0++,this.default=e([]),this.extensions=typeof l=="function"?l(this):l}get reader(){return this}static define(e={}){return new vp(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:T0),!!e.static,e.enables)}of(e){return new Ra([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ra(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ra(e,this,2,n)}from(e,n){return n||(n=u(r=>r,"get")),this.compute([e],r=>n(r.field(e)))}};u(vp,"Facet");let _=vp;function T0(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}u(T0,"sameArray$1");const Tv=class Tv{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=E0++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,l=this.id,a=e[l]>>1,o=this.type==2,s=!1,c=!1,d=[];for(let f of this.dependencies)f=="doc"?s=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||d.push(e[f.id]);return{create(f){return f.values[a]=r(f),1},update(f,h){if(s&&h.docChanged||c&&(h.docChanged||h.selection)||A0(f,d)){let p=r(f);if(o?!TE(p,f.values[a],i):!i(p,f.values[a]))return f.values[a]=p,1}return 0},reconfigure:(f,h)=>{let p,m=h.config.address[l];if(m!=null){let g=Hd(h,m);if(this.dependencies.every(O=>O instanceof _?h.facet(O)===f.facet(O):O instanceof Gt?h.field(O,!1)==f.field(O,!1):!0)||(o?TE(p=r(f),g,i):i(p=r(f),g)))return f.values[a]=g,0}else p=r(f);return f.values[a]=p,1}}}};u(Tv,"FacetProvider");let Ra=Tv;function TE(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[s.id]),i=n.map(s=>s.type),l=r.filter(s=>!(s&1)),a=t[e.id]>>1;function o(s){let c=[];for(let d=0;dr===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Ud).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let l=r.values[n],a=this.updateF(l,i);return this.compareF(l,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let l=r.facet(Ud),a=i.facet(Ud),o;return(o=l.find(s=>s.field==this))&&o!=a.find(s=>s.field==this)?(r.values[n]=o.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Ud.of({field:this,create:e})]}get extension(){return this}};u($p,"StateField");let Gt=$p;const cl={lowest:4,low:3,default:2,high:1,highest:0};function Cs(t){return e=>new Gd(e,t)}u(Cs,"prec");const dl={highest:Cs(cl.highest),high:Cs(cl.high),default:Cs(cl.default),low:Cs(cl.low),lowest:Cs(cl.lowest)},Av=class Av{constructor(e,n){this.inner=e,this.prec=n}};u(Av,"PrecExtension");let Gd=Av;const xp=class xp{of(e){return new ks(this,e)}reconfigure(e){return xp.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}};u(xp,"Compartment");let _d=xp;const Qv=class Qv{constructor(e,n){this.compartment=e,this.inner=n}};u(Qv,"CompartmentInstance");let ks=Qv,AE=(xo=class{constructor(e,n,r,i,l,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=l,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],l=Object.create(null),a=new Map;for(let h of mz(e,n,a))h instanceof Gt?i.push(h):(l[h.facet.id]||(l[h.facet.id]=[])).push(h);let o=Object.create(null),s=[],c=[];for(let h of i)o[h.id]=c.length<<1,c.push(p=>h.slot(p));let d=r?.config.facets;for(let h in l){let p=l[h],m=p[0].facet,g=d&&d[h]||[];if(p.every(O=>O.type==0))if(o[m.id]=s.length<<1|1,T0(g,p))s.push(r.facet(m));else{let O=m.combine(p.map(b=>b.value));s.push(r&&m.compare(O,r.facet(m))?r.facet(m):O)}else{for(let O of p)O.type==0?(o[O.id]=s.length<<1|1,s.push(O.value)):(o[O.id]=c.length<<1,c.push(b=>O.dynamicSlot(b)));o[m.id]=c.length<<1,c.push(O=>pz(O,m,p))}}let f=c.map(h=>h(o));return new xo(e,a,f,o,s,l)}},u(xo,"Configuration"),xo);function mz(t,e,n){let r=[[],[],[],[],[]],i=new Map;function l(a,o){let s=i.get(a);if(s!=null){if(s<=o)return;let c=r[s].indexOf(a);c>-1&&r[s].splice(c,1),a instanceof ks&&n.delete(a.compartment)}if(i.set(a,o),Array.isArray(a))for(let c of a)l(c,o);else if(a instanceof ks){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(a.compartment)||a.inner;n.set(a.compartment,c),l(c,o)}else if(a instanceof Gd)l(a.inner,a.prec);else if(a instanceof Gt)r[o].push(a),a.provides&&l(a.provides,o);else if(a instanceof Ra)r[o].push(a),a.facet.extensions&&l(a.facet.extensions,cl.default);else{let c=a.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);l(c,o)}}return u(l,"inner"),l(t,cl.default),r.reduce((a,o)=>a.concat(o))}u(mz,"flatten");function Ds(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}u(Ds,"ensureAddr");function Hd(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}u(Hd,"getAddr");const QE=_.define(),Q0=_.define({combine:t=>t.some(e=>e),static:!0}),ME=_.define({combine:t=>t.length?t[0]:void 0,static:!0}),BE=_.define(),RE=_.define(),VE=_.define(),NE=_.define({combine:t=>t.length?t[0]:!1}),Mv=class Mv{constructor(e,n){this.type=e,this.value=n}static define(){return new M0}};u(Mv,"Annotation");let Tn=Mv;const Bv=class Bv{of(e){return new Tn(this,e)}};u(Bv,"AnnotationType");let M0=Bv;const Rv=class Rv{constructor(e){this.map=e}of(e){return new Oe(this,e)}};u(Rv,"StateEffectType");let B0=Rv;const Sp=class Sp{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Sp(this.type,n)}is(e){return this.type==e}static define(e={}){return new B0(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let l=i.map(n);l&&r.push(l)}return r}};u(Sp,"StateEffect");let Oe=Sp;Oe.reconfigure=Oe.define(),Oe.appendConfig=Oe.define();let xt=(Jr=class{constructor(e,n,r,i,l,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=l,this.scrollIntoView=a,this._doc=null,this._state=null,r&&EE(r,n.newLength),l.some(o=>o.type==Jr.time)||(this.annotations=l.concat(Jr.time.of(Date.now())))}static create(e,n,r,i,l,a){return new Jr(e,n,r,i,l,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Jr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}},u(Jr,"Transaction"),Jr);xt.time=Tn.define(),xt.userEvent=Tn.define(),xt.addToHistory=Tn.define(),xt.remote=Tn.define();function gz(t,e){let n=[];for(let r=0,i=0;;){let l,a;if(r=t[r]))l=t[r++],a=t[r++];else if(i=0;i--){let l=r[i](t);l instanceof xt?t=l:Array.isArray(l)&&l.length==1&&l[0]instanceof xt?t=l[0]:t=IE(e,Va(l),!1)}return t}u(Oz,"filterTransaction");function bz(t){let e=t.startState,n=e.facet(VE),r=t;for(let i=n.length-1;i>=0;i--){let l=n[i](t);l&&Object.keys(l).length&&(r=FE(r,R0(e,l,t.changes.newLength),!0))}return r==t?t:xt.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}u(bz,"extendTransaction");const yz=[];function Va(t){return t==null?yz:Array.isArray(t)?t:[t]}u(Va,"asArray$1");var ft=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(ft||(ft={}));const vz=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let V0;try{V0=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $z(t){if(V0)return V0.test(t);for(let e=0;e"\x80"&&(n.toUpperCase()!=n.toLowerCase()||vz.test(n)))return!0}return!1}u($z,"hasWordChar");function wz(t){return e=>{if(!/\S/.test(e))return ft.Space;if($z(e))return ft.Word;for(let n=0;n-1)return ft.Word;return ft.Other}}u(wz,"makeCategorizer");let Xe=(Mt=class{constructor(e,n,r,i,l,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=l,a&&(a._state=this);for(let o=0;oi.set(c,s)),n=null),i.set(o.value.compartment,o.value.extension)):o.is(Oe.reconfigure)?(n=null,r=o.value):o.is(Oe.appendConfig)&&(n=null,r=Va(r).concat(o.value));let l;n?l=e.startState.values.slice():(n=AE.resolve(r,i,this),l=new Mt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(s,c)=>c.reconfigure(s,this),null).values);let a=e.startState.facet(Q0)?e.newSelection:e.newSelection.asSingle();new Mt(n,e.newDoc,a,l,(o,s)=>s.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:X.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),l=[r.range],a=Va(r.effects);for(let o=1;oa.spec.fromJSON(o,s)))}}return Mt.create({doc:e.doc,selection:X.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=AE.resolve(e.extensions||[],new Map),r=e.doc instanceof pe?e.doc:pe.of((e.doc||"").split(n.staticFacet(Mt.lineSeparator)||k0)),i=e.selection?e.selection instanceof X?e.selection:X.single(e.selection.anchor,e.selection.head):X.single(0);return EE(i,r.length),n.staticFacet(Q0)||(i=i.asSingle()),new Mt(n,r,i,n.dynamicSlots.map(()=>null),(l,a)=>a.create(l),null)}get tabSize(){return this.facet(Mt.tabSize)}get lineBreak(){return this.facet(Mt.lineSeparator)||` @@ -19,7 +19,7 @@ var Mne=Object.defineProperty;var u=(am,Fc)=>Mne(am,"name",{value:Fc,configurabl `,i=t.state.doc.line(i.number+(n?1:-1)),l=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(s){if(!s(d))return o}else{if(!r)return c;s=r(d)}o=c}}u(z6,"moveByChar");function aZ(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return l=>{let a=r(l);return i==ft.Space&&(i=a),i==a}}u(aZ,"byGroup");function oZ(t,e,n,r){let i=e.head,l=n?1:-1;if(i==(n?t.state.doc.length:0))return X.cursor(i,e.assoc);let a=e.goalColumn,o,s=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),d=t.documentTop;if(c)a==null&&(a=c.left-s.left),o=l<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(s.right-s.left,t.defaultCharacterWidth*(i-p.from))),o=(l<0?p.top:p.bottom)+d}let f=s.left+a,h=r??t.viewState.heightOracle.textHeight>>1;for(let p=0;;p+=10){let m=o+(h+p)*l,g=F6(t,{x:f,y:m},!1,l);if(ms.bottom||(l<0?gi)){let O=t.docView.coordsForChar(g),b=!O||m{if(e>l&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:X.cursor(r,rl)&&!uZ(a,n)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let l=-1,a=1,o;if(this.lineSeparator?(l=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(o=i.exec(n))&&(l=o.index,a=o[0].length),this.append(n.slice(r,l<0?n.length:l)),l<0)break;if(this.lineBreak(),a>1)for(let s of this.points)s.node==e&&s.pos>this.text.length&&(s.pos-=a-1);r=l+a}}readNode(e){if(e.cmIgnore)return;let n=Se.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(sZ(e,r.node,r.offset)?n:0))}};u(Kv,"DOMReader");let gO=Kv;function sZ(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:l,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let o=l||a?[]:dZ(e),s=new gO(o,e.state);s.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=s.text,this.newSel=fZ(o,this.bounds.from)}else{let o=e.observer.selectionRange,s=l&&l.node==o.focusNode&&l.offset==o.focusOffset||!H0(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),c=a&&a.node==o.anchorNode&&a.offset==o.anchorOffset||!H0(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),d=e.viewport;if((U.ios||U.chrome)&&e.state.selection.main.empty&&s!=c&&(d.from>0||d.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:o}=e.bounds,s=i.from,c=null;(l===8||U.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:U.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` `&&t.lineWrapping&&(r&&(r=X.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:pe.of([" "])}),n)return bO(t,n,r,l);if(r&&!r.main.eq(i)){let a=!1,o="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),o=t.inputState.lastSelectionOrigin,o=="select.pointer"&&(r=Z6(t.state.facet(zs).map(s=>s(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:o}),!0}else return!1}u(X6,"applyDOMChange");function bO(t,e,n,r=-1){if(U.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(U.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ia(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&Ia(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Ia(t.contentDOM,"Delete",46)))return!0;let l=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,o=u(()=>a||(a=cZ(t,e,n)),"defaultInsert");return t.state.facet(x6).some(s=>s(t,e.from,e.to,l,o))||t.dispatch(o()),!0}u(bO,"applyDOMChangeInner");function cZ(t,e,n){let r,i=t.state,l=i.selection.main,a=-1;if(e.from==e.to&&e.froml.to){let s=e.fromf(t)),c,s);e.from==d&&(a=d)}if(a>-1)r={changes:e,selection:X.cursor(e.from+e.insert.length,-1)};else if(e.from>=l.from&&e.to<=l.to&&e.to-e.from>=(l.to-l.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let s=l.frome.to?i.sliceDoc(e.to,l.to):"";r=i.replaceSelection(t.state.toText(s+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let s=i.changes(e),c=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=l.to&&e.to>=l.to-10){let d=t.state.sliceDoc(e.from,e.to),f,h=n&&B6(t,n.main.head);if(h){let g=e.insert.length-(e.to-e.from);f={from:h.from,to:h.to-g}}else f=t.state.doc.lineAt(l.head);let p=l.to-e.to,m=l.to-l.from;r=i.changeByRange(g=>{if(g.from==l.from&&g.to==l.to)return{changes:s,range:c||g.map(s)};let O=g.to-p,b=O-d.length;if(g.to-g.from!=m||t.state.sliceDoc(b,O)!=d||g.to>=f.from&&g.from<=f.to)return{range:g};let y=i.changes({from:b,to:O,insert:e.insert}),$=g.to-l.to;return{changes:y,range:c?X.range(Math.max(0,c.anchor+$),Math.max(0,c.head+$)):g.map(y)}})}else r={changes:s,selection:c&&i.selection.replaceRange(c)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}u(cZ,"applyDefaultInsert");function j6(t,e,n,r){let i=Math.min(t.length,e.length),l=0;for(;l0&&o>0&&t.charCodeAt(a-1)==e.charCodeAt(o-1);)a--,o--;if(r=="end"){let s=Math.max(0,l-Math.min(a,o));n-=a+s-l}if(a=a?l-n:0;l-=s,o=l+(o-a),a=l}else if(o=o?l-n:0;l-=s,a=l+(a-o),o=l}return{from:l,toA:a,toB:o}}u(j6,"findDiff$1");function dZ(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:l}=t.observer.selectionRange;return n&&(e.push(new pf(n,r)),(i!=n||l!=r)&&e.push(new pf(i,l))),e}u(dZ,"selectionPoints");function fZ(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?X.single(n+e,r+e):null}u(fZ,"selectionFromPoints");let hZ=(uc=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,U.safari&&e.contentDOM.addEventListener("input",()=>null),U.gecko&&PZ(e.contentDOM.ownerDocument)}handleEvent(e){!vZ(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=pZ(e),r=this.handlers,i=this.view.contentDOM;for(let l in n)if(l!="scroll"){let a=!n[l].handlers.length,o=r[l];o&&a!=!o.handlers.length&&(i.removeEventListener(l,this.handleEvent),o=null),o||i.addEventListener(l,this.handleEvent,{passive:a})}for(let l in r)l!="scroll"&&!n[l]&&i.removeEventListener(l,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Y6.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),U.android&&U.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return U.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=W6.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||mZ.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:U.safari&&!U.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}},u(uc,"InputState"),uc);function q6(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Ht(n.state,i)}}}u(q6,"bindHandler");function pZ(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}u(n,"record");for(let r of t){let i=r.spec,l=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(l)for(let o in l){let s=l[o];s&&n(o).handlers.push(q6(r.value,s))}if(a)for(let o in a){let s=a[o];s&&n(o).observers.push(q6(r.value,s))}}for(let r in An)n(r).handlers.push(An[r]);for(let r in bn)n(r).observers.push(bn[r]);return e}u(pZ,"computeHandlers");const W6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],mZ="dthko",Y6=[16,17,18,20,91,92,224,225],mf=6;function gf(t){return Math.max(0,t)*.7+8}u(gf,"dragScrollSpeed");function gZ(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}u(gZ,"dist");const _v=class _v{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Pz(e.contentDOM),this.atoms=e.state.facet(zs).map(a=>a(e));let l=e.contentDOM.ownerDocument;l.addEventListener("mousemove",this.move=this.move.bind(this)),l.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Xe.allowMultipleSelections)&&OZ(e,n),this.dragging=yZ(e,n)&&nT(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&gZ(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,l=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:l,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=dO(this.view);e.clientX-s.left<=i+mf?n=-gf(i-e.clientX):e.clientX+s.right>=a-mf&&(n=gf(e.clientX-a)),e.clientY-s.top<=l+mf?r=-gf(l-e.clientY):e.clientY+s.bottom>=o-mf&&(r=gf(e.clientY-o)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=Z6(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};u(_v,"MouseSelection");let yO=_v;function OZ(t,e){let n=t.state.facet(y6);return n.length?n[0](e):U.mac?e.metaKey:e.ctrlKey}u(OZ,"addsSelectionRange");function bZ(t,e){let n=t.state.facet(v6);return n.length?n[0](e):U.mac?!e.altKey:!e.ctrlKey}u(bZ,"dragMovesSelection");function yZ(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Ts(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let l=0;l=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}u(yZ,"isInPrimarySelection");function vZ(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Se.get(n))&&r.ignoreEvent(e))return!1;return!0}u(vZ,"eventBelongsToEditor");const An=Object.create(null),bn=Object.create(null),K6=U.ie&&U.ie_version<15||U.ios&&U.webkit_version<604;function $Z(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),U6(t,n.value)},50)}u($Z,"capturePaste$1");function Of(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}u(Of,"textFilter");function U6(t,e){e=Of(t.state,sO,e);let{state:n}=t,r,i=1,l=n.toText(e),a=l.lines==n.selection.ranges.length;if(vO!=null&&n.selection.ranges.every(s=>s.empty)&&vO==l.toString()){let s=-1;r=n.changeByRange(c=>{let d=n.doc.lineAt(c.from);if(d.from==s)return{range:c};s=d.from;let f=n.toText((a?l.line(i++).text:e)+n.lineBreak);return{changes:{from:d.from,insert:f},range:X.cursor(c.from+f.length)}})}else a?r=n.changeByRange(s=>{let c=l.line(i++);return{changes:{from:s.from,to:s.to,insert:c.text},range:X.cursor(s.from+c.length)}}):r=n.replaceSelection(l);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}u(U6,"doPaste$1"),bn.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},An.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),bn.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},bn.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},An.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet($6))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=SZ(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new yO(t,e,n,r)),r&&t.observer.ignore(()=>{e6(t.contentDOM);let l=t.root.activeElement;l&&!l.contains(t.contentDOM)&&l.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function G6(t,e,n,r){if(r==1)return X.cursor(e,n);if(r==2)return eZ(t.state,e,n);{let i=rt.find(t.docView,e),l=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:l.from,o=i?i.posAtEnd:l.to;return oe>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right,"inside");function wZ(t,e,n,r){let i=rt.find(t.docView,e);if(!i)return 1;let l=e-i.posAtStart;if(l==0)return 1;if(l==i.length)return-1;let a=i.coordsAt(l,-1);if(a&&_6(n,r,a))return-1;let o=i.coordsAt(l,1);return o&&_6(n,r,o)?1:a&&a.bottom>=r?-1:1}u(wZ,"findPositionSide");function H6(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:wZ(t,n,e.clientX,e.clientY)}}u(H6,"queryPos");const xZ=U.ie&&U.ie_version<=11;let J6=null,eT=0,tT=0;function nT(t){if(!xZ)return t.detail;let e=J6,n=tT;return J6=t,tT=Date.now(),eT=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(eT+1)%3:1}u(nT,"getClickType");function SZ(t,e){let n=H6(t,e),r=nT(e),i=t.state.selection;return{update(l){l.docChanged&&(n.pos=l.changes.mapPos(n.pos),i=i.map(l.changes))},get(l,a,o){let s=H6(t,l),c,d=G6(t,s.pos,s.bias,r);if(n.pos!=s.pos&&!a){let f=G6(t,n.pos,n.bias,r),h=Math.min(f.from,d.from),p=Math.max(f.to,d.to);d=h1&&(c=CZ(i,s.pos))?c:o?i.addRange(d):X.create([d])}}}u(SZ,"basicMouseSelection");function CZ(t,e){for(let n=0;n=e)return X.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}u(CZ,"removeRangeAround"),An.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let l=i.posAtStart,a=l+i.length;(l>=n.to||a<=n.from)&&(n=X.range(l,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Of(t.state,uO,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1},An.dragend=t=>(t.inputState.draggedContent=null,!1);function rT(t,e,n,r){if(n=Of(t.state,sO,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:l}=t.inputState,a=r&&l&&bZ(t,e)?{from:l.from,to:l.to}:null,o={from:i,insert:n},s=t.state.changes(a?[a,o]:o);t.focus(),t.dispatch({changes:s,selection:{anchor:s.mapPos(i,-1),head:s.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}u(rT,"dropText"),An.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,l=u(()=>{++i==n.length&&rT(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)},"finishFile");for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(r[a]=o.result),l()},o.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return rT(t,e,r,!0),!0}return!1},An.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=K6?null:e.clipboardData;return n?(U6(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):($Z(t),!1)};function kZ(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}u(kZ,"captureCopy$1");function DZ(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:l}of t.selection.ranges){let a=t.doc.lineAt(l);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:Of(t,uO,e.join(t.lineBreak)),ranges:n,linewise:r}}u(DZ,"copiedRange");let vO=null;An.copy=An.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=DZ(t.state);if(!n&&!i)return!1;vO=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let l=K6?null:e.clipboardData;return l?(l.clearData(),l.setData("text/plain",n),!0):(kZ(t,n),!1)};const iT=Tn.define();function lT(t,e){let n=[];for(let r of t.facet(S6)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:iT.of(!0)}):null}u(lT,"focusChangeTransaction");function aT(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=lT(t.state,e);n?t.dispatch(n):t.update([])}},10)}u(aT,"updateForFocusChange"),bn.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),aT(t)},bn.blur=t=>{t.observer.clearSelectionRange(),aT(t)},bn.compositionstart=bn.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},bn.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,U.chrome&&U.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},bn.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},An.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let l=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(l&&a.length){let o=a[0],s=t.posAtDOM(o.startContainer,o.startOffset),c=t.posAtDOM(o.endContainer,o.endOffset);return bO(t,{from:s,to:c,insert:t.state.toText(l)},null),!0}}let i;if(U.chrome&&U.android&&(i=W6.find(l=>l.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let l=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>l+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return U.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),U.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>bn.compositionend(t,e),20),!1};const oT=new Set;function PZ(t){oT.has(t)||(oT.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}u(PZ,"firefoxCopyCutHack");const sT=["pre-wrap","normal","pre-line","break-spaces"];let za=!1;function uT(){za=!1}u(uT,"clearHeightChangeFlag");const Hv=class Hv{constructor(e){this.lineWrapping=e,this.doc=pe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return sT.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=l,s){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>bf&&(za=!0),this.height=e)}replace(e,n,r){return Do.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let l=this,a=r.doc;for(let o=i.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:d,toB:f}=i[o],h=l.lineAt(s,Qe.ByPosNoHeight,r.setDoc(n),0,0),p=h.to>=c?h:l.lineAt(c,Qe.ByPosNoHeight,r,0,0);for(f+=p.to-c,c=p.to;o>0&&h.from<=i[o-1].toA;)s=i[o-1].fromA,d=i[o-1].fromB,o--,sl*2){let o=e[n-1];o.break?e.splice(--n,1,o.left,null,o.right):e.splice(--n,1,o.left,o.right),r+=1+o.break,i-=o.size}else if(l>i*2){let o=e[r];o.break?e.splice(r,1,o.left,null,o.right):e.splice(r,1,o.left,o.right),r+=2+o.break,l-=o.size}else break;else if(i=l&&a(this.blockAt(0,r,i,l))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}};u(e4,"HeightMapBlock");let vf=e4;const cc=class cc extends vf{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new ir(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof cc||i instanceof wi&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof wi?i=new cc(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Jt.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}};u(cc,"HeightMapText");let yn=cc;const on=class on extends Jt{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,l=i-r+1,a,o=0;if(e.lineWrapping){let s=Math.min(this.height,e.lineHeight*l);a=s/l,this.length>l+1&&(o=(this.height-s)/(this.length-l-1))}else a=this.height/l;return{firstLine:r,lastLine:i,perLine:a,perChar:o}}blockAt(e,n,r,i){let{firstLine:l,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let l=r[r.length-1];l instanceof on?r[r.length-1]=new on(l.length+i):r.push(null,new on(i-1))}if(e>0){let l=r[0];l instanceof on?r[0]=new on(e+l.length):r.unshift(new on(e-1),null)}return Jt.of(r)}decomposeLeft(e,n){n.push(new on(e-1),null)}decomposeRight(e,n){n.push(null,new on(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let l=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&a.push(new on(i.from-n-1).updateHeight(e,n));o<=l&&i.more;){let d=e.doc.lineAt(o).length;a.length&&a.push(null);let f=i.heights[i.index++];s==-1?s=f:Math.abs(f-s)>=bf&&(s=-2);let h=new yn(d,f);h.outdated=!1,a.push(h),o+=d+1}o<=l&&a.push(null,new on(l-o).updateHeight(e,o));let c=Jt.of(a);return(s<0||Math.abs(c.height-this.height)>=bf||Math.abs(s-this.heightMetrics(e,n).perLine)>=bf)&&(za=!0),yf(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}};u(on,"HeightMapGap");let wi=on;const t4=class t4 extends Jt{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let l=r+this.left.height;return eo))return c;let d=n==Qe.ByPosNoHeight?Qe.ByPosNoHeight:Qe.ByPos;return s?c.join(this.right.lineAt(o,d,r,a,o)):this.left.lineAt(o,d,r,i,l).join(c)}forEachLine(e,n,r,i,l,a){let o=i+this.left.height,s=l+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,n,r,o,s,a);else{let c=this.lineAt(s,Qe.ByPos,r,i,l);e=e&&c.from<=n&&a(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,o,s,a)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let l=[];e>0&&this.decomposeLeft(e,l);let a=l.length;for(let o of r)l.push(o);if(e>0&&cT(l,a-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?Jt.of(this.break?[e,null,n]:[e,n]):(this.left=yf(this.left,e),this.right=yf(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:l,right:a}=this,o=n+l.length+this.break,s=null;return i&&i.from<=n+l.length&&i.more?s=l=l.updateHeight(e,n,r,i):l.updateHeight(e,n,r),i&&i.from<=o+a.length&&i.more?s=a=a.updateHeight(e,o,r,i):a.updateHeight(e,o,r),s?this.balanced(l,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};u(t4,"HeightMapBranch");let xO=t4;function cT(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof wi&&(r=t[e+1])instanceof wi&&t.splice(e-1,3,new wi(n.length+1+r.length))}u(cT,"mergeGaps");const EZ=5,Bp=class Bp{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof yn?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new yn(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=EZ)&&this.addLineDeco(i,l,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new yn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new wi(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof yn)return e;let n=new yn(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof yn)&&!this.isCovered?this.nodes.push(new yn(0,-1)):(this.writtenTod.clientHeight||d.scrollWidth>d.clientWidth)&&f.overflow!="visible"){let h=d.getBoundingClientRect();l=Math.max(l,h.left),a=Math.min(a,h.right),o=Math.max(o,h.top),s=Math.min(c==t.parentNode?i.innerHeight:s,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?d.offsetParent:d.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:l-n.left,right:Math.max(l,a)-n.left,top:o-(n.top+e),bottom:Math.max(o,s)-(n.top+e)}}u(AZ,"visiblePixelRange");function QZ(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}u(QZ,"inWindow");function MZ(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}u(MZ,"fullPixelRange");const r4=class r4{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new $O(n),this.stateDeco=e.facet(Ls).filter(r=>typeof r!="function"),this.heightMap=Jt.empty().applyChanges(this.stateDeco,pe.empty,this.heightOracle.setDoc(e.doc),[new rr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=re.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:l,to:a})=>i>=l&&i<=a)){let{from:l,to:a}=this.lineBlockAt(i);e.push(new Za(l,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?dT:new DO(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ws(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Ls).filter(d=>typeof d!="function");let i=e.changedRanges,l=rr.extendWithRanges(i,TZ(r,this.stateDeco,e?e.changes:Ut.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);uT(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),l),(this.heightMap.height!=a||za)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=l.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,n));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(k6)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,l=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Ve.RTL:Ve.LTR;let a=this.heightOracle.mustRefreshForWrapping(l),o=n.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,d=0;if(o.width&&o.height){let{scaleX:v,scaleY:S}=JE(n,o);(v>.005&&Math.abs(this.scaleX-v)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=v,this.scaleY=S,c|=16,a=s=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,h=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=r6(e.scrollDOM);let m=(this.printing?MZ:AZ)(n,this.paddingTop),g=m.top-this.pixelViewport.top,O=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(s=!0)),!this.inView&&!this.scrollTarget&&!QZ(e.dom))return 0;let y=o.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let v=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(v)&&(a=!0),a||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:x,textHeight:C}=e.docView.measureTextSize();a=S>0&&i.refresh(l,S,x,C,Math.max(5,y/x),v),a&&(e.docView.minWidth=0,c|=16)}g>0&&O>0?d=Math.max(g,O):g<0&&O<0&&(d=Math.min(g,O)),uT();for(let S of this.viewports){let x=S.from==this.viewport.from?v:e.docView.measureVisibleLineHeights(S);this.heightMap=(a?Jt.empty().applyChanges(this.stateDeco,pe.empty,this.heightOracle,[new rr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new wO(S.from,x))}za&&(c|=2)}let $=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return $&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),c|=this.updateForViewport()),(c&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,l=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new Za(i.lineAt(a-r*1e3,Qe.ByHeight,l,0,0).from,i.lineAt(o+(1-r)*1e3,Qe.ByHeight,l,0,0).to);if(n){let{head:c}=n.range;if(cs.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Qe.ByPos,l,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&c=o+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&l>1,a=i<<1;if(this.defaultTextDirection!=Ve.LTR&&!r)return[];let o=[],s=u((d,f,h,p)=>{if(f-dd&&bb.from>=h.from&&b.to<=h.to&&Math.abs(b.from-d)b.fromy));if(!O){if(f$.from<=f&&$.to>=f)){let $=n.moveToLineBoundary(X.cursor(f),!1,!0).head;$>d&&(f=$)}let b=this.gapSize(h,d,f,p),y=r||b<2e6?b:2e6;O=new qs(d,f,b,y)}o.push(O)},"addGap"),c=u(d=>{if(d.length2e6)for(let x of e)x.from>=d.from&&x.fromd.from&&s(d.from,p,d,f),mn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Te.spans(n,this.viewport.from,this.viewport.to,{span(l,a){r.push({from:l,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let l=0;l=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Ws(this.heightMap.lineAt(e,Qe.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Ws(this.heightMap.lineAt(this.scaler.fromDOM(e),Qe.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Ws(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}};u(l4,"ViewState");let $f=l4;const a4=class a4{constructor(e,n){this.from=e,this.to=n}};u(a4,"Viewport");let Za=a4;function BZ(t,e,n){let r=[],i=t,l=0;return Te.spans(n,t,e,{span(){},point(a,o){a>i&&(r.push({from:i,to:a}),l+=a-i),i=o}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:l,to:a}=e[i],o=a-l;if(r<=o)return l+r;r-=o}}u(wf,"findPosition");function xf(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}u(xf,"findFraction");function RZ(t,e){for(let n of t)if(e(n))return n}u(RZ,"find");const dT={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}},Rp=class Rp{constructor(e,n,r){let i=0,l=0,a=0;this.viewports=r.map(({from:o,to:s})=>{let c=n.lineAt(o,Qe.ByPos,e,0,0).top,d=n.lineAt(s,Qe.ByPos,e,0,0).bottom;return i+=d-c,{from:o,to:s,top:c,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let o of this.viewports)o.domTop=a+(o.top-l)*this.scale,a=o.domBottom=o.domTop+(o.bottom-o.top),l=o.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let l=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}};u(Rp,"BigScaler");let DO=Rp;function Ws(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new ir(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Ws(i,e)):t._content)}u(Ws,"scaleBlock");const Sf=_.define({combine:t=>t.join(" ")}),PO=_.define({combine:t=>t.indexOf(!0)>-1}),EO=_n.newName(),fT=_n.newName(),hT=_n.newName(),pT={"&light":"."+fT,"&dark":"."+hT};function TO(t,e,n){return new _n(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}u(TO,"buildTheme");const VZ=TO("."+EO,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},pT),NZ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},AO=U.ie&&U.ie_version<=11;let FZ=(dc=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new J0,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(U.ie&&U.ie_version<=11||U.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&U.android&&e.constructor.EDIT_CONTEXT!==!1&&!(U.chrome&&U.chrome_version<126)&&(this.editContext=new QO(e),e.state.facet(Ir)&&(e.contentDOM.editContext=this.editContext.editContext)),AO&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ir)?r.root.activeElement!=this.dom:!rf(this.dom,i))return;let l=i.anchorNode&&r.docView.nearest(i.anchorNode);if(l&&l.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(U.ie&&U.ie_version<=11||U.android&&U.chrome)&&!r.state.selection.main.empty&&i.focusNode&&As(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Ts(e.root);if(!n)return!1;let r=U.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&IZ(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=rf(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let l=this.delayedAndroidKey;l&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=l.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&l.force&&Ia(this.dom,l.key,l.keyCode))},"flush");this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let l of e){let a=this.readMutation(l);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&rf(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let l=new OO(this.view,e,n,r);return this.view.docView.domChanged={newSel:l.newSel?l.newSel.main:null},l}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=X6(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=mT(n,e.previousSibling||e.target.previousSibling,-1),i=mT(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ir)!=e.state.facet(Ir)&&(e.view.contentDOM.editContext=e.state.facet(Ir)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}},u(dc,"DOMObserver"),dc);function mT(t,e,n){for(;e;){let r=Se.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}u(mT,"findChild");function gT(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,l=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return As(a.node,a.offset,i,l)&&([n,r,i,l]=[i,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:l}}u(gT,"buildSelectionRangeFromRange");function IZ(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return gT(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return u(r,"read"),t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?gT(t,n):null}u(IZ,"safariSelectionRangeHack");const o4=class o4{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:l,head:a}=i,o=this.toEditorPos(r.updateRangeStart),s=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>r.text.length;o==this.from&&lthis.to&&(s=l);let d=j6(e.state.sliceDoc(o,s),r.text,(c?i.from:i.to)-o,c?"end":null);if(!d){let h=X.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));h.main.eq(i)||e.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+o,to:d.toA+o,insert:pe.of(r.text.slice(d.from,d.toB).split(` `))};if((U.mac||U.android)&&f.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:o,to:s,insert:pe.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);bO(e,f,X.single(this.toEditorPos(r.selectionStart,h),this.toEditorPos(r.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],l=null;for(let a=this.toEditorPos(r.rangeStart),o=this.toEditorPos(r.rangeEnd);a{let i=[];for(let l of r.getTextFormats()){let a=l.underlineStyle,o=l.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(o)){let s=this.toEditorPos(l.rangeStart),c=this.toEditorPos(l.rangeEnd);if(s{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Ts(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((l,a,o,s,c)=>{if(r)return;let d=c.length-(a-l);if(i&&a>=i.to)if(i.from==l&&i.to==a&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=d,this.to+=d;return}else i=null,this.revertPending(e.state);if(l+=n,a+=n,a<=this.from)this.from+=d,this.to+=d;else if(lthis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(l),this.toContextPos(a),c.toString()),this.to+=d}n+=d}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}};u(o4,"EditContextManager");let QO=o4,J=(Wl=class{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(l=>r(l,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Ez(e.parent)||document,this.viewState=new $f(e.state||Xe.create(e)),e.scrollTo&&e.scrollTo.is(df)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(La).map(i=>new Is(i));for(let i of this.plugins)i.update(this);this.observer=new FZ(this),this.inputState=new hZ(this),this.inputState.ensureHandlers(this.plugins),this.docView=new hf(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof xt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,l=this.state;for(let h of e){if(h.startState!=l)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");l=h.state}if(this.destroyed){this.viewState.state=l;return}let a=this.hasFocus,o=0,s=null;e.some(h=>h.annotation(iT))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=lT(l,a),s||(o=1));let c=this.observer.delayedAndroidKey,d=null;if(c?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(l.doc)||!this.state.selection.eq(l.selection))&&(d=null)):this.observer.clear(),l.facet(Xe.phrases)!=this.state.facet(Xe.phrases))return this.setState(l);i=ff.create(this,l,e),i.flags|=o;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of e){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:p}=h.state.selection;f=new Fs(p.empty?p:X.cursor(p.head,p.head>p.anchor?-1:1))}for(let p of h.effects)p.is(df)&&(f=p.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=Cf.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Zs)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Sf)!=i.state.facet(Sf)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let h of this.state.facet(oO))try{h(i)}catch(p){Ht(this.state,p,"update listener")}(s||d)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),d&&!X6(this,d)&&c.force&&Ia(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new $f(e),this.plugins=e.facet(La).map(r=>new Is(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new hf(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(La),r=e.state.facet(La);if(n!=r){let i=[];for(let l of r){let a=n.indexOf(l);if(a<0)i.push(new Is(l));else{let o=this.plugins[a];o.mustUpdate=e,i.push(o)}}for(let l of this.plugins)l.mustUpdate!=e&&l.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:l,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(a<0)if(r6(r))l=-1,a=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);l=p.from,a=p.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];s&4||([this.measureRequests,c]=[c,this.measureRequests]);let d=c.map(p=>{try{return p.read(this)}catch(m){return Ht(this.state,m),OT}}),f=ff.create(this,this.state,[]),h=!1;f.flags|=s,n?n.flags|=s:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let p=0;p1||m<-1){i=i+m,r.scrollTop=i/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let o of this.state.facet(oO))o(n)}get themeClasses(){return EO+" "+(this.state.facet(PO)?hT:fT)+" "+this.state.facet(Sf)}updateAttrs(){let e=bT(this,E6,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ir)?"true":"false",class:"cm-content",style:`${U.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),bT(this,cO,n);let r=this.observer.ignore(()=>{let i=nO(this.contentDOM,this.contentAttrs,n),l=nO(this.dom,this.editorAttrs,e);return i||l});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Wl.announce)){n&&(this.announceDOM.textContent=""),n=!1;let l=this.announceDOM.appendChild(document.createElement("div"));l.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Zs);let e=this.state.facet(Wl.cspNonce);_n.mount(this.root,this.styleModules.concat(VZ).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return mO(this,e,z6(this,e,n,r))}moveByGroup(e,n){return mO(this,e,z6(this,e,n,r=>aZ(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),l=r[n?r.length-1:0];return X.cursor(l.side(n,i)+e.from,l.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return lZ(this,e,n,r)}moveVertically(e,n,r){return mO(this,e,oZ(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),F6(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),l=this.bidiSpans(i),a=l[nr.find(l,e-i.from,-1,n)];return Qs(r,a.dir==Ve.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(C6)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>LZ)return O6(e.length);let n=this.textDirectionAt(e.from),r;for(let l of this.bidiCache)if(l.from==e.from&&l.dir==n&&(l.fresh||g6(l.isolates,r=Q6(this,e))))return l.order;r||(r=Q6(this,e));let i=Xz(e.text,n,r);return this.bidiCache.push(new Cf(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||U.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{e6(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return df.of(new Fs(typeof e=="number"?X.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return df.of(new Fs(X.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return it.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return it.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=_n.newName(),i=[Sf.of(r),Zs.of(TO(`.${r}`,e))];return n&&n.dark&&i.push(PO.of(!0)),i}static baseTheme(e){return dl.lowest(Zs.of(TO("."+EO,e,pT)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Se.get(r)||Se.get(e);return((n=i?.rootView)===null||n===void 0?void 0:n.view)||null}},u(Wl,"EditorView"),Wl);J.styleModule=Zs,J.inputHandler=x6,J.clipboardInputFilter=sO,J.clipboardOutputFilter=uO,J.scrollHandler=D6,J.focusChangeEffect=S6,J.perLineTextDirection=C6,J.exceptionSink=w6,J.updateListener=oO,J.editable=Ir,J.mouseSelectionStyle=$6,J.dragMovesSelection=v6,J.clickAddsSelectionRange=y6,J.decorations=Ls,J.outerDecorations=T6,J.atomicRanges=zs,J.bidiIsolatedRanges=A6,J.scrollMargins=M6,J.darkTheme=PO,J.cspNonce=_.define({combine:t=>t.length?t[0]:""}),J.contentAttributes=cO,J.editorAttributes=E6,J.lineWrapping=J.contentAttributes.of({class:"cm-lineWrapping"}),J.announce=Oe.define();const LZ=4096,OT={},Vp=class Vp{constructor(e,n,r,i,l,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=l,this.order=a}static update(e,n){if(n.empty&&!e.some(l=>l.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Ve.LTR;for(let l=Math.max(0,e.length-10);l=0;i--){let l=r[i],a=typeof l=="function"?l(t):l;a&&tO(a,n)}return n}u(bT,"attrsFromFacet");const zZ=U.mac?"mac":U.windows?"win":U.linux?"linux":"key";function ZZ(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,l,a,o;for(let s=0;sr.concat(i),[]))),n}u(jZ,"getKeymap");let xi=null;const qZ=4e3;function WZ(t,e=zZ){let n=Object.create(null),r=Object.create(null),i=u((a,o)=>{let s=r[a];if(s==null)r[a]=o;else if(s!=o)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},"checkPrefix"),l=u((a,o,s,c,d)=>{var f,h;let p=n[a]||(n[a]=Object.create(null)),m=o.split(/ (?!$)/).map(b=>ZZ(b,e));for(let b=1;b{let v=xi={view:$,prefix:y,scope:a};return setTimeout(()=>{xi==v&&(xi=null)},qZ),!0}]})}let g=m.join(" ");i(g,!1);let O=p[g]||(p[g]={preventDefault:!1,stopPropagation:!1,run:((h=(f=p._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});s&&O.run.push(s),c&&(O.preventDefault=!0),d&&(O.stopPropagation=!0)},"add");for(let a of t){let o=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let c of o){let d=n[c]||(n[c]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=a;for(let h in d)d[h].run.push(p=>f(p,MO))}let s=a[e]||a.key;if(s)for(let c of o)l(c,s,a.run,a.preventDefault,a.stopPropagation),a.shift&&l(c,"Shift-"+s,a.shift,a.preventDefault,a.stopPropagation)}return n}u(WZ,"buildKeymap$1");let MO=null;function YZ(t,e,n,r){MO=e;let i=WE(e),l=Ft(i,0),a=Gn(l)==i.length&&i!=" ",o="",s=!1,c=!1,d=!1;xi&&xi.view==n&&xi.scope==r&&(o=xi.prefix+" ",Y6.indexOf(e.keyCode)<0&&(c=!0,xi=null));let f=new Set,h=u(O=>{if(O){for(let b of O.run)if(!f.has(b)&&(f.add(b),b(n)))return O.stopPropagation&&(d=!0),!0;O.preventDefault&&(O.stopPropagation&&(d=!0),c=!0)}return!1},"runFor"),p=t[r],m,g;return p&&(h(p[o+kf(i,e,!a)])?s=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(U.windows&&e.ctrlKey&&e.altKey)&&!(U.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=Fr[e.keyCode])&&m!=i?(h(p[o+kf(m,e,!0)])||e.shiftKey&&(g=Es[e.keyCode])!=i&&g!=m&&h(p[o+kf(g,e,!1)]))&&(s=!0):a&&e.shiftKey&&h(p[o+kf(i,e,!0)])&&(s=!0),!s&&h(p._any)&&(s=!0)),c&&(s=!0),s&&d&&e.stopPropagation(),MO=null,s}u(YZ,"runHandlers");const Np=class Np{constructor(e,n,r,i,l){this.className=e,this.left=n,this.top=r,this.width=i,this.height=l}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let l=vT(e);return[new Np(n,i.left-l.left,i.top-l.top,null,i.bottom-i.top)]}else return KZ(e,n,r)}};u(Np,"RectangleMarker");let Ys=Np;function vT(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Ve.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}u(vT,"getBase");function $T(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let l=t.dom.getBoundingClientRect(),a=(i.top+i.bottom)/2,o=t.posAtCoords({x:l.left+1,y:a}),s=t.posAtCoords({x:l.right-1,y:a});return o==null||s==null?r:{from:Math.max(r.from,Math.min(o,s)),to:Math.min(r.to,Math.max(o,s))}}u($T,"wrappedLine");function KZ(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),l=t.textDirection==Ve.LTR,a=t.contentDOM,o=a.getBoundingClientRect(),s=vT(t),c=a.querySelector(".cm-line"),d=c&&window.getComputedStyle(c),f=o.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),h=o.right-(d?parseInt(d.paddingRight):0),p=pO(t,r,1),m=pO(t,i,-1),g=p.type==kt.Text?p:null,O=m.type==kt.Text?m:null;if(g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=$T(t,r,1,g)),O&&(t.lineWrapping||m.widgetLineBreaks)&&(O=$T(t,i,-1,O)),g&&O&&g.from==O.from&&g.to==O.to)return y($(n.from,n.to,g));{let S=g?$(n.from,null,g):v(p,!1),x=O?$(null,n.to,O):v(m,!0),C=[];return(g||p).to<(O||m).from-(g&&O?1:0)||p.widgetLineBreaks>1&&S.bottom+t.defaultLineHeight/2M&&E.from=D)break;k>I&&w(Math.max(L,I),S==null&&L<=M,Math.min(k,D),x==null&&k>=A,R.dir)}if(I=P.to+1,I>=D)break}return B.length==0&&w(M,S==null,A,x==null,t.textDirection),{top:Q,bottom:T,horizontal:B}}u($,"drawForLine");function v(S,x){let C=o.top+(x?S.top:S.bottom);return{top:C,bottom:C,horizontal:[]}}u(v,"drawForWidget")}u(KZ,"rectanglesForRange");function UZ(t,e){return t.constructor==e.constructor&&t.eq(e)}u(UZ,"sameMarker");const s4=class s4{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Pf)!=e.state.facet(Pf)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Pf);for(;n!UZ(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e,U.safari&&U.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}};u(s4,"LayerView");let BO=s4;const Pf=_.define();function wT(t){return[it.define(e=>new BO(e,t)),Pf.of(t)]}u(wT,"layer");const Ks=_.define({combine(t){return bi(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function GZ(t={}){return[Ks.of(t),_Z,HZ,JZ,k6.of(!0)]}u(GZ,"drawSelection");function xT(t){return t.startState.facet(Ks)!=t.state.facet(Ks)}u(xT,"configChanged");const _Z=wT({above:!0,markers(t){let{state:e}=t,n=e.facet(Ks),r=[];for(let i of e.selection.ranges){let l=i==e.selection.main;if(i.empty||n.drawRangeCursor){let a=l?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=i.empty?i:X.cursor(i.head,i.head>i.anchor?-1:1);for(let s of Ys.forRange(t,a,o))r.push(s)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=xT(t);return n&&ST(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){ST(e.state,t)},class:"cm-cursorLayer"});function ST(t,e){e.style.animationDuration=t.facet(Ks).cursorBlinkRate+"ms"}u(ST,"setBlinkRate");const HZ=wT({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Ys.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||xT(t)},class:"cm-selectionLayer"}),JZ=dl.highest(J.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function CT(t,e,n,r,i){e.lastIndex=0;for(let l=t.iterRange(n,r),a=n,o;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;o=e.exec(l.value);)i(a+o.index,o)}u(CT,"iterMatches");function eX(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:l}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),l=Math.min(t.state.doc.lineAt(l).to,l+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=l:r.push({from:i,to:l});return r}u(eX,"matchRanges");const u4=class u4{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:l,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(o,s,c,d)=>i(d,c,c+o[0].length,o,s);else if(typeof r=="function")this.addMatch=(o,s,c,d)=>{let f=r(o,s,c);f&&d(c,c+o[0].length,f)};else if(r)this.addMatch=(o,s,c,d)=>d(c,c+o[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=l,this.maxLength=a}createDeco(e){let n=new fl,r=n.add.bind(n);for(let{from:i,to:l}of eX(e,this.maxLength))CT(e.state.doc,this.regexp,i,l,(a,o)=>this.addMatch(o,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((l,a,o,s)=>{s>=e.view.viewport.from&&o<=e.view.viewport.to&&(r=Math.min(o,r),i=Math.max(s,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let l of e.visibleRanges){let a=Math.max(l.from,r),o=Math.min(l.to,i);if(o>=a){let s=e.state.doc.lineAt(a),c=s.tos.from;a--)if(this.boundary.test(s.text[a-1-s.from])){d=a;break}for(;oh.push(b.range(g,O)),"add");if(s==c)for(this.regexp.lastIndex=d-s.from;(p=this.regexp.exec(s.text))&&p.indexthis.addMatch(O,e,g,m));n=n.update({filterFrom:d,filterTo:f,filter:(g,O)=>gf,add:h})}}return n}};u(u4,"MatchDecorator");let Ef=u4;const RO=/x/.unicode!=null?"gu":"g",tX=new RegExp(`[\0-\b --\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,RO),nX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let VO=null;function rX(){var t;if(VO==null&&typeof document<"u"&&document.body){let e=document.body.style;VO=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return VO||!1}u(rX,"supportsTabSize");const Tf=_.define({combine(t){let e=bi(t,{render:null,specialChars:tX,addSpecialChars:null});return(e.replaceTabs=!rX())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,RO)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,RO)),e}});function iX(t={}){return[Tf.of(t),lX()]}u(iX,"highlightSpecialChars");let kT=null;function lX(){return kT||(kT=it.fromClass(class{constructor(t){this.view=t,this.decorations=re.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Tf)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Ef({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,l=Ft(e[0],0);if(l==9){let a=i.lineAt(r),o=n.state.tabSize,s=Na(a.text,o,r-a.from);return re.replace({widget:new FO((o-s%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[l]||(this.decorationCache[l]=re.replace({widget:new NO(t,l)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Tf);t.startState.facet(Tf)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}u(lX,"specialCharPlugin");const aX="\u2022";function oX(t){return t>=32?aX:t==10?"\u2424":String.fromCharCode(9216+t)}u(oX,"placeholder$1");const c4=class c4 extends er{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=oX(this.code),r=e.state.phrase("Control character")+" "+(nX[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let l=document.createElement("span");return l.textContent=n,l.title=r,l.setAttribute("aria-label",r),l.className="cm-specialChar",l}ignoreEvent(){return!1}};u(c4,"SpecialCharWidget");let NO=c4;const d4=class d4 extends er{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};u(d4,"TabWidget");let FO=d4;function sX(){return cX}u(sX,"highlightActiveLine");const uX=re.line({class:"cm-activeLine"}),cX=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(uX.range(i.from)),e=i.from)}return re.set(n)}},{decorations:t=>t.decorations}),f4=class f4 extends er{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Fa(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Qs(n[0],r.direction!="rtl"),l=parseInt(r.lineHeight);return i.bottom-i.top>l*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+l}:i}ignoreEvent(){return!1}};u(f4,"Placeholder");let IO=f4;function dX(t){let e=it.fromClass(class{constructor(n){this.view=n,this.placeholder=t?re.set([re.widget({widget:new IO(t),side:1}).range(0)]):re.none}get decorations(){return this.view.state.doc.length?re.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,J.contentAttributes.of({"aria-placeholder":t})]:e}u(dX,"placeholder");const LO=2e3;function fX(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),l=[];if(e.off>LO||n.off>LO||e.col<0||n.col<0){let a=Math.min(e.off,n.off),o=Math.max(e.off,n.off);for(let s=r;s<=i;s++){let c=t.doc.line(s);c.length<=o&&l.push(X.range(c.from+a,c.to+o))}}else{let a=Math.min(e.col,n.col),o=Math.max(e.col,n.col);for(let s=r;s<=i;s++){let c=t.doc.line(s),d=Z0(c.text,a,t.tabSize,!0);if(d<0)l.push(X.cursor(c.to));else{let f=Z0(c.text,o,t.tabSize);l.push(X.range(c.from+d,c.from+f))}}}return l}u(fX,"rectangleFor");function hX(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}u(hX,"absoluteColumn");function DT(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,l=i>LO?-1:i==r.length?hX(t,e.clientX):Na(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:l,off:i}}u(DT,"getPos");function pX(t,e){let n=DT(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let l=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(l);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get(i,l,a){let o=DT(t,i);if(!o)return r;let s=fX(t.state,n,o);return s.length?a?X.create(s.concat(r.ranges)):X.create(s):r}}:null}u(pX,"rectangleSelectionStyle");function mX(t){let e=t?.eventFilter||(n=>n.altKey&&n.button==0);return J.mouseSelectionStyle.of((n,r)=>e(r)?pX(n,r):null)}u(mX,"rectangularSelection");const gX={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},OX={style:"cursor: crosshair"};function bX(t={}){let[e,n]=gX[t.key||"Alt"],r=it.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,J.contentAttributes.of(i=>{var l;return!((l=i.plugin(r))===null||l===void 0)&&l.isDown?OX:null})]}u(bX,"crosshairCursor");const Us="-10000px",h4=class h4{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let l=null;this.tooltipViews=this.tooltips.map(a=>l=r(a,l))}update(e,n){var r;let i=e.state.facet(this.facet),l=i.filter(s=>s);if(i===this.input){for(let s of this.tooltipViews)s.update&&s.update(e);return!1}let a=[],o=n?[]:null;for(let s=0;sn[c]=s),n.length=o.length),this.input=i,this.tooltips=l,this.tooltipViews=a,!0}};u(h4,"TooltipViewManager");let zO=h4;function yX(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}u(yX,"windowSpace");const ZO=_.define({combine:t=>{var e,n,r;return{position:U.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||yX}}}),PT=new WeakMap,ET=it.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(ZO);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new zO(t,AT,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(ZO);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Us,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:l}=this.manager.tooltipViews[0];if(U.gecko)n=l.offsetParent!=this.container.ownerDocument.body;else if(l.style.top==Us&&l.style.left=="0px"){let a=l.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}}if(n||this.position=="absolute")if(this.parent){let l=this.parent.getBoundingClientRect();l.width&&l.height&&(t=l.width/this.parent.offsetWidth,e=l.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=dO(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((l,a)=>{let o=this.manager.tooltipViews[a];return o.getCoords?o.getCoords(l.pos):this.view.coordsAtPos(l.pos)}),size:this.manager.tooltipViews.map(({dom:l})=>l.getBoundingClientRect()),space:this.view.state.facet(ZO).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:l}=t,a=[];for(let o=0;o=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){d.style.top=Us;continue}let p=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=p?7:0,g=h.right-h.left,O=(e=PT.get(c))!==null&&e!==void 0?e:h.bottom-h.top,b=c.offset||$X,y=this.view.textDirection==Ve.LTR,$=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(f.left-(p?14:0)+b.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(p?14:0)-b.x),r.right-g),v=this.above[o];!s.strictSide&&(v?f.top-O-m-b.yr.bottom)&&v==r.bottom-f.bottom>f.top-r.top&&(v=this.above[o]=!v);let S=(v?f.top-r.top:r.bottom-f.bottom)-m;if(S$&&Q.topx&&(x=v?Q.top-O-2-m:Q.bottom+m+2);if(this.position=="absolute"?(d.style.top=(x-t.parent.top)/l+"px",TT(d,($-t.parent.left)/i)):(d.style.top=x/l+"px",TT(d,$/i)),p){let Q=f.left+(y?b.x:-b.x)-($+14-7);p.style.left=Q/i+"px"}c.overlap!==!0&&a.push({left:$,top:x,right:C,bottom:x+O}),d.classList.toggle("cm-tooltip-above",v),d.classList.toggle("cm-tooltip-below",!v),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Us}},{eventObservers:{scroll(){this.maybeMeasure()}}});function TT(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}u(TT,"setLeftStyle");const vX=J.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),$X={x:0,y:0},AT=_.define({enables:[ET,vX]});function QT(t,e){let n=t.plugin(ET);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}u(QT,"getTooltip");const p4=class p4 extends Nr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};u(p4,"GutterMarker");let Qn=p4;Qn.prototype.elementClass="",Qn.prototype.toDOM=void 0,Qn.prototype.mapMode=ct.TrackBefore,Qn.prototype.startSide=Qn.prototype.endSide=-1,Qn.prototype.point=!0;const Af=_.define(),wX=_.define(),xX={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Te.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Gs=_.define();function SX(t){return[MT(),Gs.of({...xX,...t})]}u(SX,"gutter");const XO=_.define({combine:t=>t.some(e=>e)});function MT(t){let e=[CX];return t&&t.fixed===!1&&e.push(XO.of(!0)),e}u(MT,"gutters");const CX=it.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Gs).map(e=>new Qf(t,e)),this.fixed=!t.state.facet(XO);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(XO)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Te.iter(this.view.state.facet(Af),this.view.viewport.from),r=[],i=this.gutters.map(l=>new qO(l,this.view.viewport,-this.view.documentPadding.top));for(let l of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(l.type)){let a=!0;for(let o of l.type)if(o.type==kt.Text&&a){jO(n,r,o.from);for(let s of i)s.line(this.view,o,r);a=!1}else if(o.widget)for(let s of i)s.widget(this.view,o)}else if(l.type==kt.Text){jO(n,r,l.from);for(let a of i)a.line(this.view,l,r)}else if(l.widget)for(let a of i)a.widget(this.view,l);for(let l of i)l.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Gs),n=t.state.facet(Gs),r=t.docChanged||t.heightChanged||t.viewportChanged||!Te.eq(t.startState.facet(Af),t.state.facet(Af),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let l of n){let a=e.indexOf(l);a<0?i.push(new Qf(this.view,l)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let l of this.gutters)l.dom.remove(),i.indexOf(l)<0&&l.destroy();for(let l of i)l.config.side=="after"?this.getDOMAfter().appendChild(l.dom):this.dom.appendChild(l.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>J.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ve.LTR?{left:r,right:i}:{right:r,left:i}})});function BT(t){return Array.isArray(t)?t:[t]}u(BT,"asArray");function jO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}u(jO,"advanceCursor");const m4=class m4{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Te.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,l=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let o=new Mf(e,a,l,r);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,a,l,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];jO(this.cursor,i,n.from),r.length&&(i=i.concat(r));let l=this.gutter.config.lineMarker(e,n,i);l&&i.unshift(l);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let l of e.state.facet(wX)){let a=l(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}};u(m4,"UpdateContext");let qO=m4;const g4=class g4{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let l=i.target,a;if(l!=this.dom&&this.dom.contains(l)){for(;l.parentNode!=this.dom;)l=l.parentNode;let s=l.getBoundingClientRect();a=(s.top+s.bottom)/2}else a=i.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,o,i)&&i.preventDefault()});this.markers=BT(n.markers(e)),n.initialSpacer&&(this.spacer=new Mf(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=BT(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Te.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}};u(g4,"SingleGutterView");let Qf=g4;const O4=class O4{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),kX(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let l=0,a=0;;){let o=a,s=ll(o,s,c)||a(o,s,c):a}return r}})}}),b4=class b4 extends Qn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};u(b4,"NumberMarker");let _s=b4;function WO(t,e){return t.state.facet(Xa).formatNumber(e,t.state)}u(WO,"formatNumber");const EX=Gs.compute([Xa],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(DX)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new _s(WO(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(PX)){let l=i(e,n,r);if(l)return l}return null},lineMarkerChange:e=>e.startState.facet(Xa)!=e.state.facet(Xa),initialSpacer(e){return new _s(WO(e,RT(e.state.doc.lines)))},updateSpacer(e,n){let r=WO(n.view,RT(n.view.state.doc.lines));return r==e.number?e:new _s(r)},domEventHandlers:t.facet(Xa).domEventHandlers,side:"before"}));function TX(t={}){return[Xa.of(t),MT(),EX]}u(TX,"lineNumbers");function RT(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(AX.range(i)))}return Te.of(e)});function MX(){return QX}u(MX,"highlightActiveLineGutter");var BX=Object.defineProperty,Hs=u((t,e)=>BX(t,"name",{value:e,configurable:!0}),"d$b");const VT=Hs((t,e="",n=!1,r=[],i=(o,s)=>s[o]??o,l={},a="")=>new J({doc:e,parent:t,extensions:[dX(a),it.fromClass(class{constructor(o){this.items=VX(r),this.placeholders=this.matchResults(this.items).createDeco(o)}update(o){this.placeholders=this.matchResults(this.items).updateDeco(o,this.placeholders)}matchResults(o){return new Ef({regexp:j2,decoration:(s,c,d)=>re.replace({widget:new NX(s[1],i(s[1],o),()=>c.dispatch({changes:{from:d,to:d+s[1].length+4}}),l)})})}},{decorations:o=>o.placeholders,provide:o=>J.atomicRanges.of(s=>s.plugin(o)?.placeholders||re.none)}),J.updateListener.of(o=>{if(l.inputMask){if(o.focusChanged)o.state.doc.toString().includes("_")?o.view.dispatch({changes:{from:0,to:o.state.doc.length,insert:""}}):o.state.doc.toString().length===0&&o.view.hasFocus&&NT(o,l.inputMask);else if(o.docChanged&&o.view.hasFocus&&NT(o,l.inputMask))return}o.docChanged&&n&&n(o.state.doc.toString())}),J.theme({".cm-scroller":{fontFamily:"inherit",alignItems:"center !important"},"&.cm-editor.cm-focused":{outline:"none"}}),Xe.readOnly.of(l.readOnly??!1),J.contentAttributes.of({contenteditable:!(l.readOnly??!1)})]}),"createInput");var YO=!1;const NT=Hs((t,e)=>{if(t.state.doc.toString().length===0){let n="";for(const r of e)n+=r==="a"||r==="9"||r==="*"?"_":r;t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n}})}else{if(t.startState.doc.toString()===""||YO)return YO=!1,!1;const n=t.startState.doc.toString().split("");let r;return t.changes.iterChanges((i,l,a,o)=>{const s=t.state.doc.sliceString(a,o).split("");let c=Math.min(Math.max(l,o),n.length),d=Math.min(i,a);r=s.length>0?c:d;let f=0,h=!1;for(;d!==c;){let p=e[d],m=s[f];switch(p){case"a":m&&m.match(/[a-zA-Z]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"9":m&&m.match(/[0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"*":m&&m.match(/[a-zA-Z0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;default:n[d]=p;break}d+=1}}),YO=!0,t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n.join("")},selection:{anchor:r,head:r}}),!0}},"handleMasking"),RX=Hs((t,e)=>{if(t.length!==e.length)return!1;for(let n=0;nArray.isArray(t)?t.reduce((e,n)=>({...e,...n.choices??{}}),{}):t,"getItemsObject"),FT=(fc=class extends er{constructor(e,n,r,i){super(e),this.value=e,this.label=n,this.onRemove=r,this.config=i}toDOM(){const e=document.createElement("span");if(e.setAttribute("class","tf-dynamic-text-item"),e.setAttribute("data-id",this.value),e.textContent=this.label,this.config?.readOnly===!0)return e;const n=document.createElement("span");return n.setAttribute("class","tf-dynamic-text-item-delete"),n.addEventListener("click",this.onRemove),e.appendChild(n),e}},u(fc,"k"),fc);Hs(FT,"DynamicString");let NX=FT;var FX=Object.defineProperty,IT=u((t,e)=>FX(t,"name",{value:e,configurable:!0}),"x$7");const IX=wp.element.forwardRef(({inputProps:t,...e},n)=>{const r=wp.element.useRef();let i=e.value??"";if((e.prefix||e.suffix)&&(e.prefix&&!i.startsWith(e.prefix)&&(i=e.prefix+i),e.suffix&&!i.endsWith(e.suffix)&&(i=i+e.suffix)),e.inputMask){const c=e.prefix?e.prefix.length:0,d=e.suffix?i.length-e.suffix.length:i.length;i=RX(i.slice(c,d),e.inputMask)?i:""}const[l,a]=wp.element.useState(i);wp.element.useEffect(()=>{let c=l;e.prefix&&(c=c.slice(e.prefix.length)),e.suffix&&(c=c.slice(0,c.length-e.suffix.length)),r.current=r.current??VT(n.current,c,d=>{a(`${e.prefix??""}${d}${e.suffix??""}`)},e.choices,o,{readOnly:e.readOnly??!1,inputMask:e.inputMask&&e.inputMask!==""?e.inputMask:null},e.placeholder??"")},[n.current]),wp.element.useEffect(()=>{if(e.suffix){const c=document.createElement("span");c.textContent=e.suffix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--suffix"),n.current.appendChild(c)}if(e.prefix){const c=document.createElement("span");c.textContent=e.prefix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--prefix"),n.current.insertBefore(c,n.current.children[0])}},[]);const o=IT(c=>{const d=e.dynamic.parse(c);return d&&d.type?e.dynamic.getLabel(d.type):c},"getDynamicValueLabel");wp.element.useEffect(()=>e.onChange&&e.onChange(l),[l]);const s=IT(c=>{r.current.dispatch({changes:{from:r.current.state.doc.length,insert:`${c}`}})},"insertDynamicValue");return!e.inputMask&&e.dynamic&&e.dynamic.getMode()==="replace"?wp.element.createElement(Ss,{...e,config:e.dynamic??"",value:l,onValueSelection:a,onValueRemove:()=>{r.current=null,a("")},inputProps:t,readOnly:e.readOnly??!1,buttonType:"inside"},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`})):wp.element.createElement(yE,{config:e.dynamic??"",onValueSelection:s,buttonType:"inside",readOnly:e.readOnly??!1,inputMasking:e.inputMask},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`}))});var LX=Object.defineProperty,zX=u((t,e)=>LX(t,"name",{value:e,configurable:!0}),"l$a");const Bf=zX(t=>{const{locale:e}=Re(),[n,r]=wp.element.useState(t.value??""),i=fN({...t,locale:e}),l=wp.element.useRef(),{labelProps:a,descriptionProps:o,groupProps:s,inputProps:c,incrementButtonProps:d,decrementButtonProps:f}=SN(t,i,l);wp.element.useEffect(()=>t.onChange&&t.onChange(n),[n]);const h=t.hasButtons??!0,p=t.readOnly??!1;return wp.element.createElement("div",{className:"tf-number","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:a,parent:t},t.label),wp.element.createElement("div",{className:"tf-number-field",...s},wp.element.createElement(Ss,{...t,value:n,onValueSelection:r,ref:l,inputProps:c},wp.element.createElement("input",{...c,value:Number.isInteger(i.numberValue)?i.numberValue:0,ref:l,name:t.name??"",disabled:p}),h&&wp.element.createElement("div",{className:"tf-number-button-group"},wp.element.createElement(se,{type:"number",...d,isDisabled:p},"+"),wp.element.createElement(se,{type:"number",...f,isDisabled:p},"-")))),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"NumberComponent");var ZX=Object.defineProperty,XX=u((t,e)=>ZX(t,"name",{value:e,configurable:!0}),"r$5");const Js=XX(t=>{const e=GI(t),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),{labelProps:l,descriptionProps:a,triggerProps:o,valueProps:s,menuProps:c}=KF(t,e,n);return wp.element.createElement("div",{className:"tf-select",ref:i},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(GF,{state:e,triggerRef:n,label:t.label,name:t.name}),wp.element.createElement(se,{type:"select",...o,ref:n,onKeyDown:d=>d.code==="Space"?e.toggle():o.onKeyDown(d)},wp.element.createElement("span",{...s,className:"tf-select__value"},e.selectedItem?e.selectedItem.rendered:t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:n,placement:"bottom start",style:{width:i?.current?.offsetWidth}},wp.element.createElement(Vd,{...c,listBoxRef:r,state:e,items:t.items})),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Select");var jX=Object.defineProperty,eu=u((t,e)=>jX(t,"name",{value:e,configurable:!0}),"n$f");const LT=eu(t=>{const e=t.units??["px"],n=t.linked==="toggle"||t.linked===void 0,{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]),wp.element.useEffect(()=>{a.isLinked&&c(a.top)},[a.isLinked]);const s=eu((p,m)=>{o({...a,[m]:p})},"setAttribute"),c=eu(p=>{o({...a,top:p,left:p,right:p,bottom:p})},"setLinkedPosition"),d=eu(p=>{o({...a,isLinked:p})},"setIsLinked"),f=eu(()=>n?a.isLinked??!1:t.linked,"isLinked");let h="tf-dimensions-number-groups";return f()&&(h+=" tf-dimensions-number-groups-linked"),wp.element.createElement("div",{className:"tf-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-dimensions-container"},wp.element.createElement("div",{className:h},["top","left","right","bottom"].map(p=>wp.element.createElement(Bf,{key:p,value:a[p]??0,name:p,description:!1,label:`Value for ${p} position`,labelVisuallyHidden:!0,onChange:m=>f()?c(m):s(m,p)}))),wp.element.createElement(Js,{label:"Dimensions unit",labelVisuallyHidden:!0,description:!1,selectedKey:a.unit??"px",onSelectionChange:p=>s(p,"unit"),placeholder:"unit"},e.map(p=>wp.element.createElement(Qr,{key:p},p))),n&&wp.element.createElement(se,{type:"action",onPress:()=>d(!a.isLinked)},wp.element.createElement("span",{className:"dashicons dashicons-admin-links"}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Dimensions");var qX=Object.defineProperty,zT=u((t,e)=>qX(t,"name",{value:e,configurable:!0}),"a$9");const WX=zT(t=>{const e=t.units??["px"],n=t.format??"hex",{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{dimensions:{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1},color:"rgba(0,0,0,1)"}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]);const s=zT(c=>{o(typeof c=="string"?d=>({...d,color:c}):d=>({...d,dimensions:{...d.dimensions,...c}}))},"handleData");return wp.element.createElement("div",{className:"tf-border"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-border-container"},wp.element.createElement("div",{className:"tf-border-dimensions-container"},wp.element.createElement(LT,{label:"Border dimensions",labelVisuallyHidden:!0,onChange:s,linked:t.linked,units:e,value:a.dimensions})),wp.element.createElement("div",{className:"tf-border-color-picker-container"},wp.element.createElement(jQ,{label:"Border Color",labelVisuallyHidden:!0,onChange:s,value:a.color,format:n,hasAlpha:t.hasAlpha??!0}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Border");var YX=Object.defineProperty,KX=u((t,e)=>YX(t,"name",{value:e,configurable:!0}),"n$e");const UX=KX(t=>{const e=wp.element.useContext(t.context),n=wp.element.useRef(null),{inputProps:r}=L2(t,e,n);let i="tf-button-group-option";return e.selectedValue===t.value&&(i+=" tf-button-group-option-selected"),wp.element.createElement("label",{className:i},wp.element.createElement(gn,null,wp.element.createElement("input",{...r,ref:n})),t.children)},"ButtonOption");var GX=Object.defineProperty,_X=u((t,e)=>GX(t,"name",{value:e,configurable:!0}),"n$d");const ZT=wp.element.createContext(null),HX=_X(t=>{const e=KP(t),n=il(t.choices??{}),{radioGroupProps:r,labelProps:i,descriptionProps:l}=z2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-button-group"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-button-group-container",...r},wp.element.createElement(ZT.Provider,{value:e},n.map(a=>wp.element.createElement(UX,{key:a.value,context:ZT,...a},t.use_dashicon?wp.element.createElement("span",{className:`dashicons dashicons-${a.label}`}):a.label)))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"ButtonGroup");var JX=Object.defineProperty,ej=u((t,e)=>JX(t,"name",{value:e,configurable:!0}),"i$e");const tu=ej(t=>{const e=kx(t),n=wp.element.useRef(),{inputProps:r}=YV({...t,children:t.label??!1},e,n),{labelProps:i,descriptionProps:l}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value==="1"&&e.setSelected(!0),typeof t.value=="boolean"&&t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]);const a=t?.labelVisuallyHidden?gn:wp.element.Fragment;return wp.element.createElement("div",{className:"tf-checkbox"},wp.element.createElement(xe,{labelProps:i,parent:{...t,labelVisuallyHidden:!1}},wp.element.createElement("input",{...r,ref:n,id:t.name??""}),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:e.isSelected?"1":"0"}),wp.element.createElement(a,null,t.label??"")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Checkbox"),XT=1024;let tj=0;const y4=class y4{constructor(e,n){this.from=e,this.to=n}};u(y4,"Range");let It=y4;const v4=class v4{constructor(e={}){this.id=tj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=en.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}};u(v4,"NodeProp");let ue=v4;ue.closedBy=new ue({deserialize:t=>t.split(" ")}),ue.openedBy=new ue({deserialize:t=>t.split(" ")}),ue.group=new ue({deserialize:t=>t.split(" ")}),ue.isolate=new ue({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),ue.contextHash=new ue({perNode:!0}),ue.lookAhead=new ue({perNode:!0}),ue.mounted=new ue({perNode:!0});const $4=class $4{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[ue.mounted.id]}};u($4,"MountedTree");let yl=$4;const nj=Object.create(null);let en=(Po=class{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):nj,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Po(e.name||"",n,e.id,r);if(e.props){for(let l of e.props)if(Array.isArray(l)||(l=l(i)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[l[0].id]=l[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(ue.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(ue.group),l=-1;l<(i?i.length:0);l++){let a=n[l<0?r.name:i[l]];if(a)return a}}}},u(Po,"NodeType"),Po);en.none=new en("",Object.create(null),0,8);const Fp=class Fp{constructor(e){this.types=e;for(let n=0;n0;for(let s=this.cursor(a|Ae.IncludeAnonymous);;){let c=!1;if(s.from<=l&&s.to>=i&&(!o&&s.type.isAnonymous||n(s)!==!1)){if(s.firstChild())continue;c=!0}for(;c&&r&&(o||!s.type.isAnonymous)&&r(s),!s.nextSibling();){if(!s.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:eb(en.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new hc(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new hc(en.none,n,r,i)))}static build(e){return ij(e)}};u(hc,"Tree");let Le=hc;Le.empty=new Le(en.none,[],[],0);const Ip=class Ip{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Ip(this.buffer,this.index)}};u(Ip,"FlatBufferCursor");let UO=Ip;const Lp=class Lp{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return en.none}toString(){let e=[];for(let n=0;n0));s=a[s+3]);return o}slice(e,n,r){let i=this.buffer,l=new Uint16Array(n-e),a=0;for(let o=e,s=0;o=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}u(qT,"checkSide");function nu(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?o.length:-1;e!=c;e+=n){let d=o[e],f=s[e]+a.from;if(qT(i,r,f,f+d.length)){if(d instanceof Si){if(l&Ae.ExcludeBuffers)continue;let h=d.findChild(0,d.buffer.length,n,r-f,i);if(h>-1)return new vl(new _O(a,d,e,f),null,h)}else if(l&Ae.IncludeAnonymous||!d.type.isAnonymous||JO(d)){let h;if(!(l&Ae.IgnoreMounts)&&(h=yl.get(d))&&!h.overlay)return new Eo(h.tree,f,e,a);let p=new Eo(d,f,e,a);return l&Ae.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?d.children.length-1:0,n,r,i)}}}if(l&Ae.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Ae.IgnoreOverlays)&&(i=yl.get(this._tree))&&i.overlay){let l=e-this.from;for(let{from:a,to:o}of i.overlay)if((n>0?a<=l:a=l:o>l))return new Eo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};u(Eo,"TreeNode");let Lt=Eo;function WT(t,e,n,r){let i=t.cursor(),l=[];if(!i.firstChild())return l;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return l}for(;;){if(r!=null&&i.type.is(r))return l;if(i.type.is(e)&&l.push(i.node),!i.nextSibling())return r==null?l:[]}}u(WT,"getChildren");function GO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}u(GO,"matchNodeContext");const x4=class x4{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}};u(x4,"BufferContext");let _O=x4;const Yl=class Yl extends Vf{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return l<0?null:new Yl(this.context,this,l)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Ae.ExcludeBuffers)return null;let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return l<0?null:new Yl(this.context,this,l)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Yl(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Yl(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,l=r.buffer[this.index+3];if(l>i){let a=r.buffer[this.index+1];e.push(r.slice(i,l,a)),n.push(0)}return new Le(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};u(Yl,"BufferNode");let vl=Yl;function YT(t){if(!t.length)return null;let e=0,n=t[0];for(let l=1;ln.from||a.to=e){let o=new Lt(a.tree,a.overlay[0].from+l.from,-1,l);(i||(i=[r])).push(nu(o,e,n,!1))}}return i?YT(i):r}u(rj,"stackIterator");const C4=class C4{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Lt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Lt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return l<0?!1:(this.stack.push(this.index),this.yieldBuf(l))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Ae.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ae.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ae.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let l=n+e,a=e<0?-1:r._tree.children.length;l!=a;l+=e){let o=r._tree.children[l];if(this.mode&Ae.IncludeAnonymous||o instanceof Si||!o.type.isAnonymous||JO(o))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=l+1;break e}i=this.stack[--l]}for(let i=r;i=0;l--){if(l<0)return GO(this._tree,e,i);let a=r[n.buffer[this.stack[l]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}};u(C4,"TreeCursor");let ja=C4;function JO(t){return t.children.some(e=>e instanceof Si||!e.type.isAnonymous||JO(e))}u(JO,"hasChild");function ij(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=XT,reused:l=[],minRepeatType:a=r.types.length}=t,o=Array.isArray(n)?new UO(n,n.length):n,s=r.types,c=0,d=0;function f(S,x,C,Q,T,B){let{id:w,start:M,end:A,size:E}=o,I=d,D=c;for(;E<0;)if(o.next(),E==-1){let F=l[w];C.push(F),Q.push(M-S);return}else if(E==-3){c=w;return}else if(E==-4){d=w;return}else throw new RangeError(`Unrecognized record size: ${E}`);let P=s[w],R,L,k=M-S;if(A-M<=i&&(L=O(o.pos-x,T))){let F=new Uint16Array(L.size-L.skip),N=o.pos-L.size,z=F.length;for(;o.pos>N;)z=b(L.start,F,z);R=new Si(F,A-L.start,r),k=L.start-S}else{let F=o.pos-E;o.next();let N=[],z=[],G=w>=a?w:-1,le=0,ie=A;for(;o.pos>F;)G>=0&&o.id==G&&o.size>=0?(o.end<=ie-i&&(m(N,z,M,le,o.end,ie,G,I,D),le=N.length,ie=o.end),o.next()):B>2500?h(M,F,N,z):f(M,F,N,z,G,B+1);if(G>=0&&le>0&&le-1&&le>0){let me=p(P,D);R=eb(P,N,z,0,N.length,0,A-M,me,me)}else R=g(P,N,z,A-M,I-A,D)}C.push(R),Q.push(k)}u(f,"takeNode");function h(S,x,C,Q){let T=[],B=0,w=-1;for(;o.pos>x;){let{id:M,start:A,end:E,size:I}=o;if(I>4)o.next();else{if(w>-1&&A=0;E-=3)M[I++]=T[E],M[I++]=T[E+1]-A,M[I++]=T[E+2]-A,M[I++]=I;C.push(new Si(M,T[2]-A,r)),Q.push(A-S)}}u(h,"takeFlatNode");function p(S,x){return(C,Q,T)=>{let B=0,w=C.length-1,M,A;if(w>=0&&(M=C[w])instanceof Le){if(!w&&M.type==S&&M.length==T)return M;(A=M.prop(ue.lookAhead))&&(B=Q[w]+M.length+A)}return g(S,C,Q,T,B,x)}}u(p,"makeBalanced");function m(S,x,C,Q,T,B,w,M,A){let E=[],I=[];for(;S.length>Q;)E.push(S.pop()),I.push(x.pop()+C-T);S.push(g(r.types[w],E,I,B-T,M-B,A)),x.push(T-C)}u(m,"makeRepeatLeaf");function g(S,x,C,Q,T,B,w){if(B){let M=[ue.contextHash,B];w=w?[M].concat(w):[M]}if(T>25){let M=[ue.lookAhead,T];w=w?[M].concat(w):[M]}return new Le(S,x,C,Q,w)}u(g,"makeTree");function O(S,x){let C=o.fork(),Q=0,T=0,B=0,w=C.end-i,M={size:0,start:0,skip:0};e:for(let A=C.pos-S;C.pos>A;){let E=C.size;if(C.id==x&&E>=0){M.size=Q,M.start=T,M.skip=B,B+=4,Q+=4,C.next();continue}let I=C.pos-E;if(E<0||I=a?4:0,P=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3)D+=4;else break e;else C.id>=a&&(D+=4);C.next()}T=P,Q+=E,B+=D}return(x<0||Q==S)&&(M.size=Q,M.start=T,M.skip=B),M.size>4?M:void 0}u(O,"findBufferSize");function b(S,x,C){let{id:Q,start:T,end:B,size:w}=o;if(o.next(),w>=0&&Q4){let A=o.pos-(w-4);for(;o.pos>A;)C=b(S,x,C)}x[--C]=M,x[--C]=B-S,x[--C]=T-S,x[--C]=Q}else w==-3?c=Q:w==-4&&(d=Q);return C}u(b,"copyToBuffer");let y=[],$=[];for(;o.pos>0;)f(t.start||0,t.bufferStart||0,y,$,-1,0);let v=(e=t.length)!==null&&e!==void 0?e:y.length?$[0]+y[0].length:0;return new Le(s[t.topID],y.reverse(),$.reverse(),v)}u(ij,"buildTree$1");const KT=new WeakMap;function Nf(t,e){if(!t.isAnonymous||e instanceof Si||e.type!=t)return 1;let n=KT.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Le)){n=1;break}n+=Nf(t,r)}KT.set(e,n)}return n}u(Nf,"nodeSize$1");function eb(t,e,n,r,i,l,a,o,s){let c=0;for(let m=r;m=d)break;x+=C}if($==v+1){if(x>d){let C=m[v];p(C.children,C.positions,0,C.children.length,g[v]+y);continue}f.push(m[v])}else{let C=g[$-1]+m[$-1].length-S;f.push(eb(t,m,g,v,$,S,C,null,s))}h.push(S+y-l)}}return u(p,"divide"),p(e,n,r,i,0),(o||s)(f,h,a)}u(eb,"balanceRange");const k4=class k4{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof vl?this.setBuffer(e.context.buffer,e.index,n):e instanceof Lt&&this.map.set(e.tree,n)}get(e){return e instanceof vl?this.getBuffer(e.context.buffer,e.index):e instanceof Lt?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}};u(k4,"NodeWeakMap");let Ff=k4;const pc=class pc{constructor(e,n,r,i,l=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(l?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new pc(0,e.length,e,0,!1,r)];for(let l of n)l.to>e.length&&i.push(l);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],l=1,a=e.length?e[0]:null;for(let o=0,s=0,c=0;;o++){let d=o=r)for(;a&&a.from=h.from||f<=h.to||c){let p=Math.max(h.from,s)-c,m=Math.min(h.to,f)-c;h=p>=m?null:new pc(p,m,h.tree,h.offset+c,o>0,!!d)}if(h&&i.push(h),a.to>f)break;a=lnew It(i.from,i.to)):[new It(0,0)]:[new It(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let l=i.advance();if(l)return l}}};u(D4,"Parser");let If=D4;const P4=class P4{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}};u(P4,"StringInput");let tb=P4;function lj(t){return(e,n,r,i)=>new ib(e,t,n,r,i)}u(lj,"parseMixed");const E4=class E4{constructor(e,n,r,i,l){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.from=l}};u(E4,"InnerParse");let Lf=E4;function UT(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}u(UT,"checkRanges");const T4=class T4{constructor(e,n,r,i,l,a,o){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=l,this.target=a,this.prev=o,this.depth=0,this.ranges=[]}};u(T4,"ActiveOverlay");let nb=T4;const rb=new ue({perNode:!0}),A4=class A4{constructor(e,n,r,i,l){this.nest=n,this.input=r,this.fragments=i,this.ranges=l,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Le(r.type,r.children,r.positions,r.length,r.propValues.concat([[rb,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[ue.mounted.id]=new yl(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(d=>d.frag.from<=i.from&&d.frag.to>=i.to&&d.mount.overlay);if(c)for(let d of c.mount.overlay){let f=d.from+c.pos,h=d.to+c.pos;f>=i.from&&h<=i.to&&!n.ranges.some(p=>p.fromf)&&n.ranges.push({from:f,to:h})}}o=!1}else if(r&&(a=aj(r.ranges,i.from,i.to)))o=a!=2;else if(!i.type.isAnonymous&&(l=this.nest(i,this.input))&&(i.fromnew It(f.from-i.from,f.to-i.from)):null,i.tree,d.length?d[0].from:i.from)),l.overlay?d.length&&(r={ranges:d,depth:0,prev:r}):o=!1}}else if(n&&(s=n.predicate(i))&&(s===!0&&(s=new It(i.from,i.to)),s.from=0&&n.ranges[c].to==s.from?n.ranges[c]={from:n.ranges[c].from,to:s.to}:n.ranges.push(s)}if(o&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=_T(this.ranges,n.ranges);c.length&&(UT(c),this.inner.splice(n.index,0,new Lf(n.parser,n.parser.startParse(this.input,HT(n.mounts,c),c),n.ranges.map(d=>new It(d.from-n.start,d.to-n.start)),n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}};u(A4,"MixedParse");let ib=A4;function aj(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}u(aj,"checkCover");function GT(t,e,n,r,i,l){if(e=e&&n.enter(r,1,Ae.IgnoreOverlays|Ae.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Le)n=n.children[0];else break}return!1}};u(Q4,"StructureCursor");let zf=Q4,sj=(mc=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(rb))!==null&&n!==void 0?n:r.to,this.inner=new zf(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(rb))!==null&&e!==void 0?e:n.to,this.inner=new zf(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let l=this.inner.cursor.node;l;l=l.parent){let a=(r=l.tree)===null||r===void 0?void 0:r.prop(ue.mounted);if(a&&a.parser==n)for(let o=this.fragI;o=l.to)break;s.tree==this.curFrag.tree&&i.push({frag:s,pos:l.from-s.offset,mount:a})}}}return i}},u(mc,"FragmentCursor"),mc);function _T(t,e){let n=null,r=e;for(let i=1,l=0;i=o)break;s.to<=a||(n||(r=n=e.slice()),s.fromo&&n.splice(l+1,0,new It(o,s.to))):s.to>o?n[l--]=new It(o,s.to):n.splice(l--,1))}}return r}u(_T,"punchRanges");function uj(t,e,n,r){let i=0,l=0,a=!1,o=!1,s=-1e9,c=[];for(;;){let d=i==t.length?1e9:a?t[i].to:t[i].from,f=l==e.length?1e9:o?e[l].to:e[l].from;if(a!=o){let h=Math.max(s,n),p=Math.min(d,f,r);hnew It(h.from+r,h.to+r)),f=uj(e,d,s,c);for(let h=0,p=s;;h++){let m=h==f.length,g=m?c:f[h].from;if(g>p&&n.push(new Ci(p,g,i.tree,-a,l.from>=p||l.openStart,l.to<=g||l.openEnd)),m)break;p=f[h].to}}else n.push(new Ci(s,c,i.tree,-a,l.from>=a||l.openStart,l.to<=o||l.openEnd))}return n}u(HT,"enterFragments");let cj=0;const gc=class gc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=cj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof gc&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new gc(r,[],null,[]);if(i.set.push(i),n)for(let l of n.set)i.set.push(l);return i}static defineModifier(e){let n=new Zf(e);return r=>r.modified.indexOf(n)>-1?r:Zf.get(r.base||r,r.modified.concat(n).sort((i,l)=>i.id-l.id))}};u(gc,"Tag");let Mn=gc,dj=0;const zp=class zp{constructor(e){this.name=e,this.instances=[],this.id=dj++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(o=>o.base==e&&fj(n,o.modified));if(r)return r;let i=[],l=new Mn(e.name,i,e,n);for(let o of n)o.instances.push(l);let a=hj(n);for(let o of e.set)if(!o.modified.length)for(let s of a)i.push(zp.get(o,s));return l}};u(zp,"Modifier");let Zf=zp;function fj(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}u(fj,"sameArray");function hj(t){let e=[[]];for(let n=0;nr.length-n.length)}u(hj,"powerSet");function Xf(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let l=[],a=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!h)throw new RangeError("Invalid path: "+i);if(l.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let p=i[f++];if(f==i.length&&p=="!"){a=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let s=l.length-1,c=l[s];if(!c)throw new RangeError("Invalid path: "+i);let d=new qa(r,a,s>0?l.slice(0,s):null);e[c]=d.sort(e[c])}}return JT.add(e)}u(Xf,"styleTags");const JT=new ue,M4=class M4{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=i;for(let o of l)for(let s of o.set){let c=n[s.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}u(e7,"tagHighlighter");function pj(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}u(pj,"highlightTags");function mj(t,e,n,r=0,i=t.length){let l=new lb(r,Array.isArray(e)?e:[e],n);l.highlightRange(t.cursor(),r,i,"",l.highlighters),l.flush(i)}u(mj,"highlightTree");const B4=class B4{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,l){let{type:a,from:o,to:s}=e;if(o>=r||s<=n)return;a.isTop&&(l=this.highlighters.filter(p=>!p.scope||p.scope(a)));let c=i,d=gj(e)||qa.empty,f=pj(l,d.tags);if(f&&(c&&(c+=" "),c+=f,d.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,o),c),d.opaque)return;let h=e.tree&&e.tree.prop(ue.mounted);if(h&&h.overlay){let p=e.node.enter(h.overlay[0].from+o,1),m=this.highlighters.filter(O=>!O.scope||O.scope(h.tree.type)),g=e.firstChild();for(let O=0,b=o;;O++){let y=O=$||!e.nextSibling())););if(!y||$>r)break;b=y.to+o,b>n&&(this.highlightRange(p.cursor(),Math.max(n,y.from+o),Math.min(r,b),"",m),this.startSpan(Math.min(r,b),c))}g&&e.parent()}else if(e.firstChild()){h&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,l),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}};u(B4,"HighlightBuilder");let lb=B4;function gj(t){let e=t.type.prop(JT);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}u(gj,"getStyleTags");const Y=Mn.define,jf=Y(),ki=Y(),t7=Y(ki),n7=Y(ki),Di=Y(),qf=Y(Di),ab=Y(Di),lr=Y(),$l=Y(lr),ar=Y(),or=Y(),ob=Y(),ru=Y(ob),Wf=Y(),V={comment:jf,lineComment:Y(jf),blockComment:Y(jf),docComment:Y(jf),name:ki,variableName:Y(ki),typeName:t7,tagName:Y(t7),propertyName:n7,attributeName:Y(n7),className:Y(ki),labelName:Y(ki),namespace:Y(ki),macroName:Y(ki),literal:Di,string:qf,docString:Y(qf),character:Y(qf),attributeValue:Y(qf),number:ab,integer:Y(ab),float:Y(ab),bool:Y(Di),regexp:Y(Di),escape:Y(Di),color:Y(Di),url:Y(Di),keyword:ar,self:Y(ar),null:Y(ar),atom:Y(ar),unit:Y(ar),modifier:Y(ar),operatorKeyword:Y(ar),controlKeyword:Y(ar),definitionKeyword:Y(ar),moduleKeyword:Y(ar),operator:or,derefOperator:Y(or),arithmeticOperator:Y(or),logicOperator:Y(or),bitwiseOperator:Y(or),compareOperator:Y(or),updateOperator:Y(or),definitionOperator:Y(or),typeOperator:Y(or),controlOperator:Y(or),punctuation:ob,separator:Y(ob),bracket:ru,angleBracket:Y(ru),squareBracket:Y(ru),paren:Y(ru),brace:Y(ru),content:lr,heading:$l,heading1:Y($l),heading2:Y($l),heading3:Y($l),heading4:Y($l),heading5:Y($l),heading6:Y($l),contentSeparator:Y(lr),list:Y(lr),quote:Y(lr),emphasis:Y(lr),strong:Y(lr),link:Y(lr),monospace:Y(lr),strikethrough:Y(lr),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Wf,documentMeta:Y(Wf),annotation:Y(Wf),processingInstruction:Y(Wf),definition:Mn.defineModifier("definition"),constant:Mn.defineModifier("constant"),function:Mn.defineModifier("function"),standard:Mn.defineModifier("standard"),local:Mn.defineModifier("local"),special:Mn.defineModifier("special")};for(let t in V){let e=V[t];e instanceof Mn&&(e.name=t)}e7([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var sb;const Wa=new ue;function r7(t){return _.define({combine:t?e=>e.concat(t):void 0})}u(r7,"defineLanguageFacet");const ub=new ue,R4=class R4{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Xe.prototype.hasOwnProperty("tree")||Object.defineProperty(Xe.prototype,"tree",{get(){return ze(this)}}),this.parser=n,this.extension=[Pi.of(this),Xe.languageData.of((l,a,o)=>{let s=i7(l,a,o),c=s.type.prop(Wa);if(!c)return[];let d=l.facet(c),f=s.type.prop(ub);if(f){let h=s.resolve(a-s.from,o);for(let p of f)if(p.test(h,l)){let m=l.facet(p.facet);return p.type=="replace"?m:m.concat(d)}}return d})].concat(r)}isActiveAt(e,n,r=-1){return i7(e,n,r).type.prop(Wa)==this.data}findRegions(e){let n=e.facet(Pi);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=u((l,a)=>{if(l.prop(Wa)==this.data){r.push({from:a,to:a+l.length});return}let o=l.prop(ue.mounted);if(o){if(o.tree.prop(Wa)==this.data){if(o.overlay)for(let s of o.overlay)r.push({from:s.from+a,to:s.to+a});else r.push({from:a,to:a+l.length});return}else if(o.overlay){let s=r.length;if(i(o.tree,o.overlay[0].from+a),r.length>s)return}}for(let s=0;sr.isTop?n:void 0)]}),e.name)}configure(e,n){return new Oc(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};u(Oc,"LRLanguage");let iu=Oc;function ze(t){let e=t.field(tn.state,!1);return e?e.tree:Le.empty}u(ze,"syntaxTree");const V4=class V4{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}};u(V4,"DocInput");let cb=V4,lu=null,Oj=(Kl=class{constructor(e,n,r=[],i,l,a,o,s){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=l,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Kl(e,n,[],Le.empty,0,r,[],null)}startParse(){return this.parser.startParse(new cb(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Le.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=u(()=>Date.now()>i,"until")}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ci.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=lu;lu=this;try{return e()}finally{lu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=l7(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:l,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let s=[];if(e.iterChangedRanges((c,d,f,h)=>s.push({fromA:c,toA:d,fromB:f,toB:h})),r=Ci.applyChanges(r,s),i=Le.empty,l=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);de.from&&(this.fragments=l7(this.fragments,i,l),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends If{createParse(n,r,i){let l=i[0].from,a=i[i.length-1].to;return{parsedPos:l,advance(){let s=lu;if(s){for(let c of i)s.tempSkipped.push(c);e&&(s.scheduleOn=s.scheduleOn?Promise.all([s.scheduleOn,e]):e)}return this.parsedPos=a,new Le(en.none,[],[],a-l)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return lu}},u(Kl,"ParseContext"),Kl);function l7(t,e,n){return Ci.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}u(l7,"cutFragments");const bc=class bc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new bc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Oj.create(e.facet(Pi).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new bc(r)}};u(bc,"LanguageState");let au=bc;tn.state=Gt.define({create:au.init,update(t,e){for(let n of e.effects)if(n.is(tn.setState))return n.value;return e.startState.facet(Pi)!=e.state.facet(Pi)?au.init(e.state):t.apply(e)}});let a7=u(t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)},"requestIdle");typeof requestIdleCallback<"u"&&(a7=u(t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)},"requestIdle"));const db=typeof navigator<"u"&&(!((sb=navigator.scheduling)===null||sb===void 0)&&sb.isInputPending)?()=>navigator.scheduling.isInputPending():null,bj=it.fromClass((yc=class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(tn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(tn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=a7(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,s=l.context.work(()=>db&&db()||Date.now()>a,i+(o?0:1e5));this.chunkBudget-=Date.now()-n,(s||this.chunkBudget<=0)&&(l.context.takeTree(),this.view.dispatch({effects:tn.setState.of(new au(l.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(l.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ht(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},u(yc,"ParseWorker"),yc),{eventHandlers:{focus(){this.scheduleWork()}}}),Pi=_.define({combine(t){return t.length?t[0]:null},enables:t=>[tn.state,bj,J.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),N4=class N4{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};u(N4,"LanguageSupport");let ou=N4;const yj=_.define(),su=_.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Yf(t){let e=t.facet(su);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}u(Yf,"getIndentUnit");function uu(t,e){let n="",r=t.tabSize,i=t.facet(su)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let l=0;l=e?vj(t,n,e):null}u(fb,"getIndentation");const F4=class F4{constructor(e,n={}){this.state=e,this.options=n,this.unit=Yf(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:l}=this.options;return i!=null&&i>=r.from&&i<=r.to?l&&i==e?{text:"",from:e}:(n<0?i-1&&(l+=a-this.countColumn(r,r.search(/\S|$/))),l}countColumn(e,n=e.length){return Na(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),l=this.options.overrideIndentation;if(l){let a=l(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}};u(F4,"IndentContext");let Ya=F4;const Kf=new ue;function vj(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let l=[];for(let a=i;a&&!(a.fromr.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)l.push(a);for(let a=l.length-1;a>=0;a--)r={node:l[a],next:r}}return o7(r,t,n)}u(vj,"syntaxIndentation");function o7(t,e,n){for(let r=t;r;r=r.next){let i=wj(r.node);if(i)return i(hb.create(e,n,r))}return 0}u(o7,"indentFor");function $j(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}u($j,"ignoreClosed");function wj(t){let e=t.type.prop(Kf);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(ue.closedBy))){let i=t.lastChild,l=i&&r.indexOf(i.name)>-1;return a=>s7(a,!0,1,void 0,l&&!$j(a)?i.from:void 0)}return t.parent==null?xj:null}u(wj,"indentStrategy");function xj(){return 0}u(xj,"topIndent");const Zp=class Zp extends Ya{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Zp(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Sj(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return o7(this.context.next,this.base,this.pos)}};u(Zp,"TreeIndentContext");let hb=Zp;function Sj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}u(Sj,"isParent");function Cj(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,l=t.state.doc.lineAt(n.from),a=i==null||i<=l.from?l.to:Math.min(l.to,i);for(let o=n.to;;){let s=e.childAfter(o);if(!s||s==r)return null;if(!s.type.isSkipped){if(s.from>=a)return null;let c=/^ */.exec(l.text.slice(n.to-l.from))[0].length;return{from:n.from,to:n.to+c}}o=s.to}}u(Cj,"bracketedAligned");function kj({closing:t,align:e=!0,units:n=1}){return r=>s7(r,e,n,t)}u(kj,"delimitedIndent");function s7(t,e,n,r,i){let l=t.textAfter,a=l.match(/^\s*/)[0].length,o=r&&l.slice(a,a+r.length)==r||i==t.pos+a,s=e?Cj(t):null;return s?o?t.column(s.from):t.column(s.to):t.baseIndent+(o?0:t.unit*n)}u(s7,"delimitedStrategy");const Dj=u(t=>t.baseIndent,"flatIndent");function Uf({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}u(Uf,"continuedIndent");const Pj=200;function Ej(){return Xe.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+Pj)return t;let l=n.sliceString(i.from,r);if(!e.some(c=>c.test(l)))return t;let{state:a}=t,o=-1,s=[];for(let{head:c}of a.selection.ranges){let d=a.doc.lineAt(c);if(d.from==o)continue;o=d.from;let f=fb(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],p=uu(a,f);h!=p&&s.push({from:d.from,to:d.from+h.length,insert:p})}return s.length?[t,{changes:s,sequential:!0}]:t})}u(Ej,"indentOnInput");const Tj=_.define(),Gf=new ue;function u7(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(l&&o.from=e&&c.to>n&&(l=c)}}return l}u(Aj,"syntaxFolding");function Qj(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}u(Qj,"isUnfinished");function _f(t,e,n){for(let r of t.facet(Tj)){let i=r(t,e,n);if(i)return i}return Aj(t,e,n)}u(_f,"foldable");function c7(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}u(c7,"mapRange");const Hf=Oe.define({map:c7}),cu=Oe.define({map:c7});function d7(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}u(d7,"selectedLines");const wl=Gt.define({create(){return re.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=f7(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Hf)&&!Mj(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(pb),i=r?re.replace({widget:new mb(r(e.state,n.value))}):O7;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(cu)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=f7(t,e.selection.main.head)),t},provide:t=>J.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{ie&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,l)=>i>=n||l<=e}):t}u(f7,"clearTouchedFolds");function Jf(t,e,n){var r;let i=null;return(r=t.field(wl,!1))===null||r===void 0||r.between(e,n,(l,a)=>{(!i||i.from>l)&&(i={from:l,to:a})}),i}u(Jf,"findFold");function Mj(t,e,n){let r=!1;return t.between(e,e,(i,l)=>{i==e&&l==n&&(r=!0)}),r}u(Mj,"foldExists");function h7(t,e){return t.field(wl,!1)?e:e.concat(Oe.appendConfig.of(m7()))}u(h7,"maybeEnable");const Bj=u(t=>{for(let e of d7(t)){let n=_f(t.state,e.from,e.to);if(n)return t.dispatch({effects:h7(t.state,[Hf.of(n),p7(t,n)])}),!0}return!1},"foldCode"),Rj=u(t=>{if(!t.state.field(wl,!1))return!1;let e=[];for(let n of d7(t)){let r=Jf(t.state,n.from,n.to);r&&e.push(cu.of(r),p7(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0},"unfoldCode");function p7(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return J.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}u(p7,"announceFold");const Vj=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Bj},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Rj},{key:"Ctrl-Alt-[",run:u(t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(wl,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(cu.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},"unfoldAll")}],Nj={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},pb=_.define({combine(t){return bi(t,Nj)}});function m7(t){let e=[wl,Lj];return t&&e.push(pb.of(t)),e}u(m7,"codeFolding");function g7(t,e){let{state:n}=t,r=n.facet(pb),i=u(a=>{let o=t.lineBlockAt(t.posAtDOM(a.target)),s=Jf(t.state,o.from,o.to);s&&t.dispatch({effects:cu.of(s)}),a.preventDefault()},"onclick");if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let l=document.createElement("span");return l.textContent=r.placeholderText,l.setAttribute("aria-label",n.phrase("folded code")),l.title=n.phrase("unfold"),l.className="cm-foldPlaceholder",l.onclick=i,l}u(g7,"widgetToDOM");const O7=re.replace({widget:new class extends er{toDOM(t){return g7(t,null)}}}),I4=class I4 extends er{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return g7(e,this.value)}};u(I4,"PreparedFoldWidget");let mb=I4;const Fj={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},L4=class L4 extends Qn{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}};u(L4,"FoldMarker");let du=L4;function Ij(t={}){let e={...Fj,...t},n=new du(e,!0),r=new du(e,!1),i=it.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(Pi)!=a.state.facet(Pi)||a.startState.field(wl,!1)!=a.state.field(wl,!1)||ze(a.startState)!=ze(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let o=new fl;for(let s of a.viewportLineBlocks){let c=Jf(a.state,s.from,s.to)?r:_f(a.state,s.from,s.to)?n:null;c&&o.add(s.from,s.from,c)}return o.finish()}}),{domEventHandlers:l}=e;return[i,SX({class:"cm-foldGutter",markers(a){var o;return((o=a.plugin(i))===null||o===void 0?void 0:o.markers)||Te.empty},initialSpacer(){return new du(e,!1)},domEventHandlers:{...l,click:(a,o,s)=>{if(l.click&&l.click(a,o,s))return!0;let c=Jf(a.state,o.from,o.to);if(c)return a.dispatch({effects:cu.of(c)}),!0;let d=_f(a.state,o.from,o.to);return d?(a.dispatch({effects:Hf.of(d)}),!0):!1}}}),m7()]}u(Ij,"foldGutter");const Lj=J.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),Xp=class Xp{constructor(e,n){this.specs=e;let r;function i(o){let s=_n.newName();return(r||(r=Object.create(null)))["."+s]=o,s}u(i,"def");const l=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof tn?o=>o.prop(Wa)==a.data:a?o=>o==a:void 0,this.style=e7(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:l}).style,this.module=r?new _n(r):null,this.themeType=n.themeType}static define(e,n){return new Xp(e,n||{})}};u(Xp,"HighlightStyle");let eh=Xp;const gb=_.define(),b7=_.define({combine(t){return t.length?[t[0]]:null}});function Ob(t){let e=t.facet(gb);return e.length?e:t.facet(b7)}u(Ob,"getHighlighters");function zj(t,e){let n=[Zj],r;return t instanceof eh&&(t.module&&n.push(J.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(b7.of(t)):r?n.push(gb.computeN([J.darkTheme],i=>i.facet(J.darkTheme)==(r=="dark")?[t]:[])):n.push(gb.of(t)),n}u(zj,"syntaxHighlighting");const z4=class z4{constructor(e){this.markCache=Object.create(null),this.tree=ze(e.state),this.decorations=this.buildDeco(e,Ob(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ze(e.state),r=Ob(e.state),i=r!=Ob(e.startState),{viewport:l}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=l.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=l.to)}buildDeco(e,n){if(!n||!this.tree.length)return re.none;let r=new fl;for(let{from:i,to:l}of e.visibleRanges)mj(this.tree,n,(a,o,s)=>{r.add(a,o,this.markCache[s]||(this.markCache[s]=re.mark({class:s})))},i,l);return r.finish()}};u(z4,"TreeHighlighter");let bb=z4;const Zj=dl.high(it.fromClass(bb,{decorations:t=>t.decorations})),Xj=eh.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),jj=J.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),y7=1e4,v7="()[]{}",$7=_.define({combine(t){return bi(t,{afterCursor:!0,brackets:v7,maxScanDistance:y7,renderMatch:Yj})}}),qj=re.mark({class:"cm-matchingBracket"}),Wj=re.mark({class:"cm-nonmatchingBracket"});function Yj(t){let e=[],n=t.matched?qj:Wj;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}u(Yj,"defaultRenderMatch");const Kj=[Gt.define({create(){return re.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet($7);for(let i of e.state.selection.ranges){if(!i.empty)continue;let l=sr(e.state,i.head,-1,r)||i.head>0&&sr(e.state,i.head-1,1,r)||r.afterCursor&&(sr(e.state,i.head,1,r)||i.headJ.decorations.from(t)}),jj];function Uj(t={}){return[$7.of(t),Kj]}u(Uj,"bracketMatching");const w7=new ue;function yb(t,e,n){let r=t.prop(e<0?ue.openedBy:ue.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}u(yb,"matchingNodes");function vb(t){let e=t.type.prop(w7);return e?e(t.node):t}u(vb,"findHandle");function sr(t,e,n,r={}){let i=r.maxScanDistance||y7,l=r.brackets||v7,a=ze(t),o=a.resolveInner(e,n);for(let s=o;s;s=s.parent){let c=yb(s.type,n,l);if(c&&s.from0?e>=d.from&&ed.from&&e<=d.to))return Gj(t,e,n,s,d,c,l)}}return _j(t,e,n,a,o.type,i,l)}u(sr,"matchBrackets");function Gj(t,e,n,r,i,l,a){let o=r.parent,s={from:i.from,to:i.to},c=0,d=o?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(c==0&&l.indexOf(d.type.name)>-1&&d.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=l;){let p=d.value;n<0&&(h+=p.length);let m=e+h*n;for(let g=n>0?0:p.length-1,O=n>0?p.length:-1;g!=O;g+=n){let b=a.indexOf(p[g]);if(!(b<0||r.resolveInner(m+g,1).type!=i))if(b%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:m+g,to:m+g+1},matched:b>>1==s>>1};f--}}n>0&&(h+=p.length)}return d.done?{start:c,matched:!1}:null}u(_j,"matchPlainBrackets");const Hj=Object.create(null),x7=[en.none],S7=[],C7=Object.create(null),Jj=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Jj[t]=eq(Hj,e);function $b(t,e){S7.indexOf(t)>-1||(S7.push(t),console.warn(e))}u($b,"warnForPart");function eq(t,e){let n=[];for(let o of e.split(" ")){let s=[];for(let c of o.split(".")){let d=t[c]||V[c];d?typeof d=="function"?s.length?s=s.map(d):$b(c,`Modifier ${c} used at start of tag`):s.length?$b(c,`Tag ${c} used as modifier`):s=Array.isArray(d)?d:[d]:$b(c,`Unknown highlighting tag ${c}`)}for(let c of s)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(o=>o.id),l=C7[i];if(l)return l.id;let a=C7[i]=en.define({id:x7.length,name:r,props:[Xf({[r]:n})]});return x7.push(a),a.id}u(eq,"createTokenType"),Ve.RTL,Ve.LTR;const tq=u(t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=xb(t.state,n.from);return r.line?nq(t):r.block?iq(t):!1},"toggleComment");function wb(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}u(wb,"command");const nq=wb(oq,0),rq=wb(k7,0),iq=wb((t,e)=>k7(t,e,aq(e)),0);function xb(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}u(xb,"getConfig");const fu=50;function lq(t,{open:e,close:n},r,i){let l=t.sliceDoc(r-fu,r),a=t.sliceDoc(i,i+fu),o=/\s*$/.exec(l)[0].length,s=/^\s*/.exec(a)[0].length,c=l.length-o;if(l.slice(c-e.length,c)==e&&a.slice(s,s+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:i+s,margin:s&&1}};let d,f;i-r<=2*fu?d=f=t.sliceDoc(r,i):(d=t.sliceDoc(r,r+fu),f=t.sliceDoc(i-fu,i));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-n.length;return d.slice(h,h+e.length)==e&&f.slice(m,m+n.length)==n?{open:{pos:r+h+e.length,margin:/\s/.test(d.charAt(h+e.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}u(lq,"findBlockComment");function aq(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let l=e.length-1;l>=0&&e[l].to>r.from?e[l].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}u(aq,"selectedLineRanges");function k7(t,e,n=e.selection.ranges){let r=n.map(l=>xb(e,l.from).block);if(!r.every(l=>l))return null;let i=n.map((l,a)=>lq(e,r[a],l.from,l.to));if(t!=2&&!i.every(l=>l))return{changes:e.changes(n.map((l,a)=>i[a]?[]:[{from:l.from,insert:r[a].open+" "},{from:l.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(l=>l)){let l=[];for(let a=0,o;ai&&(l==a||a>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+c.length)==c?h:-1;hl.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:o,token:s,indent:c,empty:d,single:f}of r)(f||!d)&&l.push({from:o.from+c,insert:s+" "});let a=e.changes(l);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(l=>l.comment>=0)){let l=[];for(let{line:a,comment:o,token:s}of r)if(o>=0){let c=a.from+o,d=c+s.length;a.text[d-a.from]==" "&&d++,l.push({from:c,to:d})}return{changes:l}}return null}u(oq,"changeLineComment");const Sb=Tn.define(),sq=Tn.define(),uq=_.define(),D7=_.define({combine(t){return bi(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),P7=Gt.define({create(){return hu.empty},update(t,e){let n=e.state.facet(D7),r=e.annotation(Sb);if(r){let s=Bn.fromTransaction(e,r.selection),c=r.side,d=c==0?t.undone:t.done;return s?d=nh(d,d.length,n.minDepth,s):d=A7(d,e.startState.selection),new hu(c==0?r.rest:d,c==0?d:r.rest)}let i=e.annotation(sq);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(xt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let l=Bn.fromTransaction(e),a=e.annotation(xt.time),o=e.annotation(xt.userEvent);return l?t=t.addChanges(l,a,o,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,o,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new hu(t.done.map(Bn.fromJSON),t.undone.map(Bn.fromJSON))}});function cq(t={}){return[P7,D7.of(t),J.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?E7:e.inputType=="historyRedo"?Cb:null;return r?(e.preventDefault(),r(n)):!1}})]}u(cq,"history$1");function th(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(P7,!1);if(!i)return!1;let l=i.pop(t,n,e);return l?(r(l),!0):!1}}u(th,"cmd");const E7=th(0,!1),Cb=th(1,!1),dq=th(0,!0),fq=th(1,!0),Ul=class Ul{constructor(e,n,r,i,l){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=l}setSelAfter(e){return new Ul(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ul(e.changes&&Ut.fromJSON(e.changes),[],e.mapped&&gi.fromJSON(e.mapped),e.startSelection&&X.fromJSON(e.startSelection),e.selectionsAfter.map(X.fromJSON))}static fromTransaction(e,n){let r=vn;for(let i of e.startState.facet(uq)){let l=i(e);l.length&&(r=r.concat(l))}return!r.length&&e.changes.empty?null:new Ul(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,vn)}static selection(e){return new Ul(void 0,vn,void 0,void 0,e)}};u(Ul,"HistEvent");let Bn=Ul;function nh(t,e,n,r){let i=e+1>n+20?e-n-1:0,l=t.slice(i,e);return l.push(r),l}u(nh,"updateBranch");function hq(t,e){let n=[],r=!1;return t.iterChangedRanges((i,l)=>n.push(i,l)),e.iterChangedRanges((i,l,a,o)=>{for(let s=0;s=c&&a<=d&&(r=!0)}}),r}u(hq,"isAdjacent");function pq(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}u(pq,"eqSelectionShape");function T7(t,e){return t.length?e.length?t.concat(e):t:e}u(T7,"conc");const vn=[],mq=200;function A7(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-mq));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),nh(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Bn.selection([e])]}u(A7,"addSelection");function gq(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}u(gq,"popSelection");function kb(t,e){if(!t.length)return t;let n=t.length,r=vn;for(;n;){let i=Oq(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let l=t.slice(0,n);return l[n-1]=i,l}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Bn.selection(r)]:vn}u(kb,"addMappingToBranch");function Oq(t,e,n){let r=T7(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):vn,n);if(!t.changes)return Bn.selection(r);let i=t.changes.map(e),l=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(l):l;return new Bn(i,Oe.mapEffects(t.effects,e),a,t.startSelection.map(l),r)}u(Oq,"mapEvent");const bq=/^(input\.type|delete)($|\.)/;let hu=(ei=class{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new ei(this.done,this.undone):this}addChanges(e,n,r,i,l){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||bq.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):rh(n,e))}u(Q7,"cursorByChar");function ht(t){return t.textDirectionAt(t.state.selection.main.head)==Ve.LTR}u(ht,"ltrAtCursor");const M7=u(t=>Q7(t,!ht(t)),"cursorCharLeft"),B7=u(t=>Q7(t,ht(t)),"cursorCharRight");function R7(t,e){return Vn(t,n=>n.empty?t.moveByGroup(n,e):rh(n,e))}u(R7,"cursorByGroup");const vq=u(t=>R7(t,!ht(t)),"cursorGroupLeft"),$q=u(t=>R7(t,ht(t)),"cursorGroupRight");function wq(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}u(wq,"interestingNode");function ih(t,e,n){let r=ze(t).resolveInner(e.head),i=n?ue.closedBy:ue.openedBy;for(let s=e.head;;){let c=n?r.childAfter(s):r.childBefore(s);if(!c)break;wq(t,c,i)?r=c:s=n?c.to:c.from}let l=r.type.prop(i),a,o;return l&&(a=n?sr(t,r.from,1):sr(t,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,X.cursor(o,n?-1:1)}u(ih,"moveBySyntax");const xq=u(t=>Vn(t,e=>ih(t.state,e,!ht(t))),"cursorSyntaxLeft"),Sq=u(t=>Vn(t,e=>ih(t.state,e,ht(t))),"cursorSyntaxRight");function V7(t,e){return Vn(t,n=>{if(!n.empty)return rh(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}u(V7,"cursorByLine");const N7=u(t=>V7(t,!1),"cursorLineUp"),F7=u(t=>V7(t,!0),"cursorLineDown");function I7(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):rh(a,e));if(i.eq(r.selection))return!1;let l;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;a&&a.top>s&&a.bottomL7(t,!1),"cursorPageUp"),Db=u(t=>L7(t,!0),"cursorPageDown");function Ei(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let l=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;l&&e.head!=r.from+l&&(i=X.cursor(r.from+l))}return i}u(Ei,"moveByLineBoundary");const Cq=u(t=>Vn(t,e=>Ei(t,e,!0)),"cursorLineBoundaryForward"),kq=u(t=>Vn(t,e=>Ei(t,e,!1)),"cursorLineBoundaryBackward"),Dq=u(t=>Vn(t,e=>Ei(t,e,!ht(t))),"cursorLineBoundaryLeft"),Pq=u(t=>Vn(t,e=>Ei(t,e,ht(t))),"cursorLineBoundaryRight"),Eq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).from,1)),"cursorLineStart"),Tq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).to,-1)),"cursorLineEnd");function Aq(t,e,n){let r=!1,i=Ka(t.selection,l=>{let a=sr(t,l.head,-1)||sr(t,l.head,1)||l.head>0&&sr(t,l.head-1,1)||l.headAq(t,e,!1),"cursorMatchingBracket");function $n(t,e){let n=Ka(t.state.selection,r=>{let i=e(r);return X.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Rn(t.state,n)),!0)}u($n,"extendSel");function Z7(t,e){return $n(t,n=>t.moveByChar(n,e))}u(Z7,"selectByChar");const X7=u(t=>Z7(t,!ht(t)),"selectCharLeft"),j7=u(t=>Z7(t,ht(t)),"selectCharRight");function q7(t,e){return $n(t,n=>t.moveByGroup(n,e))}u(q7,"selectByGroup");const Mq=u(t=>q7(t,!ht(t)),"selectGroupLeft"),Bq=u(t=>q7(t,ht(t)),"selectGroupRight"),Rq=u(t=>$n(t,e=>ih(t.state,e,!ht(t))),"selectSyntaxLeft"),Vq=u(t=>$n(t,e=>ih(t.state,e,ht(t))),"selectSyntaxRight");function W7(t,e){return $n(t,n=>t.moveVertically(n,e))}u(W7,"selectByLine");const Y7=u(t=>W7(t,!1),"selectLineUp"),K7=u(t=>W7(t,!0),"selectLineDown");function U7(t,e){return $n(t,n=>t.moveVertically(n,e,I7(t).height))}u(U7,"selectByPage");const G7=u(t=>U7(t,!1),"selectPageUp"),_7=u(t=>U7(t,!0),"selectPageDown"),Nq=u(t=>$n(t,e=>Ei(t,e,!0)),"selectLineBoundaryForward"),Fq=u(t=>$n(t,e=>Ei(t,e,!1)),"selectLineBoundaryBackward"),Iq=u(t=>$n(t,e=>Ei(t,e,!ht(t))),"selectLineBoundaryLeft"),Lq=u(t=>$n(t,e=>Ei(t,e,ht(t))),"selectLineBoundaryRight"),zq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).from)),"selectLineStart"),Zq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).to)),"selectLineEnd"),H7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:0})),!0),"cursorDocStart"),J7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.doc.length})),!0),"cursorDocEnd"),eA=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:0})),!0),"selectDocStart"),tA=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),"selectDocEnd"),Xq=u(({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),"selectAll$1"),jq=u(({state:t,dispatch:e})=>{let n=ah(t).map(({from:r,to:i})=>X.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:X.create(n),userEvent:"select"})),!0},"selectLine"),qq=u(({state:t,dispatch:e})=>{let n=Ka(t.selection,r=>{let i=ze(t),l=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=l.node.from&&a.node.to<=l.node.to&&(l=a)}for(let a=l;a;a=a.next){let{node:o}=a;if((o.from=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return X.range(o.to,o.from)}return r});return n.eq(t.selection)?!1:(e(Rn(t,n)),!0)},"selectParentSyntax");function nA(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let l of n.selection.ranges){let a=n.doc.lineAt(l.head);if(e?a.to0)for(let o=l;;){let s=t.moveVertically(o,e);if(s.heada.to){i.some(c=>c.head==s.head)||i.push(s);break}else{if(s.head==o.head)break;o=s}}}return i.length==r.ranges.length?!1:(t.dispatch(Rn(n,X.create(i,i.length-1))),!0)}u(nA,"addCursorVertically");const Wq=u(t=>nA(t,!1),"addCursorAbove"),Yq=u(t=>nA(t,!0),"addCursorBelow"),Kq=u(({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=X.create([n.main]):n.main.empty||(r=X.create([X.cursor(n.main.head)])),r?(e(Rn(t,r)),!0):!1},"simplifySelection");function pu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(l=>{let{from:a,to:o}=l;if(a==o){let s=e(l);sa&&(n="delete.forward",s=lh(t,s,!0)),a=Math.min(a,s),o=Math.max(o,s)}else a=lh(t,a,!1),o=lh(t,o,!0);return a==o?{range:l}:{changes:{from:a,to:o},range:X.cursor(a,ai(t)))r.between(e,e,(i,l)=>{ie&&(e=n?l:i)});return e}u(lh,"skipAtomic");const rA=u((t,e,n)=>pu(t,r=>{let i=r.from,{state:l}=t,a=l.doc.lineAt(i),o,s;if(n&&!e&&i>a.from&&irA(t,!1,!0),"deleteCharBackward"),iA=u(t=>rA(t,!0,!1),"deleteCharForward"),lA=u((t,e)=>pu(t,n=>{let r=n.head,{state:i}=t,l=i.doc.lineAt(r),a=i.charCategorizer(r);for(let o=null;;){if(r==(e?l.to:l.from)){r==n.head&&l.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let s=wt(l.text,r-l.from,e)+l.from,c=l.text.slice(Math.min(r,s)-l.from,Math.max(r,s)-l.from),d=a(c);if(o!=null&&d!=o)break;(c!=" "||r!=n.head)&&(o=d),r=s}return r}),"deleteByGroup"),aA=u(t=>lA(t,!1),"deleteGroupBackward"),Uq=u(t=>lA(t,!0),"deleteGroupForward"),Gq=u(t=>pu(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headpu(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),"deleteLineBoundaryBackward"),Hq=u(t=>pu(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:pe.of(["",""])},range:X.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},"splitLine"),eW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,l=t.doc.lineAt(i),a=i==l.from?i-1:wt(l.text,i-l.from,!1)+l.from,o=i==l.to?i+1:wt(l.text,i-l.from,!0)+l.from;return{changes:{from:a,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(a,i))},range:X.cursor(o)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)},"transposeChars");function ah(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),l=t.doc.lineAt(r.to);if(!r.empty&&r.to==l.from&&(l=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=l.to,a.ranges.push(r)}else e.push({from:i.from,to:l.to,ranges:[r]});n=l.number+1}return e}u(ah,"selectedLineBlocks");function oA(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let l of ah(t)){if(n?l.to==t.doc.length:l.from==0)continue;let a=t.doc.lineAt(n?l.to+1:l.from-1),o=a.length+1;if(n){r.push({from:l.to,to:a.to},{from:l.from,insert:a.text+t.lineBreak});for(let s of l.ranges)i.push(X.range(Math.min(t.doc.length,s.anchor+o),Math.min(t.doc.length,s.head+o)))}else{r.push({from:a.from,to:l.from},{from:l.to,insert:t.lineBreak+a.text});for(let s of l.ranges)i.push(X.range(s.anchor-o,s.head-o))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:X.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}u(oA,"moveLine");const tW=u(({state:t,dispatch:e})=>oA(t,e,!1),"moveLineUp"),nW=u(({state:t,dispatch:e})=>oA(t,e,!0),"moveLineDown");function sA(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of ah(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}u(sA,"copyLine");const rW=u(({state:t,dispatch:e})=>sA(t,e,!1),"copyLineUp"),iW=u(({state:t,dispatch:e})=>sA(t,e,!0),"copyLineDown"),lW=u(t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ah(e).map(({from:i,to:l})=>(i>0?i--:l{let l;if(t.lineWrapping){let a=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(l=a.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,l)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},"deleteLine");function aW(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ze(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),l;return r&&i&&r.to<=e&&i.from>=e&&(l=r.type.prop(ue.closedBy))&&l.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}u(aW,"isBetweenBrackets");const uA=cA(!1),oW=cA(!0);function cA(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:l,to:a}=i,o=e.doc.lineAt(l),s=!t&&l==a&&aW(e,l);t&&(l=a=(a<=o.to?o:e.doc.lineAt(a)).to);let c=new Ya(e,{simulateBreak:l,simulateDoubleBreak:!!s}),d=fb(c,l);for(d==null&&(d=Na(/^\s*/.exec(e.doc.lineAt(l).text)[0],e.tabSize));ao.from&&l{let i=[];for(let a=r.from;a<=r.to;){let o=t.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(e(o,i,r),n=o.number),a=o.to+1}let l=t.changes(i);return{changes:i,range:X.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}u(Eb,"changeBySelectedLine");const sW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Ya(t,{overrideIndentation:l=>{let a=n[l];return a??-1}}),i=Eb(t,(l,a,o)=>{let s=fb(r,l.from);if(s==null)return;/\S/.test(l.text)||(s=0);let c=/^\s*/.exec(l.text)[0],d=uu(t,s);(c!=d||o.fromt.readOnly?!1:(e(t.update(Eb(t,(n,r)=>{r.push({from:n.from,insert:t.facet(su)})}),{userEvent:"input.indent"})),!0),"indentMore"),fA=u(({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Eb(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let l=Na(i,t.tabSize),a=0,o=uu(t,Math.max(0,l-Yf(t)));for(;a(t.setTabFocusMode(),!0),"toggleTabFocusMode"),cW=[{key:"Ctrl-b",run:M7,shift:X7,preventDefault:!0},{key:"Ctrl-f",run:B7,shift:j7},{key:"Ctrl-p",run:N7,shift:Y7},{key:"Ctrl-n",run:F7,shift:K7},{key:"Ctrl-a",run:Eq,shift:zq},{key:"Ctrl-e",run:Tq,shift:Zq},{key:"Ctrl-d",run:iA},{key:"Ctrl-h",run:Pb},{key:"Ctrl-k",run:Gq},{key:"Ctrl-Alt-h",run:aA},{key:"Ctrl-o",run:Jq},{key:"Ctrl-t",run:eW},{key:"Ctrl-v",run:Db}],dW=[{key:"ArrowLeft",run:M7,shift:X7,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:vq,shift:Mq,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Dq,shift:Iq,preventDefault:!0},{key:"ArrowRight",run:B7,shift:j7,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:$q,shift:Bq,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Pq,shift:Lq,preventDefault:!0},{key:"ArrowUp",run:N7,shift:Y7,preventDefault:!0},{mac:"Cmd-ArrowUp",run:H7,shift:eA},{mac:"Ctrl-ArrowUp",run:z7,shift:G7},{key:"ArrowDown",run:F7,shift:K7,preventDefault:!0},{mac:"Cmd-ArrowDown",run:J7,shift:tA},{mac:"Ctrl-ArrowDown",run:Db,shift:_7},{key:"PageUp",run:z7,shift:G7},{key:"PageDown",run:Db,shift:_7},{key:"Home",run:kq,shift:Fq,preventDefault:!0},{key:"Mod-Home",run:H7,shift:eA},{key:"End",run:Cq,shift:Nq,preventDefault:!0},{key:"Mod-End",run:J7,shift:tA},{key:"Enter",run:uA,shift:uA},{key:"Mod-a",run:Xq},{key:"Backspace",run:Pb,shift:Pb,preventDefault:!0},{key:"Delete",run:iA,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:aA,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Uq,preventDefault:!0},{mac:"Mod-Backspace",run:_q,preventDefault:!0},{mac:"Mod-Delete",run:Hq,preventDefault:!0}].concat(cW.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),fW=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:xq,shift:Rq},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Sq,shift:Vq},{key:"Alt-ArrowUp",run:tW},{key:"Shift-Alt-ArrowUp",run:rW},{key:"Alt-ArrowDown",run:nW},{key:"Shift-Alt-ArrowDown",run:iW},{key:"Mod-Alt-ArrowUp",run:Wq},{key:"Mod-Alt-ArrowDown",run:Yq},{key:"Escape",run:Kq},{key:"Mod-Enter",run:oW},{key:"Alt-l",mac:"Ctrl-l",run:jq},{key:"Mod-i",run:qq,preventDefault:!0},{key:"Mod-[",run:fA},{key:"Mod-]",run:dA},{key:"Mod-Alt-\\",run:sW},{key:"Shift-Mod-k",run:lW},{key:"Shift-Mod-\\",run:Qq},{key:"Mod-/",run:tq},{key:"Alt-A",run:rq},{key:"Ctrl-m",mac:"Shift-Alt-m",run:uW}].concat(dW),hW={key:"Tab",run:dA,shift:fA},Z4=class Z4{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ze(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),l=i.search(mA(e,!1));return l<0?null:{from:r+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}};u(Z4,"CompletionContext");let oh=Z4;function hA(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}u(hA,"toSet");function pW(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:pW(e);return i=>{let l=i.matchBefore(r);return l||i.explicit?{from:l?l.from:i.pos,options:e,validFor:n}:null}}u(pA,"completeFromList");function mW(t,e){return n=>{for(let r=ze(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}u(mW,"ifNotIn");const X4=class X4{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}};u(X4,"Option");let sh=X4;function xl(t){return t.selection.main.from}u(xl,"cur");function mA(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",l=r[r.length-1]!="$";return!i&&!l?t:new RegExp(`${i?"^":""}(?:${r})${l?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}u(mA,"ensureAnchor");const Tb=Tn.define();function gW(t,e,n,r){let{main:i}=t.selection,l=n-i.from,a=r-i.from;return{...t.changeByRange(o=>{if(o!=i&&n!=r&&t.sliceDoc(o.from+l,o.from+a)!=t.sliceDoc(n,r))return{range:o};let s=t.toText(e);return{changes:{from:o.from+l,to:r==i.from?o.to:o.from+a,insert:s},range:X.cursor(o.from+l+s.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}u(gW,"insertCompletionText");const gA=new WeakMap;function OW(t){if(!Array.isArray(t))return t;let e=gA.get(t);return e||gA.set(t,e=pA(t)),e}u(OW,"asSource");const uh=Oe.define(),mu=Oe.define(),j4=class j4{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(x=C0(S))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!y||C==1&&O||v==0&&C!=0)&&(n[f]==S||r[f]==S&&(h=!0)?a[f++]=y:a.length&&(b=!1)),v=C,y+=Gn(S)}return f==s&&a[0]==0&&b?this.result(-100+(h?-200:0),a,e):p==s&&m==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):p==s?this.ret(-900-e.length,[m,g]):f==s?this.result(-100+(h?-200:0)+-700+(b?0:-1100),a,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],l=0;for(let a of n){let o=a+(this.astral?Gn(Ft(r,a)):1);l&&i[l-1]==a?i[l-1]=o:(i[l++]=a,i[l++]=o)}return this.ret(e-r.length,i)}};u(j4,"FuzzyMatcher");let Ab=j4;const q4=class q4{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:bW,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>OA(e(r),n(r)),optionClass:(e,n)=>r=>OA(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function OA(t,e){return t?e?t+" "+e:t:e}u(OA,"joinClass");function bW(t,e,n,r,i,l){let a=t.textDirection==Ve.RTL,o=a,s=!1,c="top",d,f,h=e.left-i.left,p=i.right-e.right,m=r.right-r.left,g=r.bottom-r.top;if(o&&h=g||y>e.top?d=n.bottom-e.top:(c="bottom",d=e.bottom-n.top)}let O=(e.bottom-e.top)/l.offsetHeight,b=(e.right-e.left)/l.offsetWidth;return{style:`${c}: ${d/O}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(s?a?"left-narrow":"right-narrow":o?"left":"right")}}u(bW,"defaultPositionInfo");function yW(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,l){let a=document.createElement("span");a.className="cm-completionLabel";let o=n.displayLabel||n.label,s=0;for(let c=0;cs&&a.appendChild(document.createTextNode(o.slice(s,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(o.slice(d,f))),h.className="cm-completionMatchedText",s=f}return sn.position-r.position).map(n=>n.render)}u(yW,"optionContent");function Mb(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}u(Mb,"rangeAroundSelected");const W4=class W4{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:s=>this.placeInfo(s),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:l,selected:a}=i.open,o=e.state.facet(He);this.optionContent=yW(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Mb(l.length,a,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",s=>{let{options:c}=e.state.field(n).open;for(let d=s.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(He).closeOnBlur&&s.relatedTarget!=e.contentDOM&&e.dispatch({effects:mu.of(null)})}),this.showOptions(l,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:l,selected:a,disabled:o}=r.open;(!i.open||i.open.options!=l)&&(this.range=Mb(l.length,a,e.state.facet(He).maxRenderedOptions),this.showOptions(l,r.id)),this.updateSel(),o!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=Mb(n.options.length,n.selected,this.view.state.facet(He).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let l=typeof i=="string"?document.createTextNode(i):i(r);if(!l)return;"then"in l?l.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>Ht(this.view.state,a,"completion info")):this.addInfoPane(l,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:l}=e;r.appendChild(i),this.infoDestroy=l||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&$W(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),l=this.space;if(!l){let a=this.dom.ownerDocument.documentElement;l={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return i.top>Math.min(l.bottom,n.bottom)-10||i.bottom{a.target==i&&a.preventDefault()});let l=null;for(let a=r.from;ar.from||r.from==0))if(l=h,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=h}}const d=i.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(o);f&&(d.className=f);for(let h of this.optionContent){let p=h(o,this.view.state,this.view,s);p&&d.appendChild(p)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew Bb(n,t,e)}u(vW,"completionTooltip");function $W(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}u($W,"scrollIntoView");function bA(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}u(bA,"score");function wW(t,e){let n=[],r=null,i=null,l=u(d=>{n.push(d);let{section:f}=d.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(p=>p.name==h)||r.push(typeof f=="string"?{name:h}:f)}},"addOption"),a=e.facet(He);for(let d of t)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)l(new sh(h,d.source,f?f(h):[],1e9-n.length));else{let h=e.sliceDoc(d.from,d.to),p,m=a.filterStrict?new Qb(h):new Ab(h);for(let g of d.result.options)if(p=m.match(g.label)){let O=g.displayLabel?f?f(g,p.matched):[]:p.matched,b=p.score+(g.boost||0);if(l(new sh(g,d.source,O,b)),typeof g.section=="object"&&g.section.rank==="dynamic"){let{name:y}=g.section;i||(i=Object.create(null)),i[y]=Math.max(b,i[y]||-1e9)}}}}if(r){let d=Object.create(null),f=0,h=u((p,m)=>(p.rank==="dynamic"&&m.rank==="dynamic"?i[m.name]-i[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(p.nameh.score-f.score||c(f.completion,h.completion))){let f=d.completion;!s||s.label!=f.label||s.detail!=f.detail||s.type!=null&&f.type!=null&&s.type!=f.type||s.apply!=f.apply||s.boost!=f.boost?o.push(d):bA(d.completion)>bA(s)&&(o[o.length-1]=d),s=d.completion}return o}u(wW,"sortOptions");const Gl=class Gl{constructor(e,n,r,i,l,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=l,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Gl(this.options,yA(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,l,a){if(i&&!a&&e.some(c=>c.isPending))return i.setDisabled();let o=wW(e,n);if(!o.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let s=n.facet(He).selectOnOpen?0:-1;if(i&&i.selected!=s&&i.selected!=-1){let c=i.options[i.selected].completion;for(let d=0;dd.hasResult()?Math.min(c,d.from):c,1e8),create:PW,above:l.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new Gl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Gl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}};u(Gl,"CompletionDialog");let Rb=Gl;const vc=class vc{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new vc(kW,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(He),l=(r.override||n.languageDataAt("autocomplete",xl(n)).map(OW)).map(s=>(this.active.find(d=>d.source==s)||new Lr(s,this.active.some(d=>d.state!=0)?1:0)).update(e,r));l.length==this.active.length&&l.every((s,c)=>s==this.active[c])&&(l=this.active);let a=this.open,o=e.effects.some(s=>s.is(Nb));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||l.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!xW(l,this.active)||o?a=Rb.build(l,n,this.id,a,r,o):a&&a.disabled&&!l.some(s=>s.isPending)&&(a=null),!a&&l.every(s=>!s.isPending)&&l.some(s=>s.hasResult())&&(l=l.map(s=>s.hasResult()?new Lr(s.source,0):s));for(let s of e.effects)s.is($A)&&(a=a&&a.setSelected(s.value,this.id));return l==this.active&&a==this.open?this:new vc(l,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?SW:CW}};u(vc,"CompletionState");let Vb=vc;function xW(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}u(yA,"makeAttrs");const kW=[];function vA(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Tb);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}u(vA,"getUpdateType");const _l=class _l{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=vA(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new _l(i.source,0)),r&4&&i.state==0&&(i=new _l(this.source,1)),i=i.updateFor(e,r);for(let l of e.effects)if(l.is(uh))i=new _l(i.source,1,l.value);else if(l.is(mu))i=new _l(i.source,0);else if(l.is(Nb))for(let a of l.value)a.source==i.source&&(i=a);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(xl(e.state))}};u(_l,"ActiveSource");let Lr=_l;const To=class To extends Lr{constructor(e,n,r,i,l,a){super(e,3,n),this.limit=r,this.result=i,this.from=l,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let l=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),o=xl(e.state);if(o>a||!i||n&2&&(xl(e.startState)==this.from||on.map(e))}}),$A=Oe.define(),zt=Gt.define({create(){return Vb.start()},update(t,e){return t.update(e)},provide:t=>[AT.from(t,e=>e.tooltip),J.contentAttributes.from(t,e=>e.attrs)]});function Fb(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(zt).active.find(i=>i.source==e.source);return r instanceof ch?(typeof n=="string"?t.dispatch({...gW(t.state,n,r.from,r.to),annotations:Tb.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}u(Fb,"applyCompletion");const PW=vW(zt,Fb);function dh(t,e="option"){return n=>{let r=n.state.field(zt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:a-1;return o<0?o=e=="page"?0:a-1:o>=a&&(o=e=="page"?a-1:0),n.dispatch({effects:$A.of(o)}),!0}}u(dh,"moveCompletionSelection");const EW=u(t=>{let e=t.state.field(zt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(zt,!1)?(t.dispatch({effects:uh.of(!0)}),!0):!1,"startCompletion"),TW=u(t=>{let e=t.state.field(zt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:mu.of(null)}),!0)},"closeCompletion"),Y4=class Y4{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}};u(Y4,"RunningQuery");let Lb=Y4;const AW=50,QW=1e3,MW=it.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(zt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(zt),n=t.state.facet(He);if(!t.selectionSet&&!t.docChanged&&t.startState.field(zt)==e)return;let r=t.transactions.some(l=>{let a=vA(l,n);return a&8||(l.selection||l.docChanged)&&!(a&3)});for(let l=0;lAW&&Date.now()-a.time>QW){for(let o of a.context.abortListeners)try{o()}catch(s){Ht(this.view.state,s)}a.context.abortListeners=null,this.running.splice(l--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(l=>l.effects.some(a=>a.is(uh)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(l=>l.isPending&&!this.running.some(a=>a.active.source==l.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let l of t.transactions)l.isUserEvent("input.type")?this.composing=2:this.composing==2&&l.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(zt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=xl(e),r=new oh(e,n,t.explicit,this.view),i=new Lb(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(l=>{i.context.aborted||(i.done=l||null,this.scheduleAccept())},l=>{this.view.dispatch({effects:mu.of(null)}),Ht(this.view.state,l)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(He),r=this.view.state.field(zt);for(let i=0;io.source==l.active.source);if(a&&a.isPending)if(l.done==null){let o=new Lr(l.active.source,0);for(let s of l.updates)o=o.update(s,n);o.isPending||e.push(o)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Nb.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(zt,!1);if(e&&e.tooltip&&this.view.state.facet(He).closeOnBlur){let n=e.open&&QT(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:mu.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:uh.of(!1)}),20),this.composing=0}}}),BW=typeof navigator=="object"&&/Win/.test(navigator.platform),RW=dl.highest(J.domEventHandlers({keydown(t,e){let n=e.state.field(zt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(BW&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),l=r.completion.commitCharacters||i.result.commitCharacters;return l&&l.indexOf(t.key)>-1&&Fb(e,r),!1}})),wA=J.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),K4=class K4{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}};u(K4,"FieldPos");let zb=K4;const jp=class jp{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,ct.TrackDel),r=e.mapPos(this.to,1,ct.TrackDel);return n==null||r==null?null:new jp(this.field,n,r)}};u(jp,"FieldRange");let Zb=jp;const qp=class qp{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],l=e.doc.lineAt(n),a=/^\s*/.exec(l.text)[0];for(let s of this.lines){if(r.length){let c=a,d=/^\t*/.exec(s)[0].length;for(let f=0;fnew Zb(s.field,i[s.line]+s.from,i[s.line]+s.to));return{text:r,ranges:o}}static parse(e){let n=[],r=[],i=[],l;for(let a of e.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=l[1]?+l[1]:null,s=l[2]||l[3]||"",c=-1,d=s.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&h.field++}for(let f of i)if(f.line==r.length&&f.from>l.index){let h=l[2]?3+(l[1]||"").length:2;f.from-=h,f.to-=h}i.push(new zb(c,r.length,l.index,l.index+d.length)),a=a.slice(0,l.index)+s+a.slice(l.index+l[0].length)}a=a.replace(/\\([{}])/g,(o,s,c)=>{for(let d of i)d.line==r.length&&d.from>c&&(d.from--,d.to--);return s}),r.push(a)}return new qp(r,i)}};u(qp,"Snippet");let Xb=qp,VW=re.widget({widget:new class extends er{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),NW=re.mark({class:"cm-snippetField"});const Wp=class Wp{constructor(e,n){this.ranges=e,this.active=n,this.deco=re.set(e.map(r=>(r.from==r.to?VW:NW).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Wp(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}};u(Wp,"ActiveSnippet");let Ua=Wp;const gu=Oe.define({map(t,e){return t&&t.map(e)}}),FW=Oe.define(),Ou=Gt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(gu))return n.value;if(n.is(FW)&&t)return new Ua(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>J.decorations.from(t,e=>e?e.deco:re.none)});function jb(t,e){return X.create(t.filter(n=>n.field==e).map(n=>X.range(n.from,n.to)))}u(jb,"fieldSelection");function IW(t){let e=Xb.parse(t);return(n,r,i,l)=>{let{text:a,ranges:o}=e.instantiate(n.state,i),{main:s}=n.state.selection,c={changes:{from:i,to:l==s.from?s.to:l,insert:pe.of(a)},scrollIntoView:!0,annotations:r?[Tb.of(r),xt.userEvent.of("input.complete")]:void 0};if(o.length&&(c.selection=jb(o,0)),o.some(d=>d.field>0)){let d=new Ua(o,0),f=c.effects=[gu.of(d)];n.state.field(Ou,!1)===void 0&&f.push(Oe.appendConfig.of([Ou,zW,ZW,wA]))}n.dispatch(n.state.update(c))}}u(IW,"snippet");function xA(t){return({state:e,dispatch:n})=>{let r=e.field(Ou,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,l=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:jb(r.ranges,i),effects:gu.of(l?null:new Ua(r.ranges,i)),scrollIntoView:!0})),!0}}u(xA,"moveField");const LW=[{key:"Tab",run:xA(1),shift:xA(-1)},{key:"Escape",run:u(({state:t,dispatch:e})=>t.field(Ou,!1)?(e(t.update({effects:gu.of(null)})),!0):!1,"clearSnippet")}],SA=_.define({combine(t){return t.length?t[0]:LW}}),zW=dl.highest(Df.compute([SA],t=>t.facet(SA)));function Zt(t,e){return{...e,apply:IW(t)}}u(Zt,"snippetCompletion");const ZW=J.domEventHandlers({mousedown(t,e){let n=e.state.field(Ou,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(l=>l.from<=r&&l.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:jb(n.ranges,i.field),effects:gu.of(n.ranges.some(l=>l.field>i.field)?new Ua(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),bu={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Sl=Oe.define({map(t,e){let n=e.mapPos(t,-1,ct.TrackAfter);return n??void 0}}),qb=new class extends Nr{};qb.startSide=1,qb.endSide=-1;const CA=Gt.define({create(){return Te.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Sl)&&(t=t.update({add:[qb.range(n.value,n.value+1)]}));return t}});function XW(){return[qW,CA]}u(XW,"closeBrackets");const Wb="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function kA(t){for(let e=0;e{if((jW?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Gn(Ft(r,0))==1||e!=i.from||n!=i.to)return!1;let l=YW(t.state,r);return l?(t.dispatch(l),!0):!1}),WW=[{key:"Backspace",run:u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=DA(t,t.selection.main.head).brackets||bu.brackets,i=null,l=t.changeByRange(a=>{if(a.empty){let o=KW(t.doc,a.head);for(let s of r)if(s==o&&fh(t.doc,a.head)==kA(Ft(s,0)))return{changes:{from:a.head-s.length,to:a.head+s.length},range:X.cursor(a.head-s.length)}}return{range:i=a}});return i||e(t.update(l,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},"deleteBracketPair")}];function YW(t,e){let n=DA(t,t.selection.main.head),r=n.brackets||bu.brackets;for(let i of r){let l=kA(Ft(i,0));if(e==i)return l==i?_W(t,i,r.indexOf(i+i+i)>-1,n):UW(t,i,l,n.before||bu.before);if(e==l&&PA(t,t.selection.main.from))return GW(t,i,l)}return null}u(YW,"insertBracket");function PA(t,e){let n=!1;return t.field(CA).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}u(PA,"closedBracketAt");function fh(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Gn(Ft(n,0)))}u(fh,"nextChar");function KW(t,e){let n=t.sliceString(e-2,e);return Gn(Ft(n,0))==n.length?n:n.slice(1)}u(KW,"prevChar");function UW(t,e,n,r){let i=null,l=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:Sl.of(a.to+e.length),range:X.range(a.anchor+e.length,a.head+e.length)};let o=fh(t.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:e+n,from:a.head},effects:Sl.of(a.head+e.length),range:X.cursor(a.head+e.length)}:{range:i=a}});return i?null:t.update(l,{scrollIntoView:!0,userEvent:"input.type"})}u(UW,"handleOpen");function GW(t,e,n){let r=null,i=t.changeByRange(l=>l.empty&&fh(t.doc,l.head)==n?{changes:{from:l.head,to:l.head+n.length,insert:n},range:X.cursor(l.head+n.length)}:r={range:l});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}u(GW,"handleClose");function _W(t,e,n,r){let i=r.stringPrefixes||bu.stringPrefixes,l=null,a=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Sl.of(o.to+e.length),range:X.range(o.anchor+e.length,o.head+e.length)};let s=o.head,c=fh(t.doc,s),d;if(c==e){if(EA(t,s))return{changes:{insert:e+e,from:s},effects:Sl.of(s+e.length),range:X.cursor(s+e.length)};if(PA(t,s)){let h=n&&t.sliceDoc(s,s+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+h.length,insert:h},range:X.cursor(s+h.length)}}}else{if(n&&t.sliceDoc(s-2*e.length,s)==e+e&&(d=TA(t,s-2*e.length,i))>-1&&EA(t,d))return{changes:{insert:e+e+e+e,from:s},effects:Sl.of(s+e.length),range:X.cursor(s+e.length)};if(t.charCategorizer(s)(c)!=ft.Word&&TA(t,s,i)>-1&&!HW(t,s,e,i))return{changes:{insert:e+e,from:s},effects:Sl.of(s+e.length),range:X.cursor(s+e.length)}}return{range:l=o}});return l?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}u(_W,"handleSame");function EA(t,e){let n=ze(t).resolveInner(e+1);return n.parent&&n.from==e}u(EA,"nodeStart");function HW(t,e,n,r){let i=ze(t).resolveInner(e,-1),l=r.reduce((a,o)=>Math.max(a,o.length),0);for(let a=0;a<5;a++){let o=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+l)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+s;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}u(HW,"probablyInString");function TA(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=ft.Word)return e;for(let i of n){let l=e-i.length;if(t.sliceDoc(l,e)==i&&r(t.sliceDoc(l-1,l))!=ft.Word)return l}return-1}u(TA,"canStartStringAt");function JW(t={}){return[RW,zt,He.of(t),MW,eY,wA]}u(JW,"autocompletion");const AA=[{key:"Ctrl-Space",run:Ib},{mac:"Alt-`",run:Ib},{mac:"Alt-i",run:Ib},{key:"Escape",run:TW},{key:"ArrowDown",run:dh(!0)},{key:"ArrowUp",run:dh(!1)},{key:"PageDown",run:dh(!0,"page")},{key:"PageUp",run:dh(!1,"page")},{key:"Enter",run:EW}],eY=dl.highest(Df.computeN([He],t=>t.facet(He).defaultKeymap?[AA]:[])),QA=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t,U4=class U4{constructor(e,n,r=0,i=e.length,l,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=l?o=>l(QA(o)):QA,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ft(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=C0(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Gn(e);let i=this.normalize(n);if(i.length)for(let l=0,a=r;;l++){let o=i.charCodeAt(l),s=this.match(o,a,this.bufferPos+this.bufferStart);if(l==i.length-1){if(s)return this.value=s,this;break}a==r&&le||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function nY(t){let e=[oY,aY];return t&&e.push(MA.of(t)),e}u(nY,"highlightSelectionMatches");const rY=re.mark({class:"cm-selectionMatch"}),iY=re.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function BA(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=ft.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=ft.Word)}u(BA,"insideWordBoundaries");function lY(t,e,n,r){return t(e.sliceDoc(n,n+1))==ft.Word&&t(e.sliceDoc(r-1,r))==ft.Word}u(lY,"insideWord");const aY=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(MA),{state:n}=t,r=n.selection;if(r.ranges.length>1)return re.none;let i=r.main,l,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return re.none;let s=n.wordAt(i.head);if(!s)return re.none;a=n.charCategorizer(i.head),l=n.sliceDoc(s.from,s.to)}else{let s=i.to-i.from;if(s200)return re.none;if(e.wholeWords){if(l=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(BA(a,n,i.from,i.to)&&lY(a,n,i.from,i.to)))return re.none}else if(l=n.sliceDoc(i.from,i.to),!l)return re.none}let o=[];for(let s of t.visibleRanges){let c=new hh(n.doc,l,s.from,s.to);for(;!c.next().done;){let{from:d,to:f}=c.value;if((!a||BA(a,n,d,f))&&(i.empty&&d<=i.from&&f>=i.to?o.push(iY.range(d,f)):(d>=i.to||f<=i.from)&&o.push(rY.range(d,f)),o.length>e.maxMatches))return re.none}}return re.set(o)}},{decorations:t=>t.decorations}),oY=J.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),$c=class $c{constructor(e,n,r,i,l,a,o,s,c,d=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=l,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new $c(e,[],n,r,r,0,[],0,i?new ph(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:l}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,l=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(n==r)return;if(a.buffer[o-2]>=n){a.buffer[o-2]=r;return}}}if(!l||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0){let o=!1;for(let s=a;s>0&&this.buffer[s-2]>r;s-=4)if(this.buffer[s-1]>=0){o=!0;break}if(o)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let l=e,{parser:a}=this.p;(i>this.pos||n<=a.maxNode)&&(this.pos=i,a.stateFlag(l,1)||(this.reducePos=i)),this.pushState(l,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new $c(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Kb(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let l=0,a;ls&1&&o==a)||i.push(n[l],a)}n=i}let r=[];for(let i=0;i>19,i=n&65535,l=this.stack.length-r*3;if(l<0||e.getGoto(this.stack[l],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=u((i,l)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let o=(a>>19)-l;if(o>1){let s=a&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],s,!1)>=0)return o<<19|65536|s}}else{let o=r(a,l+1);if(o!=null)return o}})},"explore");return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};u($c,"Stack");let Yb=$c;const G4=class G4{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}};u(G4,"StackContext");let ph=G4;const _4=class _4{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}};u(_4,"SimulatedStack");let Kb=_4;const wc=class wc{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new wc(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new wc(this.stack,this.pos,this.index)}};u(wc,"StackBufferCursor");let Ub=wc;function yu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&a--,a>=34&&a--;let s=a-32;if(s>=46&&(s-=46,o=!0),l+=s,o)break;l*=46}n?n[i++]=l:n=new e(l)}return n}u(yu,"decodeArray");const H4=class H4{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};u(H4,"CachedToken");let Ga=H4;const RA=new Ga,J4=class J4{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=RA,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,l=this.pos+e;for(;lr.to:l>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];l+=a.from-r.to,r=a}return l}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ro.to&&(this.chunk2=this.chunk2.slice(0,o.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=RA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}};u(J4,"InputStream");let Gb=J4;const e$=class e${constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;VA(this.data,e,n,this.id,r.data,r.tokenPrecTable)}};u(e$,"TokenGroup");let Ti=e$;Ti.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const t$=class t${constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?yu(e):e}token(e,n){let r=e.pos,i=0;for(;;){let l=e.next<0,a=e.resolveOffset(1,1);if(VA(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(l||i++,a==null)break;e.reset(a,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}};u(t$,"LocalTokenGroup");let _a=t$;_a.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const n$=class n${constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};u(n$,"ExternalTokenizer");let Dt=n$;function VA(t,e,n,r,i,l){let a=0,o=1<0){let m=t[p];if(s.allows(m)&&(e.token.value==-1||e.token.value==m||sY(m,e.token.value,i,l))){e.acceptToken(m);break}}let d=e.next,f=0,h=t[a+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){a=t[c+h*3-1];continue e}for(;f>1,m=c+p+(p<<1),g=t[m],O=t[m+1]||65536;if(d=O)f=p+1;else{a=t[m+2],e.advance();continue e}}break}}u(VA,"readToken");function NA(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}u(NA,"findOffset");function sY(t,e,n,r){let i=NA(n,r,e);return i<0||NA(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}u(FA,"cutAt");const r$=class r${constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?FA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?FA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(l instanceof Le){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(l),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+l.length}}};u(r$,"FragmentCursor");let Hb=r$;const i$=class i${constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Ga)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:l}=i,a=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let c=0;cf.end+25&&(s=Math.max(f.lookAhead,s)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!d.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return s&&e.setLookAhead(s),!r&&e.pos==this.stream.end&&(r=new Ga,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Ga,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:l}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let l=0;le.bufferLength*4?new Hb(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,l;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(o);else{if(this.advanceStack(o,r,e))continue;{i||(i=[],l=[]),i.push(o);let s=this.tokens.getMainToken(o);l.push(s.value,s.end)}}break}}if(!r.length){let a=i&&uY(i);if(a)return nn&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw nn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,l,r);if(a)return nn&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((o,s)=>s.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)r.splice(s--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,d=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?l.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(ue.contextHash)||0)==d))return e.useNode(f,h),nn&&console.log(a+this.stackID(e)+` (via reuse of ${l.getName(f.type.id)})`),!0;if(!(f instanceof Le)||f.children.length==0||f.positions[0]>0)break;let p=f.children[0];if(p instanceof Le&&f.positions[0]==0)f=p;else break}}let o=l.stateSlot(e.state,4);if(o>0)return e.reduce(o),nn&&console.log(a+this.stackID(e)+` (via always-reduce ${l.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let c=0;ci?n.push(m):r.push(m)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return IA(e,n),!0}}runRecovery(e,n,r){let i=null,l=!1;for(let a=0;a ":"";if(o.deadEnd&&(l||(l=!0,o.restart(),nn&&console.log(d+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let f=o.split(),h=d;for(let p=0;f.forceReduce()&&p<10&&(nn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));p++)nn&&(h=this.stackID(f)+" -> ");for(let p of o.recoverByInsert(s))nn&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,r);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),nn&&console.log(d+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),IA(o,r)):(!i||i.scoret,"id"),o$=class o${constructor(e){this.start=e.start,this.shift=e.shift||ny,this.reduce=e.reduce||ny,this.reuse=e.reuse||ny,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}};u(o$,"ContextTracker");let mh=o$;const xc=class xc extends If{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)l(d,s,o[c++]);else{let f=o[c+-d];for(let h=-d;h>0;h--)l(o[c++],s,f);c++}}}this.nodeSet=new KO(n.map((o,s)=>en.define({name:s>=this.minRepeatTerm?void 0:o,id:s,props:i[s],top:r.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=XT;let a=yu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Ti(a,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new ey(this,e,n,r);for(let l of this.wrappers)i=l(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let l=i[n+1];;){let a=i[l++],o=a&1,s=i[l++];if(o&&r)return s;for(let c=l+(a>>1);l0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let l=this.stateSlot(e,1);i==null;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=zr(this.data,l+2);else break;i=n(zr(this.data,l+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=zr(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((l,a)=>a&1&&l==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(xc.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(l=>l.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let l=e.specializers.find(o=>o.from==r.external);if(!l)return r;let a=Object.assign(Object.assign({},r),{external:l.to});return n.specializers[i]=LA(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let l of e.split(" ")){let a=n.indexOf(l);a>=0&&(r[a]=!0)}let i=null;for(let l=0;lr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}u(LA,"getSpecializer");const cY=55,dY=1,fY=56,hY=2,pY=57,mY=3,zA=4,gY=5,ry=6,ZA=7,XA=8,jA=9,qA=10,OY=11,bY=12,yY=13,iy=58,vY=14,$Y=15,WA=59,YA=21,wY=23,KA=24,xY=25,ly=27,UA=28,SY=29,CY=32,kY=35,DY=37,PY=38,EY=0,TY=1,AY={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},QY={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},GA={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function MY(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}u(MY,"nameChar");let _A=null,HA=null,JA=0;function ay(t,e){let n=t.pos+e;if(JA==n&&HA==t)return _A;let r=t.peek(e),i="";for(;MY(r);)i+=String.fromCharCode(r),r=t.peek(++e);return HA=t,JA=n,_A=i?i.toLowerCase():r==BY||r==RY?void 0:null}u(ay,"tagNameAfter");const eQ=60,gh=62,oy=47,BY=63,RY=33,VY=45;function tQ(t,e){this.name=t,this.parent=e}u(tQ,"ElementContext");const NY=[ry,qA,ZA,XA,jA],FY=new mh({start:null,shift(t,e,n,r){return NY.indexOf(e)>-1?new tQ(ay(r,1)||"",t):t},reduce(t,e){return e==YA&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==ry||i==DY?new tQ(ay(r,1)||"",t):t},strict:!1}),IY=new Dt((t,e)=>{if(t.next!=eQ){t.next<0&&e.context&&t.acceptToken(iy);return}t.advance();let n=t.next==oy;n&&t.advance();let r=ay(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?$Y:vY);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(OY);if(i&&QY[i])return t.acceptToken(iy,-2);if(e.dialectEnabled(EY))return t.acceptToken(bY);for(let l=e.context;l;l=l.parent)if(l.name==r)return;t.acceptToken(yY)}else{if(r=="script")return t.acceptToken(ZA);if(r=="style")return t.acceptToken(XA);if(r=="textarea")return t.acceptToken(jA);if(AY.hasOwnProperty(r))return t.acceptToken(qA);i&&GA[i]&&GA[i][r]?t.acceptToken(iy,-1):t.acceptToken(ry)}},{contextual:!0}),LY=new Dt(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(WA);break}if(t.next==VY)e++;else if(t.next==gh&&e>=2){n>=3&&t.acceptToken(WA,-2);break}else e=0;t.advance()}});function zY(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}u(zY,"inForeignElement");const ZY=new Dt((t,e)=>{if(t.next==oy&&t.peek(1)==gh){let n=e.dialectEnabled(TY)||zY(e.context);t.acceptToken(n?gY:zA,2)}else t.next==gh&&t.acceptToken(zA,1)});function sy(t,e,n){let r=2+t.length;return new Dt(i=>{for(let l=0,a=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(l==0&&i.next==eQ||l==1&&i.next==oy||l>=2&&la?i.acceptToken(e,-a):i.acceptToken(n,-(a-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else l=a=0;i.advance()}})}u(sy,"contentTokenizer");const XY=sy("script",cY,dY),jY=sy("style",fY,hY),qY=sy("textarea",pY,mY),WY=Xf({"Text RawText IncompleteTag IncompleteCloseTag":V.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":V.angleBracket,TagName:V.tagName,"MismatchedCloseTag/TagName":[V.tagName,V.invalid],AttributeName:V.attributeName,"AttributeValue UnquotedAttributeValue":V.attributeValue,Is:V.definitionOperator,"EntityReference CharacterReference":V.character,Comment:V.blockComment,ProcessingInst:V.processingInstruction,DoctypeDecl:V.documentMeta}),YY=vu.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:FY,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[WY],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=o.type.id;if(c==SY)return uy(o,s,n);if(c==CY)return uy(o,s,r);if(c==kY)return uy(o,s,i);if(c==YA&&l.length){let d=o.node,f=d.firstChild,h=f&&rQ(f,s),p;if(h){for(let m of l)if(m.tag==h&&(!m.attrs||m.attrs(p||(p=nQ(f,s))))){let g=d.lastChild,O=g.type.id==PY?g.from:d.to;if(O>f.to)return{parser:m.parser,overlay:[{from:f.to,to:O}]}}}}if(a&&c==KA){let d=o.node,f;if(f=d.firstChild){let h=a[s.read(f.from,f.to)];if(h)for(let p of h){if(p.tagName&&p.tagName!=rQ(d.parent,s))continue;let m=d.lastChild;if(m.type.id==ly){let g=m.from+1,O=m.lastChild,b=m.to-(O&&O.isError?0:1);if(b>g)return{parser:p.parser,overlay:[{from:g,to:b}]}}else if(m.type.id==UA)return{parser:p.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}u(iQ,"configureNesting");const KY=122,lQ=1,UY=123,GY=124,aQ=2,_Y=125,HY=3,JY=4,oQ=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],eK=58,tK=40,sQ=95,nK=91,Oh=45,rK=46,iK=35,lK=37,aK=38,oK=92,sK=10,uK=42;function $u(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}u($u,"isAlpha");function cy(t){return t>=48&&t<=57}u(cy,"isDigit");function uQ(t){return cy(t)||t>=97&&t<=102||t>=65&&t<=70}u(uQ,"isHex");const cQ=u((t,e,n)=>(r,i)=>{for(let l=!1,a=0,o=0;;o++){let{next:s}=r;if($u(s)||s==Oh||s==sQ||l&&cy(s))!l&&(s!=Oh||o>0)&&(l=!0),a===o&&s==Oh&&a++,r.advance();else if(s==oK&&r.peek(1)!=sK){if(r.advance(),uQ(r.next)){do r.advance();while(uQ(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();l=!0}else{l&&r.acceptToken(a==2&&i.canShift(aQ)?e:s==tK?n:t);break}}},"identifierTokens"),cK=new Dt(cQ(UY,aQ,GY)),dK=new Dt(cQ(_Y,HY,JY)),fK=new Dt(t=>{if(oQ.includes(t.peek(-1))){let{next:e}=t;($u(e)||e==sQ||e==iK||e==rK||e==uK||e==nK||e==eK&&$u(t.peek(1))||e==Oh||e==aK)&&t.acceptToken(KY)}}),hK=new Dt(t=>{if(!oQ.includes(t.peek(-1))){let{next:e}=t;if(e==lK&&(t.advance(),t.acceptToken(lQ)),$u(e)){do t.advance();while($u(t.next)||cy(t.next));t.acceptToken(lQ)}}}),pK=Xf({"AtKeyword import charset namespace keyframes media supports":V.definitionKeyword,"from to selector":V.keyword,NamespaceName:V.namespace,KeyframeName:V.labelName,KeyframeRangeName:V.operatorKeyword,TagName:V.tagName,ClassName:V.className,PseudoClassName:V.constant(V.className),IdName:V.labelName,"FeatureName PropertyName":V.propertyName,AttributeName:V.attributeName,NumberLiteral:V.number,KeywordQuery:V.keyword,UnaryQueryOp:V.operatorKeyword,"CallTag ValueName":V.atom,VariableName:V.variableName,Callee:V.operatorKeyword,Unit:V.unit,"UniversalSelector NestingSelector":V.definitionOperator,"MatchOp CompareOp":V.compareOperator,"ChildOp SiblingOp, LogicOp":V.logicOperator,BinOp:V.arithmeticOperator,Important:V.modifier,Comment:V.blockComment,ColorLiteral:V.color,"ParenthesizedContent StringLiteral":V.string,":":V.punctuation,"PseudoOp #":V.derefOperator,"; ,":V.separator,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace}),mK={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},gK={__proto__:null,or:98,and:98,not:106,only:106,layer:170},OK={__proto__:null,selector:112,layer:166},bK={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},yK={__proto__:null,to:207},vK=vu.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hmK[t]||-1},{term:125,get:t=>gK[t]||-1},{term:4,get:t=>OK[t]||-1},{term:25,get:t=>bK[t]||-1},{term:123,get:t=>yK[t]||-1}],tokenPrec:1963});let dy=null;function fy(){if(!dy&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));dy=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return dy||[]}u(fy,"properties");const dQ=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),fQ=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),$K=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),wK=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Zr=/^(\w[\w-]*|-\w[\w-]*|)$/,xK=/^-(-[\w-]*)?$/;function SK(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}u(SK,"isVarArg");const hQ=new Ff,CK=["Declaration"];function kK(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}u(kK,"astTop");function pQ(t,e,n){if(e.to-e.from>4096){let r=hQ.get(e);if(r)return r;let i=[],l=new Set,a=e.cursor(Ae.IncludeAnonymous);if(a.firstChild())do for(let o of pQ(t,a.node,n))l.has(o.label)||(l.add(o.label),i.push(o));while(a.nextSibling());return hQ.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(l=>{var a;if(n(l)&&l.matchContext(CK)&&((a=l.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let o=t.sliceString(l.from,l.to);i.has(o)||(i.add(o),r.push({label:o,type:"variable"}))}}),r}}u(pQ,"variableNames");const DK=u(t=>e=>{let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(l||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:fy(),validFor:Zr};if(i.name=="ValueName")return{from:i.from,options:fQ,validFor:Zr};if(i.name=="PseudoClassName")return{from:i.from,options:dQ,validFor:Zr};if(t(i)||(e.explicit||l)&&SK(i,n.doc))return{from:t(i)||l?i.from:r,options:pQ(n.doc,kK(i),t),validFor:xK};if(i.name=="TagName"){for(let{parent:s}=i;s;s=s.parent)if(s.name=="Block")return{from:i.from,options:fy(),validFor:Zr};return{from:i.from,options:$K,validFor:Zr}}if(i.name=="AtKeyword")return{from:i.from,options:wK,validFor:Zr};if(!e.explicit)return null;let a=i.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:dQ,validFor:Zr}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:fQ,validFor:Zr}:a.name=="Block"||a.name=="Styles"?{from:r,options:fy(),validFor:Zr}:null},"defineCSSCompletionSource")(t=>t.name=="VariableName"),bh=iu.define({name:"css",parser:vK.configure({props:[Kf.add({Declaration:Uf()}),Gf.add({"Block KeyframeList":u7})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function PK(){return new ou(bh,bh.data.of({autocomplete:DK}))}u(PK,"css");const EK=316,TK=317,mQ=1,AK=2,QK=3,MK=4,BK=318,RK=320,VK=321,NK=5,FK=6,IK=0,hy=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],gQ=125,LK=59,py=47,zK=42,ZK=43,XK=45,jK=60,qK=44,WK=63,YK=46,KK=91,UK=new mh({start:!1,shift(t,e){return e==NK||e==FK||e==RK?t:e==VK},strict:!1}),GK=new Dt((t,e)=>{let{next:n}=t;(n==gQ||n==-1||e.context)&&t.acceptToken(BK)},{contextual:!0,fallback:!0}),_K=new Dt((t,e)=>{let{next:n}=t,r;hy.indexOf(n)>-1||n==py&&((r=t.peek(1))==py||r==zK)||n!=gQ&&n!=LK&&n!=-1&&!e.context&&t.acceptToken(EK)},{contextual:!0}),HK=new Dt((t,e)=>{t.next==KK&&!e.context&&t.acceptToken(TK)},{contextual:!0}),JK=new Dt((t,e)=>{let{next:n}=t;if(n==ZK||n==XK){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(mQ);t.acceptToken(r?mQ:AK)}}else n==WK&&t.peek(1)==YK&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(QK))},{contextual:!0});function my(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}u(my,"identifierChar");const eU=new Dt((t,e)=>{if(t.next!=jK||!e.dialectEnabled(IK)||(t.advance(),t.next==py))return;let n=0;for(;hy.indexOf(t.next)>-1;)t.advance(),n++;if(my(t.next,!0)){for(t.advance(),n++;my(t.next,!1);)t.advance(),n++;for(;hy.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==qK)return;for(let r=0;;r++){if(r==7){if(!my(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(MK,-n)}),tU=Xf({"get set async static":V.modifier,"for while do if else switch try catch finally return throw break continue default case defer":V.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":V.operatorKeyword,"let var const using function class extends":V.definitionKeyword,"import export from":V.moduleKeyword,"with debugger new":V.keyword,TemplateString:V.special(V.string),super:V.atom,BooleanLiteral:V.bool,this:V.self,null:V.null,Star:V.modifier,VariableName:V.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":V.function(V.variableName),VariableDefinition:V.definition(V.variableName),Label:V.labelName,PropertyName:V.propertyName,PrivatePropertyName:V.special(V.propertyName),"CallExpression/MemberExpression/PropertyName":V.function(V.propertyName),"FunctionDeclaration/VariableDefinition":V.function(V.definition(V.variableName)),"ClassDeclaration/VariableDefinition":V.definition(V.className),"NewExpression/VariableName":V.className,PropertyDefinition:V.definition(V.propertyName),PrivatePropertyDefinition:V.definition(V.special(V.propertyName)),UpdateOp:V.updateOperator,"LineComment Hashbang":V.lineComment,BlockComment:V.blockComment,Number:V.number,String:V.string,Escape:V.escape,ArithOp:V.arithmeticOperator,LogicOp:V.logicOperator,BitOp:V.bitwiseOperator,CompareOp:V.compareOperator,RegExp:V.regexp,Equals:V.definitionOperator,Arrow:V.function(V.punctuation),": Spread":V.punctuation,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace,"InterpolationStart InterpolationEnd":V.special(V.brace),".":V.derefOperator,", ;":V.separator,"@":V.meta,TypeName:V.typeName,TypeDefinition:V.definition(V.typeName),"type enum interface implements namespace module declare":V.definitionKeyword,"abstract global Privacy readonly override":V.modifier,"is keyof unique infer asserts":V.operatorKeyword,JSXAttributeValue:V.attributeValue,JSXText:V.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":V.angleBracket,"JSXIdentifier JSXNameSpacedName":V.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":V.attributeName,"JSXBuiltin/JSXIdentifier":V.standard(V.tagName)}),nU={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},rU={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},iU={__proto__:null,"<":193},lU=vu.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:UK,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[tU],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[_K,HK,JK,eU,2,3,4,5,6,7,8,9,10,11,12,13,14,GK,new _a("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new _a("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>nU[t]||-1},{term:343,get:t=>rU[t]||-1},{term:95,get:t=>iU[t]||-1}],tokenPrec:15201}),OQ=[Zt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Zt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Zt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Zt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Zt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Zt(`try { +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,RO),nX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let VO=null;function rX(){var t;if(VO==null&&typeof document<"u"&&document.body){let e=document.body.style;VO=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return VO||!1}u(rX,"supportsTabSize");const Tf=_.define({combine(t){let e=bi(t,{render:null,specialChars:tX,addSpecialChars:null});return(e.replaceTabs=!rX())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,RO)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,RO)),e}});function iX(t={}){return[Tf.of(t),lX()]}u(iX,"highlightSpecialChars");let kT=null;function lX(){return kT||(kT=it.fromClass(class{constructor(t){this.view=t,this.decorations=re.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Tf)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Ef({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,l=Ft(e[0],0);if(l==9){let a=i.lineAt(r),o=n.state.tabSize,s=Na(a.text,o,r-a.from);return re.replace({widget:new FO((o-s%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[l]||(this.decorationCache[l]=re.replace({widget:new NO(t,l)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Tf);t.startState.facet(Tf)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}u(lX,"specialCharPlugin");const aX="\u2022";function oX(t){return t>=32?aX:t==10?"\u2424":String.fromCharCode(9216+t)}u(oX,"placeholder$1");const c4=class c4 extends er{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=oX(this.code),r=e.state.phrase("Control character")+" "+(nX[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let l=document.createElement("span");return l.textContent=n,l.title=r,l.setAttribute("aria-label",r),l.className="cm-specialChar",l}ignoreEvent(){return!1}};u(c4,"SpecialCharWidget");let NO=c4;const d4=class d4 extends er{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};u(d4,"TabWidget");let FO=d4;function sX(){return cX}u(sX,"highlightActiveLine");const uX=re.line({class:"cm-activeLine"}),cX=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(uX.range(i.from)),e=i.from)}return re.set(n)}},{decorations:t=>t.decorations}),f4=class f4 extends er{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Fa(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Qs(n[0],r.direction!="rtl"),l=parseInt(r.lineHeight);return i.bottom-i.top>l*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+l}:i}ignoreEvent(){return!1}};u(f4,"Placeholder");let IO=f4;function dX(t){let e=it.fromClass(class{constructor(n){this.view=n,this.placeholder=t?re.set([re.widget({widget:new IO(t),side:1}).range(0)]):re.none}get decorations(){return this.view.state.doc.length?re.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,J.contentAttributes.of({"aria-placeholder":t})]:e}u(dX,"placeholder");const LO=2e3;function fX(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),l=[];if(e.off>LO||n.off>LO||e.col<0||n.col<0){let a=Math.min(e.off,n.off),o=Math.max(e.off,n.off);for(let s=r;s<=i;s++){let c=t.doc.line(s);c.length<=o&&l.push(X.range(c.from+a,c.to+o))}}else{let a=Math.min(e.col,n.col),o=Math.max(e.col,n.col);for(let s=r;s<=i;s++){let c=t.doc.line(s),d=Z0(c.text,a,t.tabSize,!0);if(d<0)l.push(X.cursor(c.to));else{let f=Z0(c.text,o,t.tabSize);l.push(X.range(c.from+d,c.from+f))}}}return l}u(fX,"rectangleFor");function hX(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}u(hX,"absoluteColumn");function DT(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,l=i>LO?-1:i==r.length?hX(t,e.clientX):Na(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:l,off:i}}u(DT,"getPos");function pX(t,e){let n=DT(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let l=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(l);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get(i,l,a){let o=DT(t,i);if(!o)return r;let s=fX(t.state,n,o);return s.length?a?X.create(s.concat(r.ranges)):X.create(s):r}}:null}u(pX,"rectangleSelectionStyle");function mX(t){let e=t?.eventFilter||(n=>n.altKey&&n.button==0);return J.mouseSelectionStyle.of((n,r)=>e(r)?pX(n,r):null)}u(mX,"rectangularSelection");const gX={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},OX={style:"cursor: crosshair"};function bX(t={}){let[e,n]=gX[t.key||"Alt"],r=it.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,J.contentAttributes.of(i=>{var l;return!((l=i.plugin(r))===null||l===void 0)&&l.isDown?OX:null})]}u(bX,"crosshairCursor");const Us="-10000px",h4=class h4{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let l=null;this.tooltipViews=this.tooltips.map(a=>l=r(a,l))}update(e,n){var r;let i=e.state.facet(this.facet),l=i.filter(s=>s);if(i===this.input){for(let s of this.tooltipViews)s.update&&s.update(e);return!1}let a=[],o=n?[]:null;for(let s=0;sn[c]=s),n.length=o.length),this.input=i,this.tooltips=l,this.tooltipViews=a,!0}};u(h4,"TooltipViewManager");let zO=h4;function yX(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}u(yX,"windowSpace");const ZO=_.define({combine:t=>{var e,n,r;return{position:U.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||yX}}}),PT=new WeakMap,ET=it.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(ZO);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new zO(t,AT,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(ZO);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Us,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:l}=this.manager.tooltipViews[0];if(U.gecko)n=l.offsetParent!=this.container.ownerDocument.body;else if(l.style.top==Us&&l.style.left=="0px"){let a=l.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}}if(n||this.position=="absolute")if(this.parent){let l=this.parent.getBoundingClientRect();l.width&&l.height&&(t=l.width/this.parent.offsetWidth,e=l.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=dO(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((l,a)=>{let o=this.manager.tooltipViews[a];return o.getCoords?o.getCoords(l.pos):this.view.coordsAtPos(l.pos)}),size:this.manager.tooltipViews.map(({dom:l})=>l.getBoundingClientRect()),space:this.view.state.facet(ZO).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:l}=t,a=[];for(let o=0;o=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1)){d.style.top=Us;continue}let p=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=p?7:0,g=h.right-h.left,O=(e=PT.get(c))!==null&&e!==void 0?e:h.bottom-h.top,b=c.offset||$X,y=this.view.textDirection==Ve.LTR,$=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(f.left-(p?14:0)+b.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(p?14:0)-b.x),r.right-g),v=this.above[o];!s.strictSide&&(v?f.top-O-m-b.yr.bottom)&&v==r.bottom-f.bottom>f.top-r.top&&(v=this.above[o]=!v);let S=(v?f.top-r.top:r.bottom-f.bottom)-m;if(S$&&Q.topx&&(x=v?Q.top-O-2-m:Q.bottom+m+2);if(this.position=="absolute"?(d.style.top=(x-t.parent.top)/l+"px",TT(d,($-t.parent.left)/i)):(d.style.top=x/l+"px",TT(d,$/i)),p){let Q=f.left+(y?b.x:-b.x)-($+14-7);p.style.left=Q/i+"px"}c.overlap!==!0&&a.push({left:$,top:x,right:C,bottom:x+O}),d.classList.toggle("cm-tooltip-above",v),d.classList.toggle("cm-tooltip-below",!v),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Us}},{eventObservers:{scroll(){this.maybeMeasure()}}});function TT(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}u(TT,"setLeftStyle");const vX=J.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),$X={x:0,y:0},AT=_.define({enables:[ET,vX]});function QT(t,e){let n=t.plugin(ET);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}u(QT,"getTooltip");const p4=class p4 extends Nr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};u(p4,"GutterMarker");let Qn=p4;Qn.prototype.elementClass="",Qn.prototype.toDOM=void 0,Qn.prototype.mapMode=ct.TrackBefore,Qn.prototype.startSide=Qn.prototype.endSide=-1,Qn.prototype.point=!0;const Af=_.define(),wX=_.define(),xX={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Te.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Gs=_.define();function SX(t){return[MT(),Gs.of({...xX,...t})]}u(SX,"gutter");const XO=_.define({combine:t=>t.some(e=>e)});function MT(t){let e=[CX];return t&&t.fixed===!1&&e.push(XO.of(!0)),e}u(MT,"gutters");const CX=it.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Gs).map(e=>new Qf(t,e)),this.fixed=!t.state.facet(XO);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(XO)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Te.iter(this.view.state.facet(Af),this.view.viewport.from),r=[],i=this.gutters.map(l=>new qO(l,this.view.viewport,-this.view.documentPadding.top));for(let l of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(l.type)){let a=!0;for(let o of l.type)if(o.type==kt.Text&&a){jO(n,r,o.from);for(let s of i)s.line(this.view,o,r);a=!1}else if(o.widget)for(let s of i)s.widget(this.view,o)}else if(l.type==kt.Text){jO(n,r,l.from);for(let a of i)a.line(this.view,l,r)}else if(l.widget)for(let a of i)a.widget(this.view,l);for(let l of i)l.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Gs),n=t.state.facet(Gs),r=t.docChanged||t.heightChanged||t.viewportChanged||!Te.eq(t.startState.facet(Af),t.state.facet(Af),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let l of n){let a=e.indexOf(l);a<0?i.push(new Qf(this.view,l)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let l of this.gutters)l.dom.remove(),i.indexOf(l)<0&&l.destroy();for(let l of i)l.config.side=="after"?this.getDOMAfter().appendChild(l.dom):this.dom.appendChild(l.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>J.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ve.LTR?{left:r,right:i}:{right:r,left:i}})});function BT(t){return Array.isArray(t)?t:[t]}u(BT,"asArray");function jO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}u(jO,"advanceCursor");const m4=class m4{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Te.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,l=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let o=new Mf(e,a,l,r);i.elements.push(o),i.dom.appendChild(o.dom)}else i.elements[this.i].update(e,a,l,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];jO(this.cursor,i,n.from),r.length&&(i=i.concat(r));let l=this.gutter.config.lineMarker(e,n,i);l&&i.unshift(l);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let l of e.state.facet(wX)){let a=l(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}};u(m4,"UpdateContext");let qO=m4;const g4=class g4{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let l=i.target,a;if(l!=this.dom&&this.dom.contains(l)){for(;l.parentNode!=this.dom;)l=l.parentNode;let s=l.getBoundingClientRect();a=(s.top+s.bottom)/2}else a=i.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,o,i)&&i.preventDefault()});this.markers=BT(n.markers(e)),n.initialSpacer&&(this.spacer=new Mf(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=BT(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Te.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}};u(g4,"SingleGutterView");let Qf=g4;const O4=class O4{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),kX(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let l=0,a=0;;){let o=a,s=ll(o,s,c)||a(o,s,c):a}return r}})}}),b4=class b4 extends Qn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};u(b4,"NumberMarker");let _s=b4;function WO(t,e){return t.state.facet(Xa).formatNumber(e,t.state)}u(WO,"formatNumber");const EX=Gs.compute([Xa],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(DX)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new _s(WO(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(PX)){let l=i(e,n,r);if(l)return l}return null},lineMarkerChange:e=>e.startState.facet(Xa)!=e.state.facet(Xa),initialSpacer(e){return new _s(WO(e,RT(e.state.doc.lines)))},updateSpacer(e,n){let r=WO(n.view,RT(n.view.state.doc.lines));return r==e.number?e:new _s(r)},domEventHandlers:t.facet(Xa).domEventHandlers,side:"before"}));function TX(t={}){return[Xa.of(t),MT(),EX]}u(TX,"lineNumbers");function RT(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(AX.range(i)))}return Te.of(e)});function MX(){return QX}u(MX,"highlightActiveLineGutter");var BX=Object.defineProperty,Hs=u((t,e)=>BX(t,"name",{value:e,configurable:!0}),"d$b");const VT=Hs((t,e="",n=!1,r=[],i=(o,s)=>s[o]??o,l={},a="")=>new J({doc:e,parent:t,extensions:[dX(a),it.fromClass(class{constructor(o){this.items=VX(r),this.placeholders=this.matchResults(this.items).createDeco(o)}update(o){this.placeholders=this.matchResults(this.items).updateDeco(o,this.placeholders)}matchResults(o){return new Ef({regexp:j2,decoration:(s,c,d)=>re.replace({widget:new NX(s[1],i(s[1],o),()=>c.dispatch({changes:{from:d,to:d+s[1].length+4}}),l)})})}},{decorations:o=>o.placeholders,provide:o=>J.atomicRanges.of(s=>s.plugin(o)?.placeholders||re.none)}),J.updateListener.of(o=>{if(l.inputMask){if(o.focusChanged)o.state.doc.toString().includes("_")?o.view.dispatch({changes:{from:0,to:o.state.doc.length,insert:""}}):o.state.doc.toString().length===0&&o.view.hasFocus&&NT(o,l.inputMask);else if(o.docChanged&&o.view.hasFocus&&NT(o,l.inputMask))return}o.docChanged&&n&&n(o.state.doc.toString())}),J.theme({".cm-scroller":{fontFamily:"inherit",alignItems:"center !important"},"&.cm-editor.cm-focused":{outline:"none"}}),Xe.readOnly.of(l.readOnly??!1),J.contentAttributes.of({contenteditable:!(l.readOnly??!1)})]}),"createInput");var YO=!1;const NT=Hs((t,e)=>{if(t.state.doc.toString().length===0){let n="";for(const r of e)n+=r==="a"||r==="9"||r==="*"?"_":r;t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n}})}else{if(t.startState.doc.toString()===""||YO)return YO=!1,!1;const n=t.startState.doc.toString().split("");let r;return t.changes.iterChanges((i,l,a,o)=>{const s=t.state.doc.sliceString(a,o).split("");let c=Math.min(Math.max(l,o),n.length),d=Math.min(i,a);r=s.length>0?c:d;let f=0,h=!1;for(;d!==c;){let p=e[d],m=s[f];switch(p){case"a":m&&m.match(/[a-zA-Z]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"9":m&&m.match(/[0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;case"*":m&&m.match(/[a-zA-Z0-9]/)?(n[d]=m,f+=1):(n[d]="_",h||(h=!0,r=d));break;default:n[d]=p;break}d+=1}}),YO=!0,t.view.dispatch({changes:{from:0,to:t.state.doc.length,insert:n.join("")},selection:{anchor:r,head:r}}),!0}},"handleMasking"),RX=Hs((t,e)=>{if(t.length!==e.length)return!1;for(let n=0;nArray.isArray(t)?t.reduce((e,n)=>({...e,...n.choices??{}}),{}):t,"getItemsObject"),FT=(fc=class extends er{constructor(e,n,r,i){super(e),this.value=e,this.label=n,this.onRemove=r,this.config=i}toDOM(){const e=document.createElement("span");if(e.setAttribute("class","tf-dynamic-text-item"),e.setAttribute("data-id",this.value),e.textContent=this.label,this.config?.readOnly===!0)return e;const n=document.createElement("span");return n.setAttribute("class","tf-dynamic-text-item-delete"),n.addEventListener("click",this.onRemove),e.appendChild(n),e}},u(fc,"k"),fc);Hs(FT,"DynamicString");let NX=FT;var FX=Object.defineProperty,IT=u((t,e)=>FX(t,"name",{value:e,configurable:!0}),"x$8");const IX=wp.element.forwardRef(({inputProps:t,...e},n)=>{const r=wp.element.useRef();let i=e.value??"";if((e.prefix||e.suffix)&&(e.prefix&&!i.startsWith(e.prefix)&&(i=e.prefix+i),e.suffix&&!i.endsWith(e.suffix)&&(i=i+e.suffix)),e.inputMask){const c=e.prefix?e.prefix.length:0,d=e.suffix?i.length-e.suffix.length:i.length;i=RX(i.slice(c,d),e.inputMask)?i:""}const[l,a]=wp.element.useState(i);wp.element.useEffect(()=>{let c=l;e.prefix&&(c=c.slice(e.prefix.length)),e.suffix&&(c=c.slice(0,c.length-e.suffix.length)),r.current=r.current??VT(n.current,c,d=>{a(`${e.prefix??""}${d}${e.suffix??""}`)},e.choices,o,{readOnly:e.readOnly??!1,inputMask:e.inputMask&&e.inputMask!==""?e.inputMask:null},e.placeholder??"")},[n.current]),wp.element.useEffect(()=>{if(e.suffix){const c=document.createElement("span");c.textContent=e.suffix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--suffix"),n.current.appendChild(c)}if(e.prefix){const c=document.createElement("span");c.textContent=e.prefix,c.setAttribute("class","tf-dynamic-text-input__affix tf-dynamic-text-input__affix--prefix"),n.current.insertBefore(c,n.current.children[0])}},[]);const o=IT(c=>{const d=e.dynamic.parse(c);return d&&d.type?e.dynamic.getLabel(d.type):c},"getDynamicValueLabel");wp.element.useEffect(()=>e.onChange&&e.onChange(l),[l]);const s=IT(c=>{r.current.dispatch({changes:{from:r.current.state.doc.length,insert:`${c}`}})},"insertDynamicValue");return!e.inputMask&&e.dynamic&&e.dynamic.getMode()==="replace"?wp.element.createElement(Ss,{...e,config:e.dynamic??"",value:l,onValueSelection:a,onValueRemove:()=>{r.current=null,a("")},inputProps:t,readOnly:e.readOnly??!1,buttonType:"inside"},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`})):wp.element.createElement(yE,{config:e.dynamic??"",onValueSelection:s,buttonType:"inside",readOnly:e.readOnly??!1,inputMasking:e.inputMask},wp.element.createElement("input",{...t,type:"hidden",value:l}),wp.element.createElement("div",{ref:n,className:`tf-dynamic-text-input${e.prefix?" tf-dynamic-text-input--has-prefix":""}${e.suffix?" tf-dynamic-text-input--has-suffix":""}`}))});var LX=Object.defineProperty,zX=u((t,e)=>LX(t,"name",{value:e,configurable:!0}),"u$9");const Bf=zX(t=>{const{locale:e}=Re(),[n,r]=wp.element.useState(t.value??""),i=wp.element.useMemo(()=>({maximumFractionDigits:10,useGrouping:!1}),[]),l=t.formatOptions??i,a=fN({...t,formatOptions:l,locale:e}),o=wp.element.useRef(),{labelProps:s,descriptionProps:c,groupProps:d,inputProps:f,incrementButtonProps:h,decrementButtonProps:p}=SN({...t,formatOptions:l},a,o);wp.element.useEffect(()=>t.onChange&&t.onChange(n),[n]);const m=t.hasButtons??!0,g=t.readOnly??!1;return wp.element.createElement("div",{className:"tf-number","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement("div",{className:"tf-number-field",...d},wp.element.createElement(Ss,{...t,value:n,onValueSelection:r,ref:o,inputProps:f},wp.element.createElement("input",{...f,step:t.step??1,ref:o,name:t.name??"",disabled:g}),m&&wp.element.createElement("div",{className:"tf-number-button-group"},wp.element.createElement(se,{type:"number",...h,isDisabled:g},"+"),wp.element.createElement(se,{type:"number",...p,isDisabled:g},"-")))),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"NumberComponent");var ZX=Object.defineProperty,XX=u((t,e)=>ZX(t,"name",{value:e,configurable:!0}),"r$5");const Js=XX(t=>{const e=GI(t),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),{labelProps:l,descriptionProps:a,triggerProps:o,valueProps:s,menuProps:c}=KF(t,e,n);return wp.element.createElement("div",{className:"tf-select",ref:i},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(GF,{state:e,triggerRef:n,label:t.label,name:t.name}),wp.element.createElement(se,{type:"select",...o,ref:n,onKeyDown:d=>d.code==="Space"?e.toggle():o.onKeyDown(d)},wp.element.createElement("span",{...s,className:"tf-select__value"},e.selectedItem?e.selectedItem.rendered:t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:n,placement:"bottom start",style:{width:i?.current?.offsetWidth}},wp.element.createElement(Vd,{...c,listBoxRef:r,state:e,items:t.items})),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Select");var jX=Object.defineProperty,eu=u((t,e)=>jX(t,"name",{value:e,configurable:!0}),"n$f");const LT=eu(t=>{const e=t.units??["px"],n=t.linked==="toggle"||t.linked===void 0,{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]),wp.element.useEffect(()=>{a.isLinked&&c(a.top)},[a.isLinked]);const s=eu((p,m)=>{o({...a,[m]:p})},"setAttribute"),c=eu(p=>{o({...a,top:p,left:p,right:p,bottom:p})},"setLinkedPosition"),d=eu(p=>{o({...a,isLinked:p})},"setIsLinked"),f=eu(()=>n?a.isLinked??!1:t.linked,"isLinked");let h="tf-dimensions-number-groups";return f()&&(h+=" tf-dimensions-number-groups-linked"),wp.element.createElement("div",{className:"tf-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-dimensions-container"},wp.element.createElement("div",{className:h},["top","left","right","bottom"].map(p=>wp.element.createElement(Bf,{key:p,value:a[p]??0,name:p,description:!1,label:`Value for ${p} position`,labelVisuallyHidden:!0,onChange:m=>f()?c(m):s(m,p)}))),wp.element.createElement(Js,{label:"Dimensions unit",labelVisuallyHidden:!0,description:!1,selectedKey:a.unit??"px",onSelectionChange:p=>s(p,"unit"),placeholder:"unit"},e.map(p=>wp.element.createElement(Qr,{key:p},p))),n&&wp.element.createElement(se,{type:"action",onPress:()=>d(!a.isLinked)},wp.element.createElement("span",{className:"dashicons dashicons-admin-links"}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Dimensions");var qX=Object.defineProperty,zT=u((t,e)=>qX(t,"name",{value:e,configurable:!0}),"a$9");const WX=zT(t=>{const e=t.units??["px"],n=t.format??"hex",{labelProps:r,fieldProps:i,descriptionProps:l}=$t(t),[a,o]=wp.element.useState(On(t.value??"",{dimensions:{top:0,left:0,right:0,bottom:0,unit:e[0],isLinked:!1},color:"rgba(0,0,0,1)"}));wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a]);const s=zT(c=>{o(typeof c=="string"?d=>({...d,color:c}):d=>({...d,dimensions:{...d.dimensions,...c}}))},"handleData");return wp.element.createElement("div",{className:"tf-border"},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(a),...i}),wp.element.createElement("div",{className:"tf-border-container"},wp.element.createElement("div",{className:"tf-border-dimensions-container"},wp.element.createElement(LT,{label:"Border dimensions",labelVisuallyHidden:!0,onChange:s,linked:t.linked,units:e,value:a.dimensions})),wp.element.createElement("div",{className:"tf-border-color-picker-container"},wp.element.createElement(jQ,{label:"Border Color",labelVisuallyHidden:!0,onChange:s,value:a.color,format:n,hasAlpha:t.hasAlpha??!0}))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Border");var YX=Object.defineProperty,KX=u((t,e)=>YX(t,"name",{value:e,configurable:!0}),"n$e");const UX=KX(t=>{const e=wp.element.useContext(t.context),n=wp.element.useRef(null),{inputProps:r}=L2(t,e,n);let i="tf-button-group-option";return e.selectedValue===t.value&&(i+=" tf-button-group-option-selected"),wp.element.createElement("label",{className:i},wp.element.createElement(gn,null,wp.element.createElement("input",{...r,ref:n})),t.children)},"ButtonOption");var GX=Object.defineProperty,_X=u((t,e)=>GX(t,"name",{value:e,configurable:!0}),"n$d");const ZT=wp.element.createContext(null),HX=_X(t=>{const e=KP(t),n=il(t.choices??{}),{radioGroupProps:r,labelProps:i,descriptionProps:l}=z2(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e.selectedValue)},[e.selectedValue]),wp.element.createElement("div",{className:"tf-button-group"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-button-group-container",...r},wp.element.createElement(ZT.Provider,{value:e},n.map(a=>wp.element.createElement(UX,{key:a.value,context:ZT,...a},t.use_dashicon?wp.element.createElement("span",{className:`dashicons dashicons-${a.label}`}):a.label)))),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"ButtonGroup");var JX=Object.defineProperty,ej=u((t,e)=>JX(t,"name",{value:e,configurable:!0}),"i$e");const tu=ej(t=>{const e=kx(t),n=wp.element.useRef(),{inputProps:r}=YV({...t,children:t.label??!1},e,n),{labelProps:i,descriptionProps:l}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value==="1"&&e.setSelected(!0),typeof t.value=="boolean"&&t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]);const a=t?.labelVisuallyHidden?gn:wp.element.Fragment;return wp.element.createElement("div",{className:"tf-checkbox"},wp.element.createElement(xe,{labelProps:i,parent:{...t,labelVisuallyHidden:!1}},wp.element.createElement("input",{...r,ref:n,id:t.name??""}),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:e.isSelected?"1":"0"}),wp.element.createElement(a,null,t.label??"")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"Checkbox"),XT=1024;let tj=0;const y4=class y4{constructor(e,n){this.from=e,this.to=n}};u(y4,"Range");let It=y4;const v4=class v4{constructor(e={}){this.id=tj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=en.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}};u(v4,"NodeProp");let ue=v4;ue.closedBy=new ue({deserialize:t=>t.split(" ")}),ue.openedBy=new ue({deserialize:t=>t.split(" ")}),ue.group=new ue({deserialize:t=>t.split(" ")}),ue.isolate=new ue({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),ue.contextHash=new ue({perNode:!0}),ue.lookAhead=new ue({perNode:!0}),ue.mounted=new ue({perNode:!0});const $4=class $4{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[ue.mounted.id]}};u($4,"MountedTree");let yl=$4;const nj=Object.create(null);let en=(Po=class{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):nj,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Po(e.name||"",n,e.id,r);if(e.props){for(let l of e.props)if(Array.isArray(l)||(l=l(i)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[l[0].id]=l[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(ue.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(ue.group),l=-1;l<(i?i.length:0);l++){let a=n[l<0?r.name:i[l]];if(a)return a}}}},u(Po,"NodeType"),Po);en.none=new en("",Object.create(null),0,8);const Fp=class Fp{constructor(e){this.types=e;for(let n=0;n0;for(let s=this.cursor(a|Ae.IncludeAnonymous);;){let c=!1;if(s.from<=l&&s.to>=i&&(!o&&s.type.isAnonymous||n(s)!==!1)){if(s.firstChild())continue;c=!0}for(;c&&r&&(o||!s.type.isAnonymous)&&r(s),!s.nextSibling();){if(!s.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:eb(en.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new hc(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new hc(en.none,n,r,i)))}static build(e){return ij(e)}};u(hc,"Tree");let Le=hc;Le.empty=new Le(en.none,[],[],0);const Ip=class Ip{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Ip(this.buffer,this.index)}};u(Ip,"FlatBufferCursor");let UO=Ip;const Lp=class Lp{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return en.none}toString(){let e=[];for(let n=0;n0));s=a[s+3]);return o}slice(e,n,r){let i=this.buffer,l=new Uint16Array(n-e),a=0;for(let o=e,s=0;o=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}u(qT,"checkSide");function nu(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?o.length:-1;e!=c;e+=n){let d=o[e],f=s[e]+a.from;if(qT(i,r,f,f+d.length)){if(d instanceof Si){if(l&Ae.ExcludeBuffers)continue;let h=d.findChild(0,d.buffer.length,n,r-f,i);if(h>-1)return new vl(new _O(a,d,e,f),null,h)}else if(l&Ae.IncludeAnonymous||!d.type.isAnonymous||JO(d)){let h;if(!(l&Ae.IgnoreMounts)&&(h=yl.get(d))&&!h.overlay)return new Eo(h.tree,f,e,a);let p=new Eo(d,f,e,a);return l&Ae.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?d.children.length-1:0,n,r,i)}}}if(l&Ae.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Ae.IgnoreOverlays)&&(i=yl.get(this._tree))&&i.overlay){let l=e-this.from;for(let{from:a,to:o}of i.overlay)if((n>0?a<=l:a=l:o>l))return new Eo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};u(Eo,"TreeNode");let Lt=Eo;function WT(t,e,n,r){let i=t.cursor(),l=[];if(!i.firstChild())return l;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return l}for(;;){if(r!=null&&i.type.is(r))return l;if(i.type.is(e)&&l.push(i.node),!i.nextSibling())return r==null?l:[]}}u(WT,"getChildren");function GO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}u(GO,"matchNodeContext");const x4=class x4{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}};u(x4,"BufferContext");let _O=x4;const Yl=class Yl extends Vf{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return l<0?null:new Yl(this.context,this,l)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Ae.ExcludeBuffers)return null;let{buffer:i}=this.context,l=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return l<0?null:new Yl(this.context,this,l)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Yl(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Yl(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,l=r.buffer[this.index+3];if(l>i){let a=r.buffer[this.index+1];e.push(r.slice(i,l,a)),n.push(0)}return new Le(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};u(Yl,"BufferNode");let vl=Yl;function YT(t){if(!t.length)return null;let e=0,n=t[0];for(let l=1;ln.from||a.to=e){let o=new Lt(a.tree,a.overlay[0].from+l.from,-1,l);(i||(i=[r])).push(nu(o,e,n,!1))}}return i?YT(i):r}u(rj,"stackIterator");const C4=class C4{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Lt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Lt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,l=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return l<0?!1:(this.stack.push(this.index),this.yieldBuf(l))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Ae.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ae.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ae.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let l=n+e,a=e<0?-1:r._tree.children.length;l!=a;l+=e){let o=r._tree.children[l];if(this.mode&Ae.IncludeAnonymous||o instanceof Si||!o.type.isAnonymous||JO(o))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=l+1;break e}i=this.stack[--l]}for(let i=r;i=0;l--){if(l<0)return GO(this._tree,e,i);let a=r[n.buffer[this.stack[l]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}};u(C4,"TreeCursor");let ja=C4;function JO(t){return t.children.some(e=>e instanceof Si||!e.type.isAnonymous||JO(e))}u(JO,"hasChild");function ij(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=XT,reused:l=[],minRepeatType:a=r.types.length}=t,o=Array.isArray(n)?new UO(n,n.length):n,s=r.types,c=0,d=0;function f(S,x,C,Q,T,B){let{id:w,start:M,end:A,size:E}=o,I=d,D=c;for(;E<0;)if(o.next(),E==-1){let F=l[w];C.push(F),Q.push(M-S);return}else if(E==-3){c=w;return}else if(E==-4){d=w;return}else throw new RangeError(`Unrecognized record size: ${E}`);let P=s[w],R,L,k=M-S;if(A-M<=i&&(L=O(o.pos-x,T))){let F=new Uint16Array(L.size-L.skip),N=o.pos-L.size,z=F.length;for(;o.pos>N;)z=b(L.start,F,z);R=new Si(F,A-L.start,r),k=L.start-S}else{let F=o.pos-E;o.next();let N=[],z=[],G=w>=a?w:-1,le=0,ie=A;for(;o.pos>F;)G>=0&&o.id==G&&o.size>=0?(o.end<=ie-i&&(m(N,z,M,le,o.end,ie,G,I,D),le=N.length,ie=o.end),o.next()):B>2500?h(M,F,N,z):f(M,F,N,z,G,B+1);if(G>=0&&le>0&&le-1&&le>0){let me=p(P,D);R=eb(P,N,z,0,N.length,0,A-M,me,me)}else R=g(P,N,z,A-M,I-A,D)}C.push(R),Q.push(k)}u(f,"takeNode");function h(S,x,C,Q){let T=[],B=0,w=-1;for(;o.pos>x;){let{id:M,start:A,end:E,size:I}=o;if(I>4)o.next();else{if(w>-1&&A=0;E-=3)M[I++]=T[E],M[I++]=T[E+1]-A,M[I++]=T[E+2]-A,M[I++]=I;C.push(new Si(M,T[2]-A,r)),Q.push(A-S)}}u(h,"takeFlatNode");function p(S,x){return(C,Q,T)=>{let B=0,w=C.length-1,M,A;if(w>=0&&(M=C[w])instanceof Le){if(!w&&M.type==S&&M.length==T)return M;(A=M.prop(ue.lookAhead))&&(B=Q[w]+M.length+A)}return g(S,C,Q,T,B,x)}}u(p,"makeBalanced");function m(S,x,C,Q,T,B,w,M,A){let E=[],I=[];for(;S.length>Q;)E.push(S.pop()),I.push(x.pop()+C-T);S.push(g(r.types[w],E,I,B-T,M-B,A)),x.push(T-C)}u(m,"makeRepeatLeaf");function g(S,x,C,Q,T,B,w){if(B){let M=[ue.contextHash,B];w=w?[M].concat(w):[M]}if(T>25){let M=[ue.lookAhead,T];w=w?[M].concat(w):[M]}return new Le(S,x,C,Q,w)}u(g,"makeTree");function O(S,x){let C=o.fork(),Q=0,T=0,B=0,w=C.end-i,M={size:0,start:0,skip:0};e:for(let A=C.pos-S;C.pos>A;){let E=C.size;if(C.id==x&&E>=0){M.size=Q,M.start=T,M.skip=B,B+=4,Q+=4,C.next();continue}let I=C.pos-E;if(E<0||I=a?4:0,P=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3)D+=4;else break e;else C.id>=a&&(D+=4);C.next()}T=P,Q+=E,B+=D}return(x<0||Q==S)&&(M.size=Q,M.start=T,M.skip=B),M.size>4?M:void 0}u(O,"findBufferSize");function b(S,x,C){let{id:Q,start:T,end:B,size:w}=o;if(o.next(),w>=0&&Q4){let A=o.pos-(w-4);for(;o.pos>A;)C=b(S,x,C)}x[--C]=M,x[--C]=B-S,x[--C]=T-S,x[--C]=Q}else w==-3?c=Q:w==-4&&(d=Q);return C}u(b,"copyToBuffer");let y=[],$=[];for(;o.pos>0;)f(t.start||0,t.bufferStart||0,y,$,-1,0);let v=(e=t.length)!==null&&e!==void 0?e:y.length?$[0]+y[0].length:0;return new Le(s[t.topID],y.reverse(),$.reverse(),v)}u(ij,"buildTree$1");const KT=new WeakMap;function Nf(t,e){if(!t.isAnonymous||e instanceof Si||e.type!=t)return 1;let n=KT.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Le)){n=1;break}n+=Nf(t,r)}KT.set(e,n)}return n}u(Nf,"nodeSize$1");function eb(t,e,n,r,i,l,a,o,s){let c=0;for(let m=r;m=d)break;x+=C}if($==v+1){if(x>d){let C=m[v];p(C.children,C.positions,0,C.children.length,g[v]+y);continue}f.push(m[v])}else{let C=g[$-1]+m[$-1].length-S;f.push(eb(t,m,g,v,$,S,C,null,s))}h.push(S+y-l)}}return u(p,"divide"),p(e,n,r,i,0),(o||s)(f,h,a)}u(eb,"balanceRange");const k4=class k4{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof vl?this.setBuffer(e.context.buffer,e.index,n):e instanceof Lt&&this.map.set(e.tree,n)}get(e){return e instanceof vl?this.getBuffer(e.context.buffer,e.index):e instanceof Lt?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}};u(k4,"NodeWeakMap");let Ff=k4;const pc=class pc{constructor(e,n,r,i,l=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(l?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new pc(0,e.length,e,0,!1,r)];for(let l of n)l.to>e.length&&i.push(l);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],l=1,a=e.length?e[0]:null;for(let o=0,s=0,c=0;;o++){let d=o=r)for(;a&&a.from=h.from||f<=h.to||c){let p=Math.max(h.from,s)-c,m=Math.min(h.to,f)-c;h=p>=m?null:new pc(p,m,h.tree,h.offset+c,o>0,!!d)}if(h&&i.push(h),a.to>f)break;a=lnew It(i.from,i.to)):[new It(0,0)]:[new It(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let l=i.advance();if(l)return l}}};u(D4,"Parser");let If=D4;const P4=class P4{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}};u(P4,"StringInput");let tb=P4;function lj(t){return(e,n,r,i)=>new ib(e,t,n,r,i)}u(lj,"parseMixed");const E4=class E4{constructor(e,n,r,i,l){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.from=l}};u(E4,"InnerParse");let Lf=E4;function UT(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}u(UT,"checkRanges");const T4=class T4{constructor(e,n,r,i,l,a,o){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=l,this.target=a,this.prev=o,this.depth=0,this.ranges=[]}};u(T4,"ActiveOverlay");let nb=T4;const rb=new ue({perNode:!0}),A4=class A4{constructor(e,n,r,i,l){this.nest=n,this.input=r,this.fragments=i,this.ranges=l,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Le(r.type,r.children,r.positions,r.length,r.propValues.concat([[rb,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[ue.mounted.id]=new yl(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(d=>d.frag.from<=i.from&&d.frag.to>=i.to&&d.mount.overlay);if(c)for(let d of c.mount.overlay){let f=d.from+c.pos,h=d.to+c.pos;f>=i.from&&h<=i.to&&!n.ranges.some(p=>p.fromf)&&n.ranges.push({from:f,to:h})}}o=!1}else if(r&&(a=aj(r.ranges,i.from,i.to)))o=a!=2;else if(!i.type.isAnonymous&&(l=this.nest(i,this.input))&&(i.fromnew It(f.from-i.from,f.to-i.from)):null,i.tree,d.length?d[0].from:i.from)),l.overlay?d.length&&(r={ranges:d,depth:0,prev:r}):o=!1}}else if(n&&(s=n.predicate(i))&&(s===!0&&(s=new It(i.from,i.to)),s.from=0&&n.ranges[c].to==s.from?n.ranges[c]={from:n.ranges[c].from,to:s.to}:n.ranges.push(s)}if(o&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=_T(this.ranges,n.ranges);c.length&&(UT(c),this.inner.splice(n.index,0,new Lf(n.parser,n.parser.startParse(this.input,HT(n.mounts,c),c),n.ranges.map(d=>new It(d.from-n.start,d.to-n.start)),n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}};u(A4,"MixedParse");let ib=A4;function aj(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}u(aj,"checkCover");function GT(t,e,n,r,i,l){if(e=e&&n.enter(r,1,Ae.IgnoreOverlays|Ae.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Le)n=n.children[0];else break}return!1}};u(Q4,"StructureCursor");let zf=Q4,sj=(mc=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(rb))!==null&&n!==void 0?n:r.to,this.inner=new zf(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(rb))!==null&&e!==void 0?e:n.to,this.inner=new zf(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let l=this.inner.cursor.node;l;l=l.parent){let a=(r=l.tree)===null||r===void 0?void 0:r.prop(ue.mounted);if(a&&a.parser==n)for(let o=this.fragI;o=l.to)break;s.tree==this.curFrag.tree&&i.push({frag:s,pos:l.from-s.offset,mount:a})}}}return i}},u(mc,"FragmentCursor"),mc);function _T(t,e){let n=null,r=e;for(let i=1,l=0;i=o)break;s.to<=a||(n||(r=n=e.slice()),s.fromo&&n.splice(l+1,0,new It(o,s.to))):s.to>o?n[l--]=new It(o,s.to):n.splice(l--,1))}}return r}u(_T,"punchRanges");function uj(t,e,n,r){let i=0,l=0,a=!1,o=!1,s=-1e9,c=[];for(;;){let d=i==t.length?1e9:a?t[i].to:t[i].from,f=l==e.length?1e9:o?e[l].to:e[l].from;if(a!=o){let h=Math.max(s,n),p=Math.min(d,f,r);hnew It(h.from+r,h.to+r)),f=uj(e,d,s,c);for(let h=0,p=s;;h++){let m=h==f.length,g=m?c:f[h].from;if(g>p&&n.push(new Ci(p,g,i.tree,-a,l.from>=p||l.openStart,l.to<=g||l.openEnd)),m)break;p=f[h].to}}else n.push(new Ci(s,c,i.tree,-a,l.from>=a||l.openStart,l.to<=o||l.openEnd))}return n}u(HT,"enterFragments");let cj=0;const gc=class gc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=cj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof gc&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new gc(r,[],null,[]);if(i.set.push(i),n)for(let l of n.set)i.set.push(l);return i}static defineModifier(e){let n=new Zf(e);return r=>r.modified.indexOf(n)>-1?r:Zf.get(r.base||r,r.modified.concat(n).sort((i,l)=>i.id-l.id))}};u(gc,"Tag");let Mn=gc,dj=0;const zp=class zp{constructor(e){this.name=e,this.instances=[],this.id=dj++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(o=>o.base==e&&fj(n,o.modified));if(r)return r;let i=[],l=new Mn(e.name,i,e,n);for(let o of n)o.instances.push(l);let a=hj(n);for(let o of e.set)if(!o.modified.length)for(let s of a)i.push(zp.get(o,s));return l}};u(zp,"Modifier");let Zf=zp;function fj(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}u(fj,"sameArray");function hj(t){let e=[[]];for(let n=0;nr.length-n.length)}u(hj,"powerSet");function Xf(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let l=[],a=2,o=i;for(let f=0;;){if(o=="..."&&f>0&&f+3==i.length){a=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!h)throw new RangeError("Invalid path: "+i);if(l.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let p=i[f++];if(f==i.length&&p=="!"){a=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);o=i.slice(f)}let s=l.length-1,c=l[s];if(!c)throw new RangeError("Invalid path: "+i);let d=new qa(r,a,s>0?l.slice(0,s):null);e[c]=d.sort(e[c])}}return JT.add(e)}u(Xf,"styleTags");const JT=new ue,M4=class M4{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=i;for(let o of l)for(let s of o.set){let c=n[s.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}u(e7,"tagHighlighter");function pj(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}u(pj,"highlightTags");function mj(t,e,n,r=0,i=t.length){let l=new lb(r,Array.isArray(e)?e:[e],n);l.highlightRange(t.cursor(),r,i,"",l.highlighters),l.flush(i)}u(mj,"highlightTree");const B4=class B4{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,l){let{type:a,from:o,to:s}=e;if(o>=r||s<=n)return;a.isTop&&(l=this.highlighters.filter(p=>!p.scope||p.scope(a)));let c=i,d=gj(e)||qa.empty,f=pj(l,d.tags);if(f&&(c&&(c+=" "),c+=f,d.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,o),c),d.opaque)return;let h=e.tree&&e.tree.prop(ue.mounted);if(h&&h.overlay){let p=e.node.enter(h.overlay[0].from+o,1),m=this.highlighters.filter(O=>!O.scope||O.scope(h.tree.type)),g=e.firstChild();for(let O=0,b=o;;O++){let y=O=$||!e.nextSibling())););if(!y||$>r)break;b=y.to+o,b>n&&(this.highlightRange(p.cursor(),Math.max(n,y.from+o),Math.min(r,b),"",m),this.startSpan(Math.min(r,b),c))}g&&e.parent()}else if(e.firstChild()){h&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,l),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}};u(B4,"HighlightBuilder");let lb=B4;function gj(t){let e=t.type.prop(JT);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}u(gj,"getStyleTags");const Y=Mn.define,jf=Y(),ki=Y(),t7=Y(ki),n7=Y(ki),Di=Y(),qf=Y(Di),ab=Y(Di),lr=Y(),$l=Y(lr),ar=Y(),or=Y(),ob=Y(),ru=Y(ob),Wf=Y(),V={comment:jf,lineComment:Y(jf),blockComment:Y(jf),docComment:Y(jf),name:ki,variableName:Y(ki),typeName:t7,tagName:Y(t7),propertyName:n7,attributeName:Y(n7),className:Y(ki),labelName:Y(ki),namespace:Y(ki),macroName:Y(ki),literal:Di,string:qf,docString:Y(qf),character:Y(qf),attributeValue:Y(qf),number:ab,integer:Y(ab),float:Y(ab),bool:Y(Di),regexp:Y(Di),escape:Y(Di),color:Y(Di),url:Y(Di),keyword:ar,self:Y(ar),null:Y(ar),atom:Y(ar),unit:Y(ar),modifier:Y(ar),operatorKeyword:Y(ar),controlKeyword:Y(ar),definitionKeyword:Y(ar),moduleKeyword:Y(ar),operator:or,derefOperator:Y(or),arithmeticOperator:Y(or),logicOperator:Y(or),bitwiseOperator:Y(or),compareOperator:Y(or),updateOperator:Y(or),definitionOperator:Y(or),typeOperator:Y(or),controlOperator:Y(or),punctuation:ob,separator:Y(ob),bracket:ru,angleBracket:Y(ru),squareBracket:Y(ru),paren:Y(ru),brace:Y(ru),content:lr,heading:$l,heading1:Y($l),heading2:Y($l),heading3:Y($l),heading4:Y($l),heading5:Y($l),heading6:Y($l),contentSeparator:Y(lr),list:Y(lr),quote:Y(lr),emphasis:Y(lr),strong:Y(lr),link:Y(lr),monospace:Y(lr),strikethrough:Y(lr),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Wf,documentMeta:Y(Wf),annotation:Y(Wf),processingInstruction:Y(Wf),definition:Mn.defineModifier("definition"),constant:Mn.defineModifier("constant"),function:Mn.defineModifier("function"),standard:Mn.defineModifier("standard"),local:Mn.defineModifier("local"),special:Mn.defineModifier("special")};for(let t in V){let e=V[t];e instanceof Mn&&(e.name=t)}e7([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var sb;const Wa=new ue;function r7(t){return _.define({combine:t?e=>e.concat(t):void 0})}u(r7,"defineLanguageFacet");const ub=new ue,R4=class R4{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Xe.prototype.hasOwnProperty("tree")||Object.defineProperty(Xe.prototype,"tree",{get(){return ze(this)}}),this.parser=n,this.extension=[Pi.of(this),Xe.languageData.of((l,a,o)=>{let s=i7(l,a,o),c=s.type.prop(Wa);if(!c)return[];let d=l.facet(c),f=s.type.prop(ub);if(f){let h=s.resolve(a-s.from,o);for(let p of f)if(p.test(h,l)){let m=l.facet(p.facet);return p.type=="replace"?m:m.concat(d)}}return d})].concat(r)}isActiveAt(e,n,r=-1){return i7(e,n,r).type.prop(Wa)==this.data}findRegions(e){let n=e.facet(Pi);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=u((l,a)=>{if(l.prop(Wa)==this.data){r.push({from:a,to:a+l.length});return}let o=l.prop(ue.mounted);if(o){if(o.tree.prop(Wa)==this.data){if(o.overlay)for(let s of o.overlay)r.push({from:s.from+a,to:s.to+a});else r.push({from:a,to:a+l.length});return}else if(o.overlay){let s=r.length;if(i(o.tree,o.overlay[0].from+a),r.length>s)return}}for(let s=0;sr.isTop?n:void 0)]}),e.name)}configure(e,n){return new Oc(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};u(Oc,"LRLanguage");let iu=Oc;function ze(t){let e=t.field(tn.state,!1);return e?e.tree:Le.empty}u(ze,"syntaxTree");const V4=class V4{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}};u(V4,"DocInput");let cb=V4,lu=null,Oj=(Kl=class{constructor(e,n,r=[],i,l,a,o,s){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=l,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Kl(e,n,[],Le.empty,0,r,[],null)}startParse(){return this.parser.startParse(new cb(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Le.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=u(()=>Date.now()>i,"until")}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ci.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=lu;lu=this;try{return e()}finally{lu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=l7(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:l,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let s=[];if(e.iterChangedRanges((c,d,f,h)=>s.push({fromA:c,toA:d,fromB:f,toB:h})),r=Ci.applyChanges(r,s),i=Le.empty,l=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);de.from&&(this.fragments=l7(this.fragments,i,l),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends If{createParse(n,r,i){let l=i[0].from,a=i[i.length-1].to;return{parsedPos:l,advance(){let s=lu;if(s){for(let c of i)s.tempSkipped.push(c);e&&(s.scheduleOn=s.scheduleOn?Promise.all([s.scheduleOn,e]):e)}return this.parsedPos=a,new Le(en.none,[],[],a-l)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return lu}},u(Kl,"ParseContext"),Kl);function l7(t,e,n){return Ci.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}u(l7,"cutFragments");const bc=class bc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new bc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Oj.create(e.facet(Pi).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new bc(r)}};u(bc,"LanguageState");let au=bc;tn.state=Gt.define({create:au.init,update(t,e){for(let n of e.effects)if(n.is(tn.setState))return n.value;return e.startState.facet(Pi)!=e.state.facet(Pi)?au.init(e.state):t.apply(e)}});let a7=u(t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)},"requestIdle");typeof requestIdleCallback<"u"&&(a7=u(t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)},"requestIdle"));const db=typeof navigator<"u"&&(!((sb=navigator.scheduling)===null||sb===void 0)&&sb.isInputPending)?()=>navigator.scheduling.isInputPending():null,bj=it.fromClass((yc=class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(tn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(tn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=a7(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,s=l.context.work(()=>db&&db()||Date.now()>a,i+(o?0:1e5));this.chunkBudget-=Date.now()-n,(s||this.chunkBudget<=0)&&(l.context.takeTree(),this.view.dispatch({effects:tn.setState.of(new au(l.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(l.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ht(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},u(yc,"ParseWorker"),yc),{eventHandlers:{focus(){this.scheduleWork()}}}),Pi=_.define({combine(t){return t.length?t[0]:null},enables:t=>[tn.state,bj,J.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),N4=class N4{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};u(N4,"LanguageSupport");let ou=N4;const yj=_.define(),su=_.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Yf(t){let e=t.facet(su);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}u(Yf,"getIndentUnit");function uu(t,e){let n="",r=t.tabSize,i=t.facet(su)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let l=0;l=e?vj(t,n,e):null}u(fb,"getIndentation");const F4=class F4{constructor(e,n={}){this.state=e,this.options=n,this.unit=Yf(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:l}=this.options;return i!=null&&i>=r.from&&i<=r.to?l&&i==e?{text:"",from:e}:(n<0?i-1&&(l+=a-this.countColumn(r,r.search(/\S|$/))),l}countColumn(e,n=e.length){return Na(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),l=this.options.overrideIndentation;if(l){let a=l(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}};u(F4,"IndentContext");let Ya=F4;const Kf=new ue;function vj(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let l=[];for(let a=i;a&&!(a.fromr.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)l.push(a);for(let a=l.length-1;a>=0;a--)r={node:l[a],next:r}}return o7(r,t,n)}u(vj,"syntaxIndentation");function o7(t,e,n){for(let r=t;r;r=r.next){let i=wj(r.node);if(i)return i(hb.create(e,n,r))}return 0}u(o7,"indentFor");function $j(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}u($j,"ignoreClosed");function wj(t){let e=t.type.prop(Kf);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(ue.closedBy))){let i=t.lastChild,l=i&&r.indexOf(i.name)>-1;return a=>s7(a,!0,1,void 0,l&&!$j(a)?i.from:void 0)}return t.parent==null?xj:null}u(wj,"indentStrategy");function xj(){return 0}u(xj,"topIndent");const Zp=class Zp extends Ya{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Zp(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Sj(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return o7(this.context.next,this.base,this.pos)}};u(Zp,"TreeIndentContext");let hb=Zp;function Sj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}u(Sj,"isParent");function Cj(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,l=t.state.doc.lineAt(n.from),a=i==null||i<=l.from?l.to:Math.min(l.to,i);for(let o=n.to;;){let s=e.childAfter(o);if(!s||s==r)return null;if(!s.type.isSkipped){if(s.from>=a)return null;let c=/^ */.exec(l.text.slice(n.to-l.from))[0].length;return{from:n.from,to:n.to+c}}o=s.to}}u(Cj,"bracketedAligned");function kj({closing:t,align:e=!0,units:n=1}){return r=>s7(r,e,n,t)}u(kj,"delimitedIndent");function s7(t,e,n,r,i){let l=t.textAfter,a=l.match(/^\s*/)[0].length,o=r&&l.slice(a,a+r.length)==r||i==t.pos+a,s=e?Cj(t):null;return s?o?t.column(s.from):t.column(s.to):t.baseIndent+(o?0:t.unit*n)}u(s7,"delimitedStrategy");const Dj=u(t=>t.baseIndent,"flatIndent");function Uf({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}u(Uf,"continuedIndent");const Pj=200;function Ej(){return Xe.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+Pj)return t;let l=n.sliceString(i.from,r);if(!e.some(c=>c.test(l)))return t;let{state:a}=t,o=-1,s=[];for(let{head:c}of a.selection.ranges){let d=a.doc.lineAt(c);if(d.from==o)continue;o=d.from;let f=fb(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],p=uu(a,f);h!=p&&s.push({from:d.from,to:d.from+h.length,insert:p})}return s.length?[t,{changes:s,sequential:!0}]:t})}u(Ej,"indentOnInput");const Tj=_.define(),Gf=new ue;function u7(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(l&&o.from=e&&c.to>n&&(l=c)}}return l}u(Aj,"syntaxFolding");function Qj(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}u(Qj,"isUnfinished");function _f(t,e,n){for(let r of t.facet(Tj)){let i=r(t,e,n);if(i)return i}return Aj(t,e,n)}u(_f,"foldable");function c7(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}u(c7,"mapRange");const Hf=Oe.define({map:c7}),cu=Oe.define({map:c7});function d7(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}u(d7,"selectedLines");const wl=Gt.define({create(){return re.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=f7(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Hf)&&!Mj(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(pb),i=r?re.replace({widget:new mb(r(e.state,n.value))}):O7;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(cu)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=f7(t,e.selection.main.head)),t},provide:t=>J.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{ie&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,l)=>i>=n||l<=e}):t}u(f7,"clearTouchedFolds");function Jf(t,e,n){var r;let i=null;return(r=t.field(wl,!1))===null||r===void 0||r.between(e,n,(l,a)=>{(!i||i.from>l)&&(i={from:l,to:a})}),i}u(Jf,"findFold");function Mj(t,e,n){let r=!1;return t.between(e,e,(i,l)=>{i==e&&l==n&&(r=!0)}),r}u(Mj,"foldExists");function h7(t,e){return t.field(wl,!1)?e:e.concat(Oe.appendConfig.of(m7()))}u(h7,"maybeEnable");const Bj=u(t=>{for(let e of d7(t)){let n=_f(t.state,e.from,e.to);if(n)return t.dispatch({effects:h7(t.state,[Hf.of(n),p7(t,n)])}),!0}return!1},"foldCode"),Rj=u(t=>{if(!t.state.field(wl,!1))return!1;let e=[];for(let n of d7(t)){let r=Jf(t.state,n.from,n.to);r&&e.push(cu.of(r),p7(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0},"unfoldCode");function p7(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return J.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}u(p7,"announceFold");const Vj=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Bj},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Rj},{key:"Ctrl-Alt-[",run:u(t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(wl,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(cu.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},"unfoldAll")}],Nj={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},pb=_.define({combine(t){return bi(t,Nj)}});function m7(t){let e=[wl,Lj];return t&&e.push(pb.of(t)),e}u(m7,"codeFolding");function g7(t,e){let{state:n}=t,r=n.facet(pb),i=u(a=>{let o=t.lineBlockAt(t.posAtDOM(a.target)),s=Jf(t.state,o.from,o.to);s&&t.dispatch({effects:cu.of(s)}),a.preventDefault()},"onclick");if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let l=document.createElement("span");return l.textContent=r.placeholderText,l.setAttribute("aria-label",n.phrase("folded code")),l.title=n.phrase("unfold"),l.className="cm-foldPlaceholder",l.onclick=i,l}u(g7,"widgetToDOM");const O7=re.replace({widget:new class extends er{toDOM(t){return g7(t,null)}}}),I4=class I4 extends er{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return g7(e,this.value)}};u(I4,"PreparedFoldWidget");let mb=I4;const Fj={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},L4=class L4 extends Qn{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}};u(L4,"FoldMarker");let du=L4;function Ij(t={}){let e={...Fj,...t},n=new du(e,!0),r=new du(e,!1),i=it.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(Pi)!=a.state.facet(Pi)||a.startState.field(wl,!1)!=a.state.field(wl,!1)||ze(a.startState)!=ze(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let o=new fl;for(let s of a.viewportLineBlocks){let c=Jf(a.state,s.from,s.to)?r:_f(a.state,s.from,s.to)?n:null;c&&o.add(s.from,s.from,c)}return o.finish()}}),{domEventHandlers:l}=e;return[i,SX({class:"cm-foldGutter",markers(a){var o;return((o=a.plugin(i))===null||o===void 0?void 0:o.markers)||Te.empty},initialSpacer(){return new du(e,!1)},domEventHandlers:{...l,click:(a,o,s)=>{if(l.click&&l.click(a,o,s))return!0;let c=Jf(a.state,o.from,o.to);if(c)return a.dispatch({effects:cu.of(c)}),!0;let d=_f(a.state,o.from,o.to);return d?(a.dispatch({effects:Hf.of(d)}),!0):!1}}}),m7()]}u(Ij,"foldGutter");const Lj=J.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),Xp=class Xp{constructor(e,n){this.specs=e;let r;function i(o){let s=_n.newName();return(r||(r=Object.create(null)))["."+s]=o,s}u(i,"def");const l=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof tn?o=>o.prop(Wa)==a.data:a?o=>o==a:void 0,this.style=e7(e.map(o=>({tag:o.tag,class:o.class||i(Object.assign({},o,{tag:null}))})),{all:l}).style,this.module=r?new _n(r):null,this.themeType=n.themeType}static define(e,n){return new Xp(e,n||{})}};u(Xp,"HighlightStyle");let eh=Xp;const gb=_.define(),b7=_.define({combine(t){return t.length?[t[0]]:null}});function Ob(t){let e=t.facet(gb);return e.length?e:t.facet(b7)}u(Ob,"getHighlighters");function zj(t,e){let n=[Zj],r;return t instanceof eh&&(t.module&&n.push(J.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(b7.of(t)):r?n.push(gb.computeN([J.darkTheme],i=>i.facet(J.darkTheme)==(r=="dark")?[t]:[])):n.push(gb.of(t)),n}u(zj,"syntaxHighlighting");const z4=class z4{constructor(e){this.markCache=Object.create(null),this.tree=ze(e.state),this.decorations=this.buildDeco(e,Ob(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ze(e.state),r=Ob(e.state),i=r!=Ob(e.startState),{viewport:l}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length=l.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=l.to)}buildDeco(e,n){if(!n||!this.tree.length)return re.none;let r=new fl;for(let{from:i,to:l}of e.visibleRanges)mj(this.tree,n,(a,o,s)=>{r.add(a,o,this.markCache[s]||(this.markCache[s]=re.mark({class:s})))},i,l);return r.finish()}};u(z4,"TreeHighlighter");let bb=z4;const Zj=dl.high(it.fromClass(bb,{decorations:t=>t.decorations})),Xj=eh.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),jj=J.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),y7=1e4,v7="()[]{}",$7=_.define({combine(t){return bi(t,{afterCursor:!0,brackets:v7,maxScanDistance:y7,renderMatch:Yj})}}),qj=re.mark({class:"cm-matchingBracket"}),Wj=re.mark({class:"cm-nonmatchingBracket"});function Yj(t){let e=[],n=t.matched?qj:Wj;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}u(Yj,"defaultRenderMatch");const Kj=[Gt.define({create(){return re.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet($7);for(let i of e.state.selection.ranges){if(!i.empty)continue;let l=sr(e.state,i.head,-1,r)||i.head>0&&sr(e.state,i.head-1,1,r)||r.afterCursor&&(sr(e.state,i.head,1,r)||i.headJ.decorations.from(t)}),jj];function Uj(t={}){return[$7.of(t),Kj]}u(Uj,"bracketMatching");const w7=new ue;function yb(t,e,n){let r=t.prop(e<0?ue.openedBy:ue.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}u(yb,"matchingNodes");function vb(t){let e=t.type.prop(w7);return e?e(t.node):t}u(vb,"findHandle");function sr(t,e,n,r={}){let i=r.maxScanDistance||y7,l=r.brackets||v7,a=ze(t),o=a.resolveInner(e,n);for(let s=o;s;s=s.parent){let c=yb(s.type,n,l);if(c&&s.from0?e>=d.from&&ed.from&&e<=d.to))return Gj(t,e,n,s,d,c,l)}}return _j(t,e,n,a,o.type,i,l)}u(sr,"matchBrackets");function Gj(t,e,n,r,i,l,a){let o=r.parent,s={from:i.from,to:i.to},c=0,d=o?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(c==0&&l.indexOf(d.type.name)>-1&&d.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!d.next().done&&h<=l;){let p=d.value;n<0&&(h+=p.length);let m=e+h*n;for(let g=n>0?0:p.length-1,O=n>0?p.length:-1;g!=O;g+=n){let b=a.indexOf(p[g]);if(!(b<0||r.resolveInner(m+g,1).type!=i))if(b%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:m+g,to:m+g+1},matched:b>>1==s>>1};f--}}n>0&&(h+=p.length)}return d.done?{start:c,matched:!1}:null}u(_j,"matchPlainBrackets");const Hj=Object.create(null),x7=[en.none],S7=[],C7=Object.create(null),Jj=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Jj[t]=eq(Hj,e);function $b(t,e){S7.indexOf(t)>-1||(S7.push(t),console.warn(e))}u($b,"warnForPart");function eq(t,e){let n=[];for(let o of e.split(" ")){let s=[];for(let c of o.split(".")){let d=t[c]||V[c];d?typeof d=="function"?s.length?s=s.map(d):$b(c,`Modifier ${c} used at start of tag`):s.length?$b(c,`Tag ${c} used as modifier`):s=Array.isArray(d)?d:[d]:$b(c,`Unknown highlighting tag ${c}`)}for(let c of s)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(o=>o.id),l=C7[i];if(l)return l.id;let a=C7[i]=en.define({id:x7.length,name:r,props:[Xf({[r]:n})]});return x7.push(a),a.id}u(eq,"createTokenType"),Ve.RTL,Ve.LTR;const tq=u(t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=xb(t.state,n.from);return r.line?nq(t):r.block?iq(t):!1},"toggleComment");function wb(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}u(wb,"command");const nq=wb(oq,0),rq=wb(k7,0),iq=wb((t,e)=>k7(t,e,aq(e)),0);function xb(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}u(xb,"getConfig");const fu=50;function lq(t,{open:e,close:n},r,i){let l=t.sliceDoc(r-fu,r),a=t.sliceDoc(i,i+fu),o=/\s*$/.exec(l)[0].length,s=/^\s*/.exec(a)[0].length,c=l.length-o;if(l.slice(c-e.length,c)==e&&a.slice(s,s+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:i+s,margin:s&&1}};let d,f;i-r<=2*fu?d=f=t.sliceDoc(r,i):(d=t.sliceDoc(r,r+fu),f=t.sliceDoc(i-fu,i));let h=/^\s*/.exec(d)[0].length,p=/\s*$/.exec(f)[0].length,m=f.length-p-n.length;return d.slice(h,h+e.length)==e&&f.slice(m,m+n.length)==n?{open:{pos:r+h+e.length,margin:/\s/.test(d.charAt(h+e.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}u(lq,"findBlockComment");function aq(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let l=e.length-1;l>=0&&e[l].to>r.from?e[l].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}u(aq,"selectedLineRanges");function k7(t,e,n=e.selection.ranges){let r=n.map(l=>xb(e,l.from).block);if(!r.every(l=>l))return null;let i=n.map((l,a)=>lq(e,r[a],l.from,l.to));if(t!=2&&!i.every(l=>l))return{changes:e.changes(n.map((l,a)=>i[a]?[]:[{from:l.from,insert:r[a].open+" "},{from:l.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(l=>l)){let l=[];for(let a=0,o;ai&&(l==a||a>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,p=h==f.length,m=f.text.slice(h,h+c.length)==c?h:-1;hl.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:o,token:s,indent:c,empty:d,single:f}of r)(f||!d)&&l.push({from:o.from+c,insert:s+" "});let a=e.changes(l);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(l=>l.comment>=0)){let l=[];for(let{line:a,comment:o,token:s}of r)if(o>=0){let c=a.from+o,d=c+s.length;a.text[d-a.from]==" "&&d++,l.push({from:c,to:d})}return{changes:l}}return null}u(oq,"changeLineComment");const Sb=Tn.define(),sq=Tn.define(),uq=_.define(),D7=_.define({combine(t){return bi(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),P7=Gt.define({create(){return hu.empty},update(t,e){let n=e.state.facet(D7),r=e.annotation(Sb);if(r){let s=Bn.fromTransaction(e,r.selection),c=r.side,d=c==0?t.undone:t.done;return s?d=nh(d,d.length,n.minDepth,s):d=A7(d,e.startState.selection),new hu(c==0?r.rest:d,c==0?d:r.rest)}let i=e.annotation(sq);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(xt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let l=Bn.fromTransaction(e),a=e.annotation(xt.time),o=e.annotation(xt.userEvent);return l?t=t.addChanges(l,a,o,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,o,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new hu(t.done.map(Bn.fromJSON),t.undone.map(Bn.fromJSON))}});function cq(t={}){return[P7,D7.of(t),J.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?E7:e.inputType=="historyRedo"?Cb:null;return r?(e.preventDefault(),r(n)):!1}})]}u(cq,"history$1");function th(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(P7,!1);if(!i)return!1;let l=i.pop(t,n,e);return l?(r(l),!0):!1}}u(th,"cmd");const E7=th(0,!1),Cb=th(1,!1),dq=th(0,!0),fq=th(1,!0),Ul=class Ul{constructor(e,n,r,i,l){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=l}setSelAfter(e){return new Ul(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ul(e.changes&&Ut.fromJSON(e.changes),[],e.mapped&&gi.fromJSON(e.mapped),e.startSelection&&X.fromJSON(e.startSelection),e.selectionsAfter.map(X.fromJSON))}static fromTransaction(e,n){let r=vn;for(let i of e.startState.facet(uq)){let l=i(e);l.length&&(r=r.concat(l))}return!r.length&&e.changes.empty?null:new Ul(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,vn)}static selection(e){return new Ul(void 0,vn,void 0,void 0,e)}};u(Ul,"HistEvent");let Bn=Ul;function nh(t,e,n,r){let i=e+1>n+20?e-n-1:0,l=t.slice(i,e);return l.push(r),l}u(nh,"updateBranch");function hq(t,e){let n=[],r=!1;return t.iterChangedRanges((i,l)=>n.push(i,l)),e.iterChangedRanges((i,l,a,o)=>{for(let s=0;s=c&&a<=d&&(r=!0)}}),r}u(hq,"isAdjacent");function pq(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}u(pq,"eqSelectionShape");function T7(t,e){return t.length?e.length?t.concat(e):t:e}u(T7,"conc");const vn=[],mq=200;function A7(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-mq));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),nh(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Bn.selection([e])]}u(A7,"addSelection");function gq(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}u(gq,"popSelection");function kb(t,e){if(!t.length)return t;let n=t.length,r=vn;for(;n;){let i=Oq(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let l=t.slice(0,n);return l[n-1]=i,l}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Bn.selection(r)]:vn}u(kb,"addMappingToBranch");function Oq(t,e,n){let r=T7(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):vn,n);if(!t.changes)return Bn.selection(r);let i=t.changes.map(e),l=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(l):l;return new Bn(i,Oe.mapEffects(t.effects,e),a,t.startSelection.map(l),r)}u(Oq,"mapEvent");const bq=/^(input\.type|delete)($|\.)/;let hu=(ei=class{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new ei(this.done,this.undone):this}addChanges(e,n,r,i,l){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||bq.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):rh(n,e))}u(Q7,"cursorByChar");function ht(t){return t.textDirectionAt(t.state.selection.main.head)==Ve.LTR}u(ht,"ltrAtCursor");const M7=u(t=>Q7(t,!ht(t)),"cursorCharLeft"),B7=u(t=>Q7(t,ht(t)),"cursorCharRight");function R7(t,e){return Vn(t,n=>n.empty?t.moveByGroup(n,e):rh(n,e))}u(R7,"cursorByGroup");const vq=u(t=>R7(t,!ht(t)),"cursorGroupLeft"),$q=u(t=>R7(t,ht(t)),"cursorGroupRight");function wq(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}u(wq,"interestingNode");function ih(t,e,n){let r=ze(t).resolveInner(e.head),i=n?ue.closedBy:ue.openedBy;for(let s=e.head;;){let c=n?r.childAfter(s):r.childBefore(s);if(!c)break;wq(t,c,i)?r=c:s=n?c.to:c.from}let l=r.type.prop(i),a,o;return l&&(a=n?sr(t,r.from,1):sr(t,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,X.cursor(o,n?-1:1)}u(ih,"moveBySyntax");const xq=u(t=>Vn(t,e=>ih(t.state,e,!ht(t))),"cursorSyntaxLeft"),Sq=u(t=>Vn(t,e=>ih(t.state,e,ht(t))),"cursorSyntaxRight");function V7(t,e){return Vn(t,n=>{if(!n.empty)return rh(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}u(V7,"cursorByLine");const N7=u(t=>V7(t,!1),"cursorLineUp"),F7=u(t=>V7(t,!0),"cursorLineDown");function I7(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):rh(a,e));if(i.eq(r.selection))return!1;let l;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;a&&a.top>s&&a.bottomL7(t,!1),"cursorPageUp"),Db=u(t=>L7(t,!0),"cursorPageDown");function Ei(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let l=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;l&&e.head!=r.from+l&&(i=X.cursor(r.from+l))}return i}u(Ei,"moveByLineBoundary");const Cq=u(t=>Vn(t,e=>Ei(t,e,!0)),"cursorLineBoundaryForward"),kq=u(t=>Vn(t,e=>Ei(t,e,!1)),"cursorLineBoundaryBackward"),Dq=u(t=>Vn(t,e=>Ei(t,e,!ht(t))),"cursorLineBoundaryLeft"),Pq=u(t=>Vn(t,e=>Ei(t,e,ht(t))),"cursorLineBoundaryRight"),Eq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).from,1)),"cursorLineStart"),Tq=u(t=>Vn(t,e=>X.cursor(t.lineBlockAt(e.head).to,-1)),"cursorLineEnd");function Aq(t,e,n){let r=!1,i=Ka(t.selection,l=>{let a=sr(t,l.head,-1)||sr(t,l.head,1)||l.head>0&&sr(t,l.head-1,1)||l.headAq(t,e,!1),"cursorMatchingBracket");function $n(t,e){let n=Ka(t.state.selection,r=>{let i=e(r);return X.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Rn(t.state,n)),!0)}u($n,"extendSel");function Z7(t,e){return $n(t,n=>t.moveByChar(n,e))}u(Z7,"selectByChar");const X7=u(t=>Z7(t,!ht(t)),"selectCharLeft"),j7=u(t=>Z7(t,ht(t)),"selectCharRight");function q7(t,e){return $n(t,n=>t.moveByGroup(n,e))}u(q7,"selectByGroup");const Mq=u(t=>q7(t,!ht(t)),"selectGroupLeft"),Bq=u(t=>q7(t,ht(t)),"selectGroupRight"),Rq=u(t=>$n(t,e=>ih(t.state,e,!ht(t))),"selectSyntaxLeft"),Vq=u(t=>$n(t,e=>ih(t.state,e,ht(t))),"selectSyntaxRight");function W7(t,e){return $n(t,n=>t.moveVertically(n,e))}u(W7,"selectByLine");const Y7=u(t=>W7(t,!1),"selectLineUp"),K7=u(t=>W7(t,!0),"selectLineDown");function U7(t,e){return $n(t,n=>t.moveVertically(n,e,I7(t).height))}u(U7,"selectByPage");const G7=u(t=>U7(t,!1),"selectPageUp"),_7=u(t=>U7(t,!0),"selectPageDown"),Nq=u(t=>$n(t,e=>Ei(t,e,!0)),"selectLineBoundaryForward"),Fq=u(t=>$n(t,e=>Ei(t,e,!1)),"selectLineBoundaryBackward"),Iq=u(t=>$n(t,e=>Ei(t,e,!ht(t))),"selectLineBoundaryLeft"),Lq=u(t=>$n(t,e=>Ei(t,e,ht(t))),"selectLineBoundaryRight"),zq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).from)),"selectLineStart"),Zq=u(t=>$n(t,e=>X.cursor(t.lineBlockAt(e.head).to)),"selectLineEnd"),H7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:0})),!0),"cursorDocStart"),J7=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.doc.length})),!0),"cursorDocEnd"),eA=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:0})),!0),"selectDocStart"),tA=u(({state:t,dispatch:e})=>(e(Rn(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),"selectDocEnd"),Xq=u(({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),"selectAll$1"),jq=u(({state:t,dispatch:e})=>{let n=ah(t).map(({from:r,to:i})=>X.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:X.create(n),userEvent:"select"})),!0},"selectLine"),qq=u(({state:t,dispatch:e})=>{let n=Ka(t.selection,r=>{let i=ze(t),l=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=l.node.from&&a.node.to<=l.node.to&&(l=a)}for(let a=l;a;a=a.next){let{node:o}=a;if((o.from=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return X.range(o.to,o.from)}return r});return n.eq(t.selection)?!1:(e(Rn(t,n)),!0)},"selectParentSyntax");function nA(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let l of n.selection.ranges){let a=n.doc.lineAt(l.head);if(e?a.to0)for(let o=l;;){let s=t.moveVertically(o,e);if(s.heada.to){i.some(c=>c.head==s.head)||i.push(s);break}else{if(s.head==o.head)break;o=s}}}return i.length==r.ranges.length?!1:(t.dispatch(Rn(n,X.create(i,i.length-1))),!0)}u(nA,"addCursorVertically");const Wq=u(t=>nA(t,!1),"addCursorAbove"),Yq=u(t=>nA(t,!0),"addCursorBelow"),Kq=u(({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=X.create([n.main]):n.main.empty||(r=X.create([X.cursor(n.main.head)])),r?(e(Rn(t,r)),!0):!1},"simplifySelection");function pu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(l=>{let{from:a,to:o}=l;if(a==o){let s=e(l);sa&&(n="delete.forward",s=lh(t,s,!0)),a=Math.min(a,s),o=Math.max(o,s)}else a=lh(t,a,!1),o=lh(t,o,!0);return a==o?{range:l}:{changes:{from:a,to:o},range:X.cursor(a,ai(t)))r.between(e,e,(i,l)=>{ie&&(e=n?l:i)});return e}u(lh,"skipAtomic");const rA=u((t,e,n)=>pu(t,r=>{let i=r.from,{state:l}=t,a=l.doc.lineAt(i),o,s;if(n&&!e&&i>a.from&&irA(t,!1,!0),"deleteCharBackward"),iA=u(t=>rA(t,!0,!1),"deleteCharForward"),lA=u((t,e)=>pu(t,n=>{let r=n.head,{state:i}=t,l=i.doc.lineAt(r),a=i.charCategorizer(r);for(let o=null;;){if(r==(e?l.to:l.from)){r==n.head&&l.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let s=wt(l.text,r-l.from,e)+l.from,c=l.text.slice(Math.min(r,s)-l.from,Math.max(r,s)-l.from),d=a(c);if(o!=null&&d!=o)break;(c!=" "||r!=n.head)&&(o=d),r=s}return r}),"deleteByGroup"),aA=u(t=>lA(t,!1),"deleteGroupBackward"),Uq=u(t=>lA(t,!0),"deleteGroupForward"),Gq=u(t=>pu(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headpu(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),"deleteLineBoundaryBackward"),Hq=u(t=>pu(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:pe.of(["",""])},range:X.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},"splitLine"),eW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,l=t.doc.lineAt(i),a=i==l.from?i-1:wt(l.text,i-l.from,!1)+l.from,o=i==l.to?i+1:wt(l.text,i-l.from,!0)+l.from;return{changes:{from:a,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(a,i))},range:X.cursor(o)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)},"transposeChars");function ah(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),l=t.doc.lineAt(r.to);if(!r.empty&&r.to==l.from&&(l=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=l.to,a.ranges.push(r)}else e.push({from:i.from,to:l.to,ranges:[r]});n=l.number+1}return e}u(ah,"selectedLineBlocks");function oA(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let l of ah(t)){if(n?l.to==t.doc.length:l.from==0)continue;let a=t.doc.lineAt(n?l.to+1:l.from-1),o=a.length+1;if(n){r.push({from:l.to,to:a.to},{from:l.from,insert:a.text+t.lineBreak});for(let s of l.ranges)i.push(X.range(Math.min(t.doc.length,s.anchor+o),Math.min(t.doc.length,s.head+o)))}else{r.push({from:a.from,to:l.from},{from:l.to,insert:t.lineBreak+a.text});for(let s of l.ranges)i.push(X.range(s.anchor-o,s.head-o))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:X.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}u(oA,"moveLine");const tW=u(({state:t,dispatch:e})=>oA(t,e,!1),"moveLineUp"),nW=u(({state:t,dispatch:e})=>oA(t,e,!0),"moveLineDown");function sA(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of ah(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}u(sA,"copyLine");const rW=u(({state:t,dispatch:e})=>sA(t,e,!1),"copyLineUp"),iW=u(({state:t,dispatch:e})=>sA(t,e,!0),"copyLineDown"),lW=u(t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ah(e).map(({from:i,to:l})=>(i>0?i--:l{let l;if(t.lineWrapping){let a=t.lineBlockAt(i.head),o=t.coordsAtPos(i.head,i.assoc||1);o&&(l=a.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,l)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},"deleteLine");function aW(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ze(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),l;return r&&i&&r.to<=e&&i.from>=e&&(l=r.type.prop(ue.closedBy))&&l.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}u(aW,"isBetweenBrackets");const uA=cA(!1),oW=cA(!0);function cA(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:l,to:a}=i,o=e.doc.lineAt(l),s=!t&&l==a&&aW(e,l);t&&(l=a=(a<=o.to?o:e.doc.lineAt(a)).to);let c=new Ya(e,{simulateBreak:l,simulateDoubleBreak:!!s}),d=fb(c,l);for(d==null&&(d=Na(/^\s*/.exec(e.doc.lineAt(l).text)[0],e.tabSize));ao.from&&l{let i=[];for(let a=r.from;a<=r.to;){let o=t.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(e(o,i,r),n=o.number),a=o.to+1}let l=t.changes(i);return{changes:i,range:X.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}u(Eb,"changeBySelectedLine");const sW=u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Ya(t,{overrideIndentation:l=>{let a=n[l];return a??-1}}),i=Eb(t,(l,a,o)=>{let s=fb(r,l.from);if(s==null)return;/\S/.test(l.text)||(s=0);let c=/^\s*/.exec(l.text)[0],d=uu(t,s);(c!=d||o.fromt.readOnly?!1:(e(t.update(Eb(t,(n,r)=>{r.push({from:n.from,insert:t.facet(su)})}),{userEvent:"input.indent"})),!0),"indentMore"),fA=u(({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Eb(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let l=Na(i,t.tabSize),a=0,o=uu(t,Math.max(0,l-Yf(t)));for(;a(t.setTabFocusMode(),!0),"toggleTabFocusMode"),cW=[{key:"Ctrl-b",run:M7,shift:X7,preventDefault:!0},{key:"Ctrl-f",run:B7,shift:j7},{key:"Ctrl-p",run:N7,shift:Y7},{key:"Ctrl-n",run:F7,shift:K7},{key:"Ctrl-a",run:Eq,shift:zq},{key:"Ctrl-e",run:Tq,shift:Zq},{key:"Ctrl-d",run:iA},{key:"Ctrl-h",run:Pb},{key:"Ctrl-k",run:Gq},{key:"Ctrl-Alt-h",run:aA},{key:"Ctrl-o",run:Jq},{key:"Ctrl-t",run:eW},{key:"Ctrl-v",run:Db}],dW=[{key:"ArrowLeft",run:M7,shift:X7,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:vq,shift:Mq,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Dq,shift:Iq,preventDefault:!0},{key:"ArrowRight",run:B7,shift:j7,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:$q,shift:Bq,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Pq,shift:Lq,preventDefault:!0},{key:"ArrowUp",run:N7,shift:Y7,preventDefault:!0},{mac:"Cmd-ArrowUp",run:H7,shift:eA},{mac:"Ctrl-ArrowUp",run:z7,shift:G7},{key:"ArrowDown",run:F7,shift:K7,preventDefault:!0},{mac:"Cmd-ArrowDown",run:J7,shift:tA},{mac:"Ctrl-ArrowDown",run:Db,shift:_7},{key:"PageUp",run:z7,shift:G7},{key:"PageDown",run:Db,shift:_7},{key:"Home",run:kq,shift:Fq,preventDefault:!0},{key:"Mod-Home",run:H7,shift:eA},{key:"End",run:Cq,shift:Nq,preventDefault:!0},{key:"Mod-End",run:J7,shift:tA},{key:"Enter",run:uA,shift:uA},{key:"Mod-a",run:Xq},{key:"Backspace",run:Pb,shift:Pb,preventDefault:!0},{key:"Delete",run:iA,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:aA,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Uq,preventDefault:!0},{mac:"Mod-Backspace",run:_q,preventDefault:!0},{mac:"Mod-Delete",run:Hq,preventDefault:!0}].concat(cW.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),fW=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:xq,shift:Rq},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Sq,shift:Vq},{key:"Alt-ArrowUp",run:tW},{key:"Shift-Alt-ArrowUp",run:rW},{key:"Alt-ArrowDown",run:nW},{key:"Shift-Alt-ArrowDown",run:iW},{key:"Mod-Alt-ArrowUp",run:Wq},{key:"Mod-Alt-ArrowDown",run:Yq},{key:"Escape",run:Kq},{key:"Mod-Enter",run:oW},{key:"Alt-l",mac:"Ctrl-l",run:jq},{key:"Mod-i",run:qq,preventDefault:!0},{key:"Mod-[",run:fA},{key:"Mod-]",run:dA},{key:"Mod-Alt-\\",run:sW},{key:"Shift-Mod-k",run:lW},{key:"Shift-Mod-\\",run:Qq},{key:"Mod-/",run:tq},{key:"Alt-A",run:rq},{key:"Ctrl-m",mac:"Shift-Alt-m",run:uW}].concat(dW),hW={key:"Tab",run:dA,shift:fA},Z4=class Z4{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ze(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),l=i.search(mA(e,!1));return l<0?null:{from:r+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}};u(Z4,"CompletionContext");let oh=Z4;function hA(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}u(hA,"toSet");function pW(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:pW(e);return i=>{let l=i.matchBefore(r);return l||i.explicit?{from:l?l.from:i.pos,options:e,validFor:n}:null}}u(pA,"completeFromList");function mW(t,e){return n=>{for(let r=ze(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}u(mW,"ifNotIn");const X4=class X4{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}};u(X4,"Option");let sh=X4;function xl(t){return t.selection.main.from}u(xl,"cur");function mA(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",l=r[r.length-1]!="$";return!i&&!l?t:new RegExp(`${i?"^":""}(?:${r})${l?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}u(mA,"ensureAnchor");const Tb=Tn.define();function gW(t,e,n,r){let{main:i}=t.selection,l=n-i.from,a=r-i.from;return{...t.changeByRange(o=>{if(o!=i&&n!=r&&t.sliceDoc(o.from+l,o.from+a)!=t.sliceDoc(n,r))return{range:o};let s=t.toText(e);return{changes:{from:o.from+l,to:r==i.from?o.to:o.from+a,insert:s},range:X.cursor(o.from+l+s.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}u(gW,"insertCompletionText");const gA=new WeakMap;function OW(t){if(!Array.isArray(t))return t;let e=gA.get(t);return e||gA.set(t,e=pA(t)),e}u(OW,"asSource");const uh=Oe.define(),mu=Oe.define(),j4=class j4{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(x=C0(S))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!y||C==1&&O||v==0&&C!=0)&&(n[f]==S||r[f]==S&&(h=!0)?a[f++]=y:a.length&&(b=!1)),v=C,y+=Gn(S)}return f==s&&a[0]==0&&b?this.result(-100+(h?-200:0),a,e):p==s&&m==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):p==s?this.ret(-900-e.length,[m,g]):f==s?this.result(-100+(h?-200:0)+-700+(b?0:-1100),a,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],l=0;for(let a of n){let o=a+(this.astral?Gn(Ft(r,a)):1);l&&i[l-1]==a?i[l-1]=o:(i[l++]=a,i[l++]=o)}return this.ret(e-r.length,i)}};u(j4,"FuzzyMatcher");let Ab=j4;const q4=class q4{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:bW,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>OA(e(r),n(r)),optionClass:(e,n)=>r=>OA(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function OA(t,e){return t?e?t+" "+e:t:e}u(OA,"joinClass");function bW(t,e,n,r,i,l){let a=t.textDirection==Ve.RTL,o=a,s=!1,c="top",d,f,h=e.left-i.left,p=i.right-e.right,m=r.right-r.left,g=r.bottom-r.top;if(o&&h=g||y>e.top?d=n.bottom-e.top:(c="bottom",d=e.bottom-n.top)}let O=(e.bottom-e.top)/l.offsetHeight,b=(e.right-e.left)/l.offsetWidth;return{style:`${c}: ${d/O}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(s?a?"left-narrow":"right-narrow":o?"left":"right")}}u(bW,"defaultPositionInfo");function yW(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,l){let a=document.createElement("span");a.className="cm-completionLabel";let o=n.displayLabel||n.label,s=0;for(let c=0;cs&&a.appendChild(document.createTextNode(o.slice(s,d)));let h=a.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(o.slice(d,f))),h.className="cm-completionMatchedText",s=f}return sn.position-r.position).map(n=>n.render)}u(yW,"optionContent");function Mb(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}u(Mb,"rangeAroundSelected");const W4=class W4{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:s=>this.placeInfo(s),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:l,selected:a}=i.open,o=e.state.facet(He);this.optionContent=yW(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Mb(l.length,a,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",s=>{let{options:c}=e.state.field(n).open;for(let d=s.target,f;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(f=/-(\d+)$/.exec(d.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(He).closeOnBlur&&s.relatedTarget!=e.contentDOM&&e.dispatch({effects:mu.of(null)})}),this.showOptions(l,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:l,selected:a,disabled:o}=r.open;(!i.open||i.open.options!=l)&&(this.range=Mb(l.length,a,e.state.facet(He).maxRenderedOptions),this.showOptions(l,r.id)),this.updateSel(),o!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=Mb(n.options.length,n.selected,this.view.state.facet(He).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let l=typeof i=="string"?document.createTextNode(i):i(r);if(!l)return;"then"in l?l.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>Ht(this.view.state,a,"completion info")):this.addInfoPane(l,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:l}=e;r.appendChild(i),this.infoDestroy=l||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&$W(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),l=this.space;if(!l){let a=this.dom.ownerDocument.documentElement;l={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return i.top>Math.min(l.bottom,n.bottom)-10||i.bottom{a.target==i&&a.preventDefault()});let l=null;for(let a=r.from;ar.from||r.from==0))if(l=h,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let p=i.appendChild(document.createElement("completion-section"));p.textContent=h}}const d=i.appendChild(document.createElement("li"));d.id=n+"-"+a,d.setAttribute("role","option");let f=this.optionClass(o);f&&(d.className=f);for(let h of this.optionContent){let p=h(o,this.view.state,this.view,s);p&&d.appendChild(p)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew Bb(n,t,e)}u(vW,"completionTooltip");function $W(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}u($W,"scrollIntoView");function bA(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}u(bA,"score");function wW(t,e){let n=[],r=null,i=null,l=u(d=>{n.push(d);let{section:f}=d.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(p=>p.name==h)||r.push(typeof f=="string"?{name:h}:f)}},"addOption"),a=e.facet(He);for(let d of t)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)l(new sh(h,d.source,f?f(h):[],1e9-n.length));else{let h=e.sliceDoc(d.from,d.to),p,m=a.filterStrict?new Qb(h):new Ab(h);for(let g of d.result.options)if(p=m.match(g.label)){let O=g.displayLabel?f?f(g,p.matched):[]:p.matched,b=p.score+(g.boost||0);if(l(new sh(g,d.source,O,b)),typeof g.section=="object"&&g.section.rank==="dynamic"){let{name:y}=g.section;i||(i=Object.create(null)),i[y]=Math.max(b,i[y]||-1e9)}}}}if(r){let d=Object.create(null),f=0,h=u((p,m)=>(p.rank==="dynamic"&&m.rank==="dynamic"?i[m.name]-i[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(p.nameh.score-f.score||c(f.completion,h.completion))){let f=d.completion;!s||s.label!=f.label||s.detail!=f.detail||s.type!=null&&f.type!=null&&s.type!=f.type||s.apply!=f.apply||s.boost!=f.boost?o.push(d):bA(d.completion)>bA(s)&&(o[o.length-1]=d),s=d.completion}return o}u(wW,"sortOptions");const Gl=class Gl{constructor(e,n,r,i,l,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=l,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Gl(this.options,yA(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,l,a){if(i&&!a&&e.some(c=>c.isPending))return i.setDisabled();let o=wW(e,n);if(!o.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let s=n.facet(He).selectOnOpen?0:-1;if(i&&i.selected!=s&&i.selected!=-1){let c=i.options[i.selected].completion;for(let d=0;dd.hasResult()?Math.min(c,d.from):c,1e8),create:PW,above:l.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new Gl(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Gl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}};u(Gl,"CompletionDialog");let Rb=Gl;const vc=class vc{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new vc(kW,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(He),l=(r.override||n.languageDataAt("autocomplete",xl(n)).map(OW)).map(s=>(this.active.find(d=>d.source==s)||new Lr(s,this.active.some(d=>d.state!=0)?1:0)).update(e,r));l.length==this.active.length&&l.every((s,c)=>s==this.active[c])&&(l=this.active);let a=this.open,o=e.effects.some(s=>s.is(Nb));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||l.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!xW(l,this.active)||o?a=Rb.build(l,n,this.id,a,r,o):a&&a.disabled&&!l.some(s=>s.isPending)&&(a=null),!a&&l.every(s=>!s.isPending)&&l.some(s=>s.hasResult())&&(l=l.map(s=>s.hasResult()?new Lr(s.source,0):s));for(let s of e.effects)s.is($A)&&(a=a&&a.setSelected(s.value,this.id));return l==this.active&&a==this.open?this:new vc(l,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?SW:CW}};u(vc,"CompletionState");let Vb=vc;function xW(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}u(yA,"makeAttrs");const kW=[];function vA(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Tb);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}u(vA,"getUpdateType");const _l=class _l{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=vA(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new _l(i.source,0)),r&4&&i.state==0&&(i=new _l(this.source,1)),i=i.updateFor(e,r);for(let l of e.effects)if(l.is(uh))i=new _l(i.source,1,l.value);else if(l.is(mu))i=new _l(i.source,0);else if(l.is(Nb))for(let a of l.value)a.source==i.source&&(i=a);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(xl(e.state))}};u(_l,"ActiveSource");let Lr=_l;const To=class To extends Lr{constructor(e,n,r,i,l,a){super(e,3,n),this.limit=r,this.result=i,this.from=l,this.to=a}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let l=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),o=xl(e.state);if(o>a||!i||n&2&&(xl(e.startState)==this.from||on.map(e))}}),$A=Oe.define(),zt=Gt.define({create(){return Vb.start()},update(t,e){return t.update(e)},provide:t=>[AT.from(t,e=>e.tooltip),J.contentAttributes.from(t,e=>e.attrs)]});function Fb(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(zt).active.find(i=>i.source==e.source);return r instanceof ch?(typeof n=="string"?t.dispatch({...gW(t.state,n,r.from,r.to),annotations:Tb.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}u(Fb,"applyCompletion");const PW=vW(zt,Fb);function dh(t,e="option"){return n=>{let r=n.state.field(zt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:a-1;return o<0?o=e=="page"?0:a-1:o>=a&&(o=e=="page"?a-1:0),n.dispatch({effects:$A.of(o)}),!0}}u(dh,"moveCompletionSelection");const EW=u(t=>{let e=t.state.field(zt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(zt,!1)?(t.dispatch({effects:uh.of(!0)}),!0):!1,"startCompletion"),TW=u(t=>{let e=t.state.field(zt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:mu.of(null)}),!0)},"closeCompletion"),Y4=class Y4{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}};u(Y4,"RunningQuery");let Lb=Y4;const AW=50,QW=1e3,MW=it.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(zt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(zt),n=t.state.facet(He);if(!t.selectionSet&&!t.docChanged&&t.startState.field(zt)==e)return;let r=t.transactions.some(l=>{let a=vA(l,n);return a&8||(l.selection||l.docChanged)&&!(a&3)});for(let l=0;lAW&&Date.now()-a.time>QW){for(let o of a.context.abortListeners)try{o()}catch(s){Ht(this.view.state,s)}a.context.abortListeners=null,this.running.splice(l--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(l=>l.effects.some(a=>a.is(uh)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(l=>l.isPending&&!this.running.some(a=>a.active.source==l.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let l of t.transactions)l.isUserEvent("input.type")?this.composing=2:this.composing==2&&l.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(zt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=xl(e),r=new oh(e,n,t.explicit,this.view),i=new Lb(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(l=>{i.context.aborted||(i.done=l||null,this.scheduleAccept())},l=>{this.view.dispatch({effects:mu.of(null)}),Ht(this.view.state,l)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(He).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(He),r=this.view.state.field(zt);for(let i=0;io.source==l.active.source);if(a&&a.isPending)if(l.done==null){let o=new Lr(l.active.source,0);for(let s of l.updates)o=o.update(s,n);o.isPending||e.push(o)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Nb.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(zt,!1);if(e&&e.tooltip&&this.view.state.facet(He).closeOnBlur){let n=e.open&&QT(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:mu.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:uh.of(!1)}),20),this.composing=0}}}),BW=typeof navigator=="object"&&/Win/.test(navigator.platform),RW=dl.highest(J.domEventHandlers({keydown(t,e){let n=e.state.field(zt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(BW&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),l=r.completion.commitCharacters||i.result.commitCharacters;return l&&l.indexOf(t.key)>-1&&Fb(e,r),!1}})),wA=J.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),K4=class K4{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}};u(K4,"FieldPos");let zb=K4;const jp=class jp{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,ct.TrackDel),r=e.mapPos(this.to,1,ct.TrackDel);return n==null||r==null?null:new jp(this.field,n,r)}};u(jp,"FieldRange");let Zb=jp;const qp=class qp{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],l=e.doc.lineAt(n),a=/^\s*/.exec(l.text)[0];for(let s of this.lines){if(r.length){let c=a,d=/^\t*/.exec(s)[0].length;for(let f=0;fnew Zb(s.field,i[s.line]+s.from,i[s.line]+s.to));return{text:r,ranges:o}}static parse(e){let n=[],r=[],i=[],l;for(let a of e.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=l[1]?+l[1]:null,s=l[2]||l[3]||"",c=-1,d=s.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&h.field++}for(let f of i)if(f.line==r.length&&f.from>l.index){let h=l[2]?3+(l[1]||"").length:2;f.from-=h,f.to-=h}i.push(new zb(c,r.length,l.index,l.index+d.length)),a=a.slice(0,l.index)+s+a.slice(l.index+l[0].length)}a=a.replace(/\\([{}])/g,(o,s,c)=>{for(let d of i)d.line==r.length&&d.from>c&&(d.from--,d.to--);return s}),r.push(a)}return new qp(r,i)}};u(qp,"Snippet");let Xb=qp,VW=re.widget({widget:new class extends er{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),NW=re.mark({class:"cm-snippetField"});const Wp=class Wp{constructor(e,n){this.ranges=e,this.active=n,this.deco=re.set(e.map(r=>(r.from==r.to?VW:NW).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Wp(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}};u(Wp,"ActiveSnippet");let Ua=Wp;const gu=Oe.define({map(t,e){return t&&t.map(e)}}),FW=Oe.define(),Ou=Gt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(gu))return n.value;if(n.is(FW)&&t)return new Ua(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>J.decorations.from(t,e=>e?e.deco:re.none)});function jb(t,e){return X.create(t.filter(n=>n.field==e).map(n=>X.range(n.from,n.to)))}u(jb,"fieldSelection");function IW(t){let e=Xb.parse(t);return(n,r,i,l)=>{let{text:a,ranges:o}=e.instantiate(n.state,i),{main:s}=n.state.selection,c={changes:{from:i,to:l==s.from?s.to:l,insert:pe.of(a)},scrollIntoView:!0,annotations:r?[Tb.of(r),xt.userEvent.of("input.complete")]:void 0};if(o.length&&(c.selection=jb(o,0)),o.some(d=>d.field>0)){let d=new Ua(o,0),f=c.effects=[gu.of(d)];n.state.field(Ou,!1)===void 0&&f.push(Oe.appendConfig.of([Ou,zW,ZW,wA]))}n.dispatch(n.state.update(c))}}u(IW,"snippet");function xA(t){return({state:e,dispatch:n})=>{let r=e.field(Ou,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,l=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:jb(r.ranges,i),effects:gu.of(l?null:new Ua(r.ranges,i)),scrollIntoView:!0})),!0}}u(xA,"moveField");const LW=[{key:"Tab",run:xA(1),shift:xA(-1)},{key:"Escape",run:u(({state:t,dispatch:e})=>t.field(Ou,!1)?(e(t.update({effects:gu.of(null)})),!0):!1,"clearSnippet")}],SA=_.define({combine(t){return t.length?t[0]:LW}}),zW=dl.highest(Df.compute([SA],t=>t.facet(SA)));function Zt(t,e){return{...e,apply:IW(t)}}u(Zt,"snippetCompletion");const ZW=J.domEventHandlers({mousedown(t,e){let n=e.state.field(Ou,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(l=>l.from<=r&&l.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:jb(n.ranges,i.field),effects:gu.of(n.ranges.some(l=>l.field>i.field)?new Ua(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),bu={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Sl=Oe.define({map(t,e){let n=e.mapPos(t,-1,ct.TrackAfter);return n??void 0}}),qb=new class extends Nr{};qb.startSide=1,qb.endSide=-1;const CA=Gt.define({create(){return Te.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Sl)&&(t=t.update({add:[qb.range(n.value,n.value+1)]}));return t}});function XW(){return[qW,CA]}u(XW,"closeBrackets");const Wb="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function kA(t){for(let e=0;e{if((jW?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Gn(Ft(r,0))==1||e!=i.from||n!=i.to)return!1;let l=YW(t.state,r);return l?(t.dispatch(l),!0):!1}),WW=[{key:"Backspace",run:u(({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=DA(t,t.selection.main.head).brackets||bu.brackets,i=null,l=t.changeByRange(a=>{if(a.empty){let o=KW(t.doc,a.head);for(let s of r)if(s==o&&fh(t.doc,a.head)==kA(Ft(s,0)))return{changes:{from:a.head-s.length,to:a.head+s.length},range:X.cursor(a.head-s.length)}}return{range:i=a}});return i||e(t.update(l,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},"deleteBracketPair")}];function YW(t,e){let n=DA(t,t.selection.main.head),r=n.brackets||bu.brackets;for(let i of r){let l=kA(Ft(i,0));if(e==i)return l==i?_W(t,i,r.indexOf(i+i+i)>-1,n):UW(t,i,l,n.before||bu.before);if(e==l&&PA(t,t.selection.main.from))return GW(t,i,l)}return null}u(YW,"insertBracket");function PA(t,e){let n=!1;return t.field(CA).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}u(PA,"closedBracketAt");function fh(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Gn(Ft(n,0)))}u(fh,"nextChar");function KW(t,e){let n=t.sliceString(e-2,e);return Gn(Ft(n,0))==n.length?n:n.slice(1)}u(KW,"prevChar");function UW(t,e,n,r){let i=null,l=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:Sl.of(a.to+e.length),range:X.range(a.anchor+e.length,a.head+e.length)};let o=fh(t.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:e+n,from:a.head},effects:Sl.of(a.head+e.length),range:X.cursor(a.head+e.length)}:{range:i=a}});return i?null:t.update(l,{scrollIntoView:!0,userEvent:"input.type"})}u(UW,"handleOpen");function GW(t,e,n){let r=null,i=t.changeByRange(l=>l.empty&&fh(t.doc,l.head)==n?{changes:{from:l.head,to:l.head+n.length,insert:n},range:X.cursor(l.head+n.length)}:r={range:l});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}u(GW,"handleClose");function _W(t,e,n,r){let i=r.stringPrefixes||bu.stringPrefixes,l=null,a=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Sl.of(o.to+e.length),range:X.range(o.anchor+e.length,o.head+e.length)};let s=o.head,c=fh(t.doc,s),d;if(c==e){if(EA(t,s))return{changes:{insert:e+e,from:s},effects:Sl.of(s+e.length),range:X.cursor(s+e.length)};if(PA(t,s)){let h=n&&t.sliceDoc(s,s+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+h.length,insert:h},range:X.cursor(s+h.length)}}}else{if(n&&t.sliceDoc(s-2*e.length,s)==e+e&&(d=TA(t,s-2*e.length,i))>-1&&EA(t,d))return{changes:{insert:e+e+e+e,from:s},effects:Sl.of(s+e.length),range:X.cursor(s+e.length)};if(t.charCategorizer(s)(c)!=ft.Word&&TA(t,s,i)>-1&&!HW(t,s,e,i))return{changes:{insert:e+e,from:s},effects:Sl.of(s+e.length),range:X.cursor(s+e.length)}}return{range:l=o}});return l?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}u(_W,"handleSame");function EA(t,e){let n=ze(t).resolveInner(e+1);return n.parent&&n.from==e}u(EA,"nodeStart");function HW(t,e,n,r){let i=ze(t).resolveInner(e,-1),l=r.reduce((a,o)=>Math.max(a,o.length),0);for(let a=0;a<5;a++){let o=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+l)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+s;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}u(HW,"probablyInString");function TA(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=ft.Word)return e;for(let i of n){let l=e-i.length;if(t.sliceDoc(l,e)==i&&r(t.sliceDoc(l-1,l))!=ft.Word)return l}return-1}u(TA,"canStartStringAt");function JW(t={}){return[RW,zt,He.of(t),MW,eY,wA]}u(JW,"autocompletion");const AA=[{key:"Ctrl-Space",run:Ib},{mac:"Alt-`",run:Ib},{mac:"Alt-i",run:Ib},{key:"Escape",run:TW},{key:"ArrowDown",run:dh(!0)},{key:"ArrowUp",run:dh(!1)},{key:"PageDown",run:dh(!0,"page")},{key:"PageUp",run:dh(!1,"page")},{key:"Enter",run:EW}],eY=dl.highest(Df.computeN([He],t=>t.facet(He).defaultKeymap?[AA]:[])),QA=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t,U4=class U4{constructor(e,n,r=0,i=e.length,l,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=l?o=>l(QA(o)):QA,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ft(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=C0(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Gn(e);let i=this.normalize(n);if(i.length)for(let l=0,a=r;;l++){let o=i.charCodeAt(l),s=this.match(o,a,this.bufferPos+this.bufferStart);if(l==i.length-1){if(s)return this.value=s,this;break}a==r&&le||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function nY(t){let e=[oY,aY];return t&&e.push(MA.of(t)),e}u(nY,"highlightSelectionMatches");const rY=re.mark({class:"cm-selectionMatch"}),iY=re.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function BA(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=ft.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=ft.Word)}u(BA,"insideWordBoundaries");function lY(t,e,n,r){return t(e.sliceDoc(n,n+1))==ft.Word&&t(e.sliceDoc(r-1,r))==ft.Word}u(lY,"insideWord");const aY=it.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(MA),{state:n}=t,r=n.selection;if(r.ranges.length>1)return re.none;let i=r.main,l,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return re.none;let s=n.wordAt(i.head);if(!s)return re.none;a=n.charCategorizer(i.head),l=n.sliceDoc(s.from,s.to)}else{let s=i.to-i.from;if(s200)return re.none;if(e.wholeWords){if(l=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(BA(a,n,i.from,i.to)&&lY(a,n,i.from,i.to)))return re.none}else if(l=n.sliceDoc(i.from,i.to),!l)return re.none}let o=[];for(let s of t.visibleRanges){let c=new hh(n.doc,l,s.from,s.to);for(;!c.next().done;){let{from:d,to:f}=c.value;if((!a||BA(a,n,d,f))&&(i.empty&&d<=i.from&&f>=i.to?o.push(iY.range(d,f)):(d>=i.to||f<=i.from)&&o.push(rY.range(d,f)),o.length>e.maxMatches))return re.none}}return re.set(o)}},{decorations:t=>t.decorations}),oY=J.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),$c=class $c{constructor(e,n,r,i,l,a,o,s,c,d=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=l,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=d,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new $c(e,[],n,r,r,0,[],0,i?new ph(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:l}=this.p,a=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,l=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(n==r)return;if(a.buffer[o-2]>=n){a.buffer[o-2]=r;return}}}if(!l||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0){let o=!1;for(let s=a;s>0&&this.buffer[s-2]>r;s-=4)if(this.buffer[s-1]>=0){o=!0;break}if(o)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let l=e,{parser:a}=this.p;(i>this.pos||n<=a.maxNode)&&(this.pos=i,a.stateFlag(l,1)||(this.reducePos=i)),this.pushState(l,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new $c(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Kb(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let l=0,a;ls&1&&o==a)||i.push(n[l],a)}n=i}let r=[];for(let i=0;i>19,i=n&65535,l=this.stack.length-r*3;if(l<0||e.getGoto(this.stack[l],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=u((i,l)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let o=(a>>19)-l;if(o>1){let s=a&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],s,!1)>=0)return o<<19|65536|s}}else{let o=r(a,l+1);if(o!=null)return o}})},"explore");return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};u($c,"Stack");let Yb=$c;const G4=class G4{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}};u(G4,"StackContext");let ph=G4;const _4=class _4{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}};u(_4,"SimulatedStack");let Kb=_4;const wc=class wc{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new wc(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new wc(this.stack,this.pos,this.index)}};u(wc,"StackBufferCursor");let Ub=wc;function yu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&a--,a>=34&&a--;let s=a-32;if(s>=46&&(s-=46,o=!0),l+=s,o)break;l*=46}n?n[i++]=l:n=new e(l)}return n}u(yu,"decodeArray");const H4=class H4{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};u(H4,"CachedToken");let Ga=H4;const RA=new Ga,J4=class J4{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=RA,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,l=this.pos+e;for(;lr.to:l>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];l+=a.from-r.to,r=a}return l}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ro.to&&(this.chunk2=this.chunk2.slice(0,o.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=RA,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}};u(J4,"InputStream");let Gb=J4;const e$=class e${constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;VA(this.data,e,n,this.id,r.data,r.tokenPrecTable)}};u(e$,"TokenGroup");let Ti=e$;Ti.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const t$=class t${constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?yu(e):e}token(e,n){let r=e.pos,i=0;for(;;){let l=e.next<0,a=e.resolveOffset(1,1);if(VA(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(l||i++,a==null)break;e.reset(a,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}};u(t$,"LocalTokenGroup");let _a=t$;_a.prototype.contextual=Ti.prototype.fallback=Ti.prototype.extend=!1;const n$=class n${constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};u(n$,"ExternalTokenizer");let Dt=n$;function VA(t,e,n,r,i,l){let a=0,o=1<0){let m=t[p];if(s.allows(m)&&(e.token.value==-1||e.token.value==m||sY(m,e.token.value,i,l))){e.acceptToken(m);break}}let d=e.next,f=0,h=t[a+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){a=t[c+h*3-1];continue e}for(;f>1,m=c+p+(p<<1),g=t[m],O=t[m+1]||65536;if(d=O)f=p+1;else{a=t[m+2],e.advance();continue e}}break}}u(VA,"readToken");function NA(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}u(NA,"findOffset");function sY(t,e,n,r){let i=NA(n,r,e);return i<0||NA(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}u(FA,"cutAt");const r$=class r${constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?FA(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?FA(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(l instanceof Le){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(l),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+l.length}}};u(r$,"FragmentCursor");let Hb=r$;const i$=class i${constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Ga)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:l}=i,a=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let c=0;cf.end+25&&(s=Math.max(f.lookAhead,s)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!d.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return s&&e.setLookAhead(s),!r&&e.pos==this.stream.end&&(r=new Ga,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Ga,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:l}=r.p;for(let a=0;a=0&&r.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let l=0;le.bufferLength*4?new Hb(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,l;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;an)r.push(o);else{if(this.advanceStack(o,r,e))continue;{i||(i=[],l=[]),i.push(o);let s=this.tokens.getMainToken(o);l.push(s.value,s.end)}}break}}if(!r.length){let a=i&&uY(i);if(a)return nn&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw nn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,l,r);if(a)return nn&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((o,s)=>s.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)r.splice(s--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,d=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?l.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(ue.contextHash)||0)==d))return e.useNode(f,h),nn&&console.log(a+this.stackID(e)+` (via reuse of ${l.getName(f.type.id)})`),!0;if(!(f instanceof Le)||f.children.length==0||f.positions[0]>0)break;let p=f.children[0];if(p instanceof Le&&f.positions[0]==0)f=p;else break}}let o=l.stateSlot(e.state,4);if(o>0)return e.reduce(o),nn&&console.log(a+this.stackID(e)+` (via always-reduce ${l.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let c=0;ci?n.push(m):r.push(m)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return IA(e,n),!0}}runRecovery(e,n,r){let i=null,l=!1;for(let a=0;a ":"";if(o.deadEnd&&(l||(l=!0,o.restart(),nn&&console.log(d+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let f=o.split(),h=d;for(let p=0;f.forceReduce()&&p<10&&(nn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));p++)nn&&(h=this.stackID(f)+" -> ");for(let p of o.recoverByInsert(s))nn&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,r);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),nn&&console.log(d+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),IA(o,r)):(!i||i.scoret,"id"),o$=class o${constructor(e){this.start=e.start,this.shift=e.shift||ny,this.reduce=e.reduce||ny,this.reuse=e.reuse||ny,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}};u(o$,"ContextTracker");let mh=o$;const xc=class xc extends If{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)l(d,s,o[c++]);else{let f=o[c+-d];for(let h=-d;h>0;h--)l(o[c++],s,f);c++}}}this.nodeSet=new KO(n.map((o,s)=>en.define({name:s>=this.minRepeatTerm?void 0:o,id:s,props:i[s],top:r.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=XT;let a=yu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Ti(a,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new ey(this,e,n,r);for(let l of this.wrappers)i=l(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let l=i[n+1];;){let a=i[l++],o=a&1,s=i[l++];if(o&&r)return s;for(let c=l+(a>>1);l0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let l=this.stateSlot(e,1);i==null;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=zr(this.data,l+2);else break;i=n(zr(this.data,l+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=zr(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((l,a)=>a&1&&l==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(xc.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(l=>l.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let l=e.specializers.find(o=>o.from==r.external);if(!l)return r;let a=Object.assign(Object.assign({},r),{external:l.to});return n.specializers[i]=LA(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let l of e.split(" ")){let a=n.indexOf(l);a>=0&&(r[a]=!0)}let i=null;for(let l=0;lr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}u(LA,"getSpecializer");const cY=55,dY=1,fY=56,hY=2,pY=57,mY=3,zA=4,gY=5,ry=6,ZA=7,XA=8,jA=9,qA=10,OY=11,bY=12,yY=13,iy=58,vY=14,$Y=15,WA=59,YA=21,wY=23,KA=24,xY=25,ly=27,UA=28,SY=29,CY=32,kY=35,DY=37,PY=38,EY=0,TY=1,AY={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},QY={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},GA={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function MY(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}u(MY,"nameChar");let _A=null,HA=null,JA=0;function ay(t,e){let n=t.pos+e;if(JA==n&&HA==t)return _A;let r=t.peek(e),i="";for(;MY(r);)i+=String.fromCharCode(r),r=t.peek(++e);return HA=t,JA=n,_A=i?i.toLowerCase():r==BY||r==RY?void 0:null}u(ay,"tagNameAfter");const eQ=60,gh=62,oy=47,BY=63,RY=33,VY=45;function tQ(t,e){this.name=t,this.parent=e}u(tQ,"ElementContext");const NY=[ry,qA,ZA,XA,jA],FY=new mh({start:null,shift(t,e,n,r){return NY.indexOf(e)>-1?new tQ(ay(r,1)||"",t):t},reduce(t,e){return e==YA&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==ry||i==DY?new tQ(ay(r,1)||"",t):t},strict:!1}),IY=new Dt((t,e)=>{if(t.next!=eQ){t.next<0&&e.context&&t.acceptToken(iy);return}t.advance();let n=t.next==oy;n&&t.advance();let r=ay(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?$Y:vY);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(OY);if(i&&QY[i])return t.acceptToken(iy,-2);if(e.dialectEnabled(EY))return t.acceptToken(bY);for(let l=e.context;l;l=l.parent)if(l.name==r)return;t.acceptToken(yY)}else{if(r=="script")return t.acceptToken(ZA);if(r=="style")return t.acceptToken(XA);if(r=="textarea")return t.acceptToken(jA);if(AY.hasOwnProperty(r))return t.acceptToken(qA);i&&GA[i]&&GA[i][r]?t.acceptToken(iy,-1):t.acceptToken(ry)}},{contextual:!0}),LY=new Dt(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(WA);break}if(t.next==VY)e++;else if(t.next==gh&&e>=2){n>=3&&t.acceptToken(WA,-2);break}else e=0;t.advance()}});function zY(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}u(zY,"inForeignElement");const ZY=new Dt((t,e)=>{if(t.next==oy&&t.peek(1)==gh){let n=e.dialectEnabled(TY)||zY(e.context);t.acceptToken(n?gY:zA,2)}else t.next==gh&&t.acceptToken(zA,1)});function sy(t,e,n){let r=2+t.length;return new Dt(i=>{for(let l=0,a=0,o=0;;o++){if(i.next<0){o&&i.acceptToken(e);break}if(l==0&&i.next==eQ||l==1&&i.next==oy||l>=2&&la?i.acceptToken(e,-a):i.acceptToken(n,-(a-2));break}else if((i.next==10||i.next==13)&&o){i.acceptToken(e,1);break}else l=a=0;i.advance()}})}u(sy,"contentTokenizer");const XY=sy("script",cY,dY),jY=sy("style",fY,hY),qY=sy("textarea",pY,mY),WY=Xf({"Text RawText IncompleteTag IncompleteCloseTag":V.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":V.angleBracket,TagName:V.tagName,"MismatchedCloseTag/TagName":[V.tagName,V.invalid],AttributeName:V.attributeName,"AttributeValue UnquotedAttributeValue":V.attributeValue,Is:V.definitionOperator,"EntityReference CharacterReference":V.character,Comment:V.blockComment,ProcessingInst:V.processingInstruction,DoctypeDecl:V.documentMeta}),YY=vu.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:FY,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[WY],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=o.type.id;if(c==SY)return uy(o,s,n);if(c==CY)return uy(o,s,r);if(c==kY)return uy(o,s,i);if(c==YA&&l.length){let d=o.node,f=d.firstChild,h=f&&rQ(f,s),p;if(h){for(let m of l)if(m.tag==h&&(!m.attrs||m.attrs(p||(p=nQ(f,s))))){let g=d.lastChild,O=g.type.id==PY?g.from:d.to;if(O>f.to)return{parser:m.parser,overlay:[{from:f.to,to:O}]}}}}if(a&&c==KA){let d=o.node,f;if(f=d.firstChild){let h=a[s.read(f.from,f.to)];if(h)for(let p of h){if(p.tagName&&p.tagName!=rQ(d.parent,s))continue;let m=d.lastChild;if(m.type.id==ly){let g=m.from+1,O=m.lastChild,b=m.to-(O&&O.isError?0:1);if(b>g)return{parser:p.parser,overlay:[{from:g,to:b}]}}else if(m.type.id==UA)return{parser:p.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}u(iQ,"configureNesting");const KY=122,lQ=1,UY=123,GY=124,aQ=2,_Y=125,HY=3,JY=4,oQ=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],eK=58,tK=40,sQ=95,nK=91,Oh=45,rK=46,iK=35,lK=37,aK=38,oK=92,sK=10,uK=42;function $u(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}u($u,"isAlpha");function cy(t){return t>=48&&t<=57}u(cy,"isDigit");function uQ(t){return cy(t)||t>=97&&t<=102||t>=65&&t<=70}u(uQ,"isHex");const cQ=u((t,e,n)=>(r,i)=>{for(let l=!1,a=0,o=0;;o++){let{next:s}=r;if($u(s)||s==Oh||s==sQ||l&&cy(s))!l&&(s!=Oh||o>0)&&(l=!0),a===o&&s==Oh&&a++,r.advance();else if(s==oK&&r.peek(1)!=sK){if(r.advance(),uQ(r.next)){do r.advance();while(uQ(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();l=!0}else{l&&r.acceptToken(a==2&&i.canShift(aQ)?e:s==tK?n:t);break}}},"identifierTokens"),cK=new Dt(cQ(UY,aQ,GY)),dK=new Dt(cQ(_Y,HY,JY)),fK=new Dt(t=>{if(oQ.includes(t.peek(-1))){let{next:e}=t;($u(e)||e==sQ||e==iK||e==rK||e==uK||e==nK||e==eK&&$u(t.peek(1))||e==Oh||e==aK)&&t.acceptToken(KY)}}),hK=new Dt(t=>{if(!oQ.includes(t.peek(-1))){let{next:e}=t;if(e==lK&&(t.advance(),t.acceptToken(lQ)),$u(e)){do t.advance();while($u(t.next)||cy(t.next));t.acceptToken(lQ)}}}),pK=Xf({"AtKeyword import charset namespace keyframes media supports":V.definitionKeyword,"from to selector":V.keyword,NamespaceName:V.namespace,KeyframeName:V.labelName,KeyframeRangeName:V.operatorKeyword,TagName:V.tagName,ClassName:V.className,PseudoClassName:V.constant(V.className),IdName:V.labelName,"FeatureName PropertyName":V.propertyName,AttributeName:V.attributeName,NumberLiteral:V.number,KeywordQuery:V.keyword,UnaryQueryOp:V.operatorKeyword,"CallTag ValueName":V.atom,VariableName:V.variableName,Callee:V.operatorKeyword,Unit:V.unit,"UniversalSelector NestingSelector":V.definitionOperator,"MatchOp CompareOp":V.compareOperator,"ChildOp SiblingOp, LogicOp":V.logicOperator,BinOp:V.arithmeticOperator,Important:V.modifier,Comment:V.blockComment,ColorLiteral:V.color,"ParenthesizedContent StringLiteral":V.string,":":V.punctuation,"PseudoOp #":V.derefOperator,"; ,":V.separator,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace}),mK={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},gK={__proto__:null,or:98,and:98,not:106,only:106,layer:170},OK={__proto__:null,selector:112,layer:166},bK={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},yK={__proto__:null,to:207},vK=vu.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hmK[t]||-1},{term:125,get:t=>gK[t]||-1},{term:4,get:t=>OK[t]||-1},{term:25,get:t=>bK[t]||-1},{term:123,get:t=>yK[t]||-1}],tokenPrec:1963});let dy=null;function fy(){if(!dy&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));dy=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return dy||[]}u(fy,"properties");const dQ=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),fQ=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),$K=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),wK=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Zr=/^(\w[\w-]*|-\w[\w-]*|)$/,xK=/^-(-[\w-]*)?$/;function SK(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}u(SK,"isVarArg");const hQ=new Ff,CK=["Declaration"];function kK(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}u(kK,"astTop");function pQ(t,e,n){if(e.to-e.from>4096){let r=hQ.get(e);if(r)return r;let i=[],l=new Set,a=e.cursor(Ae.IncludeAnonymous);if(a.firstChild())do for(let o of pQ(t,a.node,n))l.has(o.label)||(l.add(o.label),i.push(o));while(a.nextSibling());return hQ.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(l=>{var a;if(n(l)&&l.matchContext(CK)&&((a=l.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let o=t.sliceString(l.from,l.to);i.has(o)||(i.add(o),r.push({label:o,type:"variable"}))}}),r}}u(pQ,"variableNames");const DK=u(t=>e=>{let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(l||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:fy(),validFor:Zr};if(i.name=="ValueName")return{from:i.from,options:fQ,validFor:Zr};if(i.name=="PseudoClassName")return{from:i.from,options:dQ,validFor:Zr};if(t(i)||(e.explicit||l)&&SK(i,n.doc))return{from:t(i)||l?i.from:r,options:pQ(n.doc,kK(i),t),validFor:xK};if(i.name=="TagName"){for(let{parent:s}=i;s;s=s.parent)if(s.name=="Block")return{from:i.from,options:fy(),validFor:Zr};return{from:i.from,options:$K,validFor:Zr}}if(i.name=="AtKeyword")return{from:i.from,options:wK,validFor:Zr};if(!e.explicit)return null;let a=i.resolve(r),o=a.childBefore(r);return o&&o.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:dQ,validFor:Zr}:o&&o.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:fQ,validFor:Zr}:a.name=="Block"||a.name=="Styles"?{from:r,options:fy(),validFor:Zr}:null},"defineCSSCompletionSource")(t=>t.name=="VariableName"),bh=iu.define({name:"css",parser:vK.configure({props:[Kf.add({Declaration:Uf()}),Gf.add({"Block KeyframeList":u7})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function PK(){return new ou(bh,bh.data.of({autocomplete:DK}))}u(PK,"css");const EK=316,TK=317,mQ=1,AK=2,QK=3,MK=4,BK=318,RK=320,VK=321,NK=5,FK=6,IK=0,hy=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],gQ=125,LK=59,py=47,zK=42,ZK=43,XK=45,jK=60,qK=44,WK=63,YK=46,KK=91,UK=new mh({start:!1,shift(t,e){return e==NK||e==FK||e==RK?t:e==VK},strict:!1}),GK=new Dt((t,e)=>{let{next:n}=t;(n==gQ||n==-1||e.context)&&t.acceptToken(BK)},{contextual:!0,fallback:!0}),_K=new Dt((t,e)=>{let{next:n}=t,r;hy.indexOf(n)>-1||n==py&&((r=t.peek(1))==py||r==zK)||n!=gQ&&n!=LK&&n!=-1&&!e.context&&t.acceptToken(EK)},{contextual:!0}),HK=new Dt((t,e)=>{t.next==KK&&!e.context&&t.acceptToken(TK)},{contextual:!0}),JK=new Dt((t,e)=>{let{next:n}=t;if(n==ZK||n==XK){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(mQ);t.acceptToken(r?mQ:AK)}}else n==WK&&t.peek(1)==YK&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(QK))},{contextual:!0});function my(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}u(my,"identifierChar");const eU=new Dt((t,e)=>{if(t.next!=jK||!e.dialectEnabled(IK)||(t.advance(),t.next==py))return;let n=0;for(;hy.indexOf(t.next)>-1;)t.advance(),n++;if(my(t.next,!0)){for(t.advance(),n++;my(t.next,!1);)t.advance(),n++;for(;hy.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==qK)return;for(let r=0;;r++){if(r==7){if(!my(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(MK,-n)}),tU=Xf({"get set async static":V.modifier,"for while do if else switch try catch finally return throw break continue default case defer":V.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":V.operatorKeyword,"let var const using function class extends":V.definitionKeyword,"import export from":V.moduleKeyword,"with debugger new":V.keyword,TemplateString:V.special(V.string),super:V.atom,BooleanLiteral:V.bool,this:V.self,null:V.null,Star:V.modifier,VariableName:V.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":V.function(V.variableName),VariableDefinition:V.definition(V.variableName),Label:V.labelName,PropertyName:V.propertyName,PrivatePropertyName:V.special(V.propertyName),"CallExpression/MemberExpression/PropertyName":V.function(V.propertyName),"FunctionDeclaration/VariableDefinition":V.function(V.definition(V.variableName)),"ClassDeclaration/VariableDefinition":V.definition(V.className),"NewExpression/VariableName":V.className,PropertyDefinition:V.definition(V.propertyName),PrivatePropertyDefinition:V.definition(V.special(V.propertyName)),UpdateOp:V.updateOperator,"LineComment Hashbang":V.lineComment,BlockComment:V.blockComment,Number:V.number,String:V.string,Escape:V.escape,ArithOp:V.arithmeticOperator,LogicOp:V.logicOperator,BitOp:V.bitwiseOperator,CompareOp:V.compareOperator,RegExp:V.regexp,Equals:V.definitionOperator,Arrow:V.function(V.punctuation),": Spread":V.punctuation,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace,"InterpolationStart InterpolationEnd":V.special(V.brace),".":V.derefOperator,", ;":V.separator,"@":V.meta,TypeName:V.typeName,TypeDefinition:V.definition(V.typeName),"type enum interface implements namespace module declare":V.definitionKeyword,"abstract global Privacy readonly override":V.modifier,"is keyof unique infer asserts":V.operatorKeyword,JSXAttributeValue:V.attributeValue,JSXText:V.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":V.angleBracket,"JSXIdentifier JSXNameSpacedName":V.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":V.attributeName,"JSXBuiltin/JSXIdentifier":V.standard(V.tagName)}),nU={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},rU={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},iU={__proto__:null,"<":193},lU=vu.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:UK,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[tU],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[_K,HK,JK,eU,2,3,4,5,6,7,8,9,10,11,12,13,14,GK,new _a("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new _a("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>nU[t]||-1},{term:343,get:t=>rU[t]||-1},{term:95,get:t=>iU[t]||-1}],tokenPrec:15201}),OQ=[Zt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Zt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Zt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Zt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Zt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Zt(`try { \${} } catch (\${error}) { \${} @@ -31,13 +31,13 @@ var Mne=Object.defineProperty;var u=(am,Fc)=>Mne(am,"name",{value:Fc,configurabl constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Zt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Zt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],aU=OQ.concat([Zt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Zt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Zt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),bQ=new Ff,yQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function wu(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}u(wu,"defID");const oU=["FunctionDeclaration"],sU={FunctionDeclaration:wu("function"),ClassDeclaration:wu("class"),ClassExpression:()=>!0,EnumDeclaration:wu("constant"),TypeAliasDeclaration:wu("type"),NamespaceDeclaration:wu("namespace"),VariableDefinition(t,e){t.matchContext(oU)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function vQ(t,e){let n=bQ.get(e);if(n)return n;let r=[],i=!0;function l(a,o){let s=t.sliceString(a.from,a.to);r.push({label:s,type:o})}return u(l,"def"),e.cursor(Ae.IncludeAnonymous).iterate(a=>{if(i)i=!1;else if(a.name){let o=sU[a.name];if(o&&o(a,l)||yQ.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of vQ(t,a.node))r.push(o);return!1}}),bQ.set(e,r),r}u(vQ,"getScope");const $Q=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,wQ=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function uU(t){let e=ze(t.state).resolveInner(t.pos,-1);if(wQ.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&$Q.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)yQ.has(i.name)&&(r=r.concat(vQ(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:$Q}}u(uU,"localCompletionSource");const ur=iu.define({name:"javascript",parser:lU.configure({props:[Kf.add({IfStatement:Uf({except:/^\s*({|else\b)/}),TryStatement:Uf({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Dj,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:kj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Uf({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Gf.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":u7,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),xQ={test:t=>/^JSX/.test(t.name),facet:r7({commentTokens:{block:{open:"{/*",close:"*/}"}}})},SQ=ur.configure({dialect:"ts"},"typescript"),CQ=ur.configure({dialect:"jsx",props:[ub.add(t=>t.isTop?[xQ]:void 0)]}),kQ=ur.configure({dialect:"jsx ts",props:[ub.add(t=>t.isTop?[xQ]:void 0)]},"typescript");let DQ=u(t=>({label:t,type:"keyword"}),"kwCompletion");const PQ="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(DQ),cU=PQ.concat(["declare","implements","private","protected","public"].map(DQ));function dU(t={}){let e=t.jsx?t.typescript?kQ:CQ:t.typescript?SQ:ur,n=t.typescript?aU.concat(cU):OQ.concat(PQ);return new ou(e,[ur.data.of({autocomplete:mW(wQ,pA(n))}),ur.data.of({autocomplete:uU}),t.jsx?pU:[]])}u(dU,"javascript");function fU(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}u(fU,"findOpenTag");function EQ(t,e,n=t.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}u(EQ,"elementName$1");const hU=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),pU=J.inputHandler.of((t,e,n,r,i)=>{if((hU?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!ur.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c;let{head:d}=s,f=ze(a).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(a.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:s,changes:{from:d,insert:""}};if(r=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=EQ(a.doc,m.firstChild,d))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:X.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let p=fU(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(h=EQ(a.doc,p,d)))return{range:s,changes:{from:d,insert:``}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),xu=["_blank","_self","_top","_parent"],gy=["ascii","utf-8","utf-16","latin1","latin1"],Oy=["get","post","put","delete"],by=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],rn=["true","false"],te={},mU={a:{attrs:{href:null,ping:null,type:null,media:null,target:xu,hreflang:null}},abbr:te,address:te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:te,aside:te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:te,base:{attrs:{href:null,target:xu}},bdi:te,bdo:te,blockquote:{attrs:{cite:null}},body:te,br:te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:by,formmethod:Oy,formnovalidate:["novalidate"],formtarget:xu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:te,center:te,cite:te,code:te,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:te,div:te,dl:te,dt:te,em:te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:te,figure:te,footer:te,form:{attrs:{action:null,name:null,"accept-charset":gy,autocomplete:["on","off"],enctype:by,method:Oy,novalidate:["novalidate"],target:xu}},h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:te,hgroup:te,hr:te,html:{attrs:{manifest:null}},i:te,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:by,formmethod:Oy,formnovalidate:["novalidate"],formtarget:xu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:te,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gy,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:te,noscript:te,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:te,param:{attrs:{name:null,value:null}},pre:te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:te,rt:te,ruby:te,samp:te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gy}},section:te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:te,source:{attrs:{src:null,type:null,media:null}},span:te,strong:te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:te,summary:te,sup:te,table:te,tbody:te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:te,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:te,time:{attrs:{datetime:null}},title:te,tr:te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:te,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:te},TQ={accesskey:null,class:null,contenteditable:rn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:rn,autocorrect:rn,autocapitalize:rn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":rn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":rn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":rn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":rn,"aria-hidden":rn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":rn,"aria-multiselectable":rn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":rn,"aria-relevant":null,"aria-required":rn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},AQ="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of AQ)TQ[t]=null;let yh=(Sc=class{constructor(e,n){this.tags={...mU,...e},this.globalAttrs={...TQ,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}},u(Sc,"Schema"),Sc);yh.default=new yh;function Ha(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}u(Ha,"elementName");function Ja(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}u(Ja,"findParentElement");function QQ(t,e,n){let r=n.tags[Ha(t,Ja(e))];return r?.children||n.allTags}u(QQ,"allowedChildren");function yy(t,e){let n=[];for(let r=Ja(e);r&&!r.type.isTop;r=Ja(r.parent)){let i=Ha(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}u(yy,"openTags");const MQ=/^[:\-\.\w\u00b7-\uffff]*$/;function BQ(t,e,n,r,i){let l=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",a=Ja(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:QQ(t.doc,a,e).map(o=>({label:o,type:"type"})).concat(yy(t.doc,n).map((o,s)=>({label:"/"+o,apply:"/"+o+l,type:"type",boost:99-s}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}u(BQ,"completeTag");function RQ(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:yy(t.doc,e).map((l,a)=>({label:l,apply:l+i,type:"type",boost:99-a})),validFor:MQ}}u(RQ,"completeCloseTag");function gU(t,e,n,r){let i=[],l=0;for(let a of QQ(t.doc,n,e))i.push({label:"<"+a,type:"type"});for(let a of yy(t.doc,n))i.push({label:"",type:"type",boost:99-l++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}u(gU,"completeStartTag");function OU(t,e,n,r,i){let l=Ja(n),a=l?e.tags[Ha(t.doc,l)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],s=a&&a.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:s.map(c=>({label:c,type:"property"})),validFor:MQ}}u(OU,"completeAttrName");function bU(t,e,n,r,i){var l;let a=(l=n.parent)===null||l===void 0?void 0:l.getChild("AttributeName"),o=[],s;if(a){let c=t.sliceDoc(a.from,a.to),d=e.globalAttrs[c];if(!d){let f=Ja(n),h=f?e.tags[Ha(t.doc,f)]:null;d=h?.attrs&&h.attrs[c]}if(d){let f=t.sliceDoc(r,i).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(s=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=t.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):s=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:h+m+p,type:"constant"})}}return{from:r,to:i,options:o,validFor:s}}u(bU,"completeAttrValue");function yU(t,e){let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.resolve(r);for(let a=r,o;l==i&&(o=i.childBefore(a));){let s=o.lastChild;if(!s||!s.type.isError||s.fromyU(r,i)}u(vU,"htmlCompletionSourceWith");const $U=ur.parser.configure({top:"SingleExpression"}),VQ=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:SQ.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:CQ.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:kQ.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:$U},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:ur.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:bh.parser}],NQ=[{name:"style",parser:bh.parser.configure({top:"Styles"})}].concat(AQ.map(t=>({name:t,parser:ur.parser}))),FQ=iu.define({name:"html",parser:YY.configure({props:[Kf.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),vh=FQ.configure({wrap:iQ(VQ,NQ)});function wU(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=iQ((t.nestedLanguages||[]).concat(VQ),(t.nestedAttributes||[]).concat(NQ)));let r=n?FQ.configure({wrap:n,dialect:e}):e?vh.configure({dialect:e}):vh;return new ou(r,[vh.data.of({autocomplete:vU(t)}),t.autoCloseTags!==!1?xU:[],dU().support,PK().support])}u(wU,"html");const IQ=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),xU=J.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!vh.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c,d,f;let h=a.doc.sliceString(s.from-1,s.to)==r,{head:p}=s,m=ze(a).resolveInner(p,-1),g;if(h&&r==">"&&m.name=="EndTag"){let O=m.parent;if(((d=(c=O.parent)===null||c===void 0?void 0:c.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=Ha(a.doc,O.parent,p))&&!IQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=``;return{range:s,changes:{from:p,to:b,insert:y}}}}else if(h&&r=="/"&&m.name=="IncompleteCloseTag"){let O=m.parent;if(m.from==p-2&&((f=O.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=Ha(a.doc,O,p))&&!IQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=`${g}>`;return{range:X.cursor(p+y.length,-1),changes:{from:p,to:b,insert:y}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var SU=Object.defineProperty,LQ=u((t,e)=>SU(t,"name",{value:e,configurable:!0}),"i$d");const CU=LQ((t,e=!1)=>{const n=[TX(),MX(),iX(),cq(),Ij(),GZ(),su.of(" "),Ej(),Uj(),XW(),JW(),mX(),bX(),sX(),nY(),Df.of([hW,...WW,...fW,...yq,...Vj,...AA]),wU(),zj(Xj,{fallback:!0}),J.updateListener.of(r=>{r.docChanged&&e&&e(r.state.doc.toString())}),J.lineWrapping];return Xe.create({doc:t,extensions:n})},"createEditorState"),kU=LQ((t,e)=>new J({state:t,parent:e,lineWrapping:!0}),"createEditorView");var DU=Object.defineProperty,PU=u((t,e)=>DU(t,"name",{value:e,configurable:!0}),"i$c");const zQ=PU(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(null),i=wp.element.useRef(null);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{if(i.current)return;const l=CU(t.value??"",n);i.current=kU(l,r.current)},[r.current]),wp.element.createElement("div",{className:"tf-code"},wp.element.createElement("div",{className:"tf-code-editor",ref:r}))},"Editor");var EU=Object.defineProperty,TU=u((t,e)=>EU(t,"name",{value:e,configurable:!0}),"n$b");const AU=TU(t=>{const e=wp.element.useRef(null),[n,r]=wp.element.useState(t.value??""),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]),wp.element.createElement("div",{className:"tf-code"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",value:n,ref:e,name:t.name??""}),wp.element.createElement(zQ,{...t,value:n,onChange:r}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Code");var QU=Object.defineProperty,MU=u((t,e)=>QU(t,"name",{value:e,configurable:!0}),"c$e");const BU=MU(t=>{const e=wp.element.useRef(null),n=wp.element.useRef(null),r=wp.element.useRef(null),i=rN(t),{colorAreaProps:l,gradientProps:a,xInputProps:o,yInputProps:s,thumbProps:c}=ON({...t,inputXRef:e,inputYRef:n,containerRef:r},i),{focusProps:d}=rs();return wp.element.createElement("div",{className:"tf-color-area",ref:r,style:l.style,...l},wp.element.createElement("div",{className:"tf-color-area-gradient",style:a?.style,...a}),wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...c.style,background:i.getDisplayColor().toString("css")},...c},wp.element.createElement("input",{ref:e,...o,...d}),wp.element.createElement("input",{ref:n,...s,...d})))},"ColorArea");var RU=Object.defineProperty,VU=u((t,e)=>RU(t,"name",{value:e,configurable:!0}),"c$d");const ZQ=VU(t=>{const{locale:e}=Re(),n=sN({...t,locale:e}),r=wp.element.useRef(),i=wp.element.useRef(),l=t.label||n.value.getChannelName(t.channel,e),{trackProps:a,thumbProps:o,inputProps:s,labelProps:c,outputProps:d}=vN({...t,label:l,trackRef:r,inputRef:i},n),{focusProps:f}=rs();return wp.element.createElement("div",{className:"tf-color-slider"},wp.element.createElement("div",{className:"tf-color-slider-label"},wp.element.createElement("label",{...c},l),wp.element.createElement("output",{...d},n.value.formatChannelValue(t.channel,e))),wp.element.createElement("div",{className:"tf-color-slider-container",ref:r,style:a.style,...a},wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...o.style,background:n.getDisplayColor().toString("css")},...o},wp.element.createElement(gn,null,wp.element.createElement("input",{ref:i,...s,...f})))))},"ColorSlider");var NU=Object.defineProperty,FU=u((t,e)=>NU(t,"name",{value:e,configurable:!0}),"t$7");const XQ=FU(t=>{const[e,n]=wp.element.useState(mn(t.value&&t.value!==""?t.value:"rgba(255, 255, 255, 1)").toHSB()),[r,i,l]=e.getColorChannels(),[a,o]=wp.element.useState(t.value);wp.element.useEffect(()=>{o(t.value)},[t.value]),wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]);const{focusWithinProps:s}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}}),c=t.hasAlpha??!0;return wp.element.createElement("div",{className:"tf-color-picker",...s},wp.element.createElement(gs,null,wp.element.createElement(vd,{autoFocus:!0,restoreFocus:!0},wp.element.createElement(BU,{"aria-labelledby":"hsb-label-id-1",value:e,onChange:n,xChannel:i,yChannel:l}),wp.element.createElement("div",{className:"tf-color-input"},wp.element.createElement("label",null,"Color"),wp.element.createElement("input",{type:"text",value:a,onChange:d=>{o(d.target.value)},onBlur:d=>{t.onChange(d.target.value)}})),wp.element.createElement("div",{className:"tf-color-sliders"},wp.element.createElement(ZQ,{channel:r,value:e,onChange:n}),c&&wp.element.createElement(ZQ,{channel:"alpha",value:e,onChange:n})))))},"ColorPicker");var IU=Object.defineProperty,LU=u((t,e)=>IU(t,"name",{value:e,configurable:!0}),"c$c");const zU=wp.element.forwardRef(({inputProps:t,state:e,...n},r)=>{const[i,l]=wp.element.useState(!1),a=n.format??"hexa",o=wp.element.useRef(),s=LU(c=>{const d=c.toString?c.toString(a):"";e.setInputValue(d),n.onChange&&n.onChange(d)},"onChange");return wp.element.useEffect(()=>e.setInputValue(e.colorValue?.toString(a)),[]),wp.element.createElement("div",{className:"tf-color-container",ref:o},wp.element.createElement("input",{ref:r,...t,onClick:()=>l(!0),value:e.inputValue??""}),i&&wp.element.createElement(Rr,{state:{isOpen:i,close:()=>l(!1)},triggerRef:r,placement:"bottom start",style:{width:o?.current?.offsetWidth},className:"tf-color-popover"},wp.element.createElement(XQ,{value:e.colorValue?.toString(a),onChange:s,hasAlpha:n.hasAlpha??!0,onFocusChange:c=>l(c)})))});var ZU=Object.defineProperty,XU=u((t,e)=>ZU(t,"name",{value:e,configurable:!0}),"n$a");const jQ=XU(t=>{let e;typeof t.value=="object"?e=t.value?.value||"#FFFFFF":e=t?.value||"#FFFFFF";const n={...t,value:e},r=wp.element.useRef(),i=dN(n),{labelProps:l,inputProps:a,descriptionProps:o}=wN(n,i,r),[s,c]=wp.element.useState(n.value??"");return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement("div",{className:"tf-color"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(Ss,{...n,value:s,onValueSelection:c,inputProps:a,ref:r},wp.element.createElement(zU,{...n,value:s,onChange:t.onChange,state:i,inputProps:a,ref:r})),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Color");var jU=Object.defineProperty,qQ=u((t,e)=>jU(t,"name",{value:e,configurable:!0}),"c$b");const qU=qQ((t,e)=>{const{api:n,fetchResponse:r}=Zn();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(t,{method:"POST",body:e,headers:{"X-WP-Nonce":n.nonce??!1,enctype:"multipart/form-data"},credentials:"same-origin",processData:!1,contentType:!1}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"post"),WQ=qQ((t,e=!1)=>{const{api:n,fetchResponse:r}=Zn();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(`${t}?${e?new URLSearchParams(e):""}`,{method:"GET",headers:{"X-WP-Nonce":n.nonce??!1},credentials:"same-origin"}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"get");var WU=Object.defineProperty,vy=u((t,e)=>WU(t,"name",{value:e,configurable:!0}),"i$b");const YU=vy(t=>{const e=wp.element.useRef({status:!1,callback:!1,firstLoad:!0}),n=YI({async load({filterText:r}){if(e.current.firstLoad)e.current.firstLoad=!1;else{if(e.current.status==="waiting"){const o=t.debounceTime??200;clearTimeout(e.current.callback),e.current={status:"waiting",callback:setTimeout(()=>{e.current.status=!1,n.setFilterText(r)},o)};return}e.current.status="waiting"}const i={...t.asyncArgs??{},search:r};let l=t.ajaxAction?await Tangible?.ajax(t.ajaxAction,i):await WQ(t.searchUrl??"",i);l.length===0&&l.push({id:"_noResults",title:"No results"}),!Array.isArray(l)&&typeof l=="object"&&(l=Object.values(l).map(o=>o));const a=t.mapResults?KU(l,t.mapResults):l;return{items:il((a??[]).reduce((o,s)=>({...o,[s.id]:s.title}),{}))}}});return{items:n.items,inputValue:n.filterText,onInputChange:n.setFilterText,selectedKeys:t.value.value??"",loadingState:n.loadingState}},"getAsyncProps"),KU=vy((t,e)=>t.map(n=>(e.id&&(n.id=YQ(n,e.id)),e.title&&(n.title=YQ(n,e.title)),n)),"mapResults"),YQ=vy((t,e)=>typeof e=="object"?t[e.key][e.attribute]:t[e],"mapResultsItem");var UU=Object.defineProperty,$h=u((t,e)=>UU(t,"name",{value:e,configurable:!0}),"n$9");const KQ=$h((t,e,n)=>{if(!e.isAsync){e.onSelectionChange&&e.onSelectionChange(t);return}const r=Y2(t,e.items);e.onSelectionChange&&e.onSelectionChange(r),e.multiple||n.setInputValue(r.label)},"onSelectionChange"),UQ=$h((t,e)=>t.isAsync&&t.selectedKey?e.setInputValue(t.selectedKey.label??""):null,"setInputValue"),GQ=$h(t=>t.isAsync&&t.selectedKey?.value?t.selectedKey.value:t.selectedKey??"","getSelectedKey"),_Q=$h(t=>[...t.disabledKeys??[],"_noResults"],"getDisabledKeys"),GU=wp.element.forwardRef(({parent:t,buttonProps:e,descriptionProps:n,labelProps:r,inputProps:i,listBoxProps:l,state:a,multiple:o=!1},s)=>{if(o)throw new Error("The simple layout does not support multiple values");const{focusWithinProps:c}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}});return wp.element.createElement("div",{className:"tf-combo-box",...c},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement(vd,{autoFocus:t.autoFocus,restoreFocus:!0},wp.element.createElement("div",{className:"tf-combo-box-text",ref:s.current.wrapper},wp.element.createElement("input",{...i,ref:s.current.input,readOnly:t.readOnly}),t.showButton&&wp.element.createElement(se,{type:"action",ref:s.current.trigger,preventFocusOnPress:!0,...e,isDisabled:t.readOnly},wp.element.createElement("span",{"aria-hidden":"true"},"\u25BC")),a.isOpen&&!t.readOnly&&wp.element.createElement(Rr,{state:a,triggerRef:s.current.input,popoverRef:s.current.popover,placement:"bottom start",isNonModal:!0,style:{width:s.current.wrapper?.current?.offsetWidth},className:"tf-combo-box-popover"},wp.element.createElement(Vd,{loadingState:t.loadingState??"idle",listBoxRef:s.current.listbox,state:a,items:t.items,focusWithinProps:!0,shouldUseVirtualFocus:!0,...l})))),t.description&&wp.element.createElement(we,{descriptionProps:n,parent:t},t.description))}),_U=wp.element.forwardRef(({parent:t,descriptionProps:e,labelProps:n,inputProps:r,itemProps:i,multiple:l,state:a,...o},s)=>{if(!l)throw new Error("The simple-multiple layout only support multiple values");const{add:c,getDisabledValues:d,remove:f}=l,[h,p]=wp.element.useState(l.values??[]);wp.element.useEffect(()=>p(l.values),[l.values]);const m=wp.element.useRef(),g=pi({}),{triggerProps:O,overlayProps:b}=us({type:"dialog"},g,m),y=Array.isArray(t.choices)?t.choices.reduce(($,v)=>({...$,...v.choices??{}}),{}):t.choices;return wp.element.createElement("div",{className:"tf-multiple-combobox","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("div",{className:"tf-multiple-combobox-container"},wp.element.createElement("div",{ref:s.current.input,className:"tf-multiple-combobox-values",...r},h.length===0?t.placeholder??"No item selected":h.map(($,v)=>wp.element.createElement("span",{key:$.key??v,className:"tf-combo-box-item"},wp.element.createElement("span",null,t.isAsync?$.label:y[$]??""),t.readOnly!==!0&&wp.element.createElement(se,{onPress:()=>f(v)},"x")))),wp.element.createElement(se,{type:"action",ref:m,...O,isDisabled:t.readOnly},"Add"),g.isOpen&&wp.element.createElement("div",{className:"tf-popover",ref:s.current.overlay,...b},wp.element.createElement(e8,{focusStrategy:"first",label:"Select an item to add",labelVisuallyHidden:!0,description:!1,disabledKeys:d(),autoFocus:!0,multiple:!0,showButton:!1,menuTrigger:"focus",onSelectionChange:$=>{$&&(c($),g.close())},onFocusChange:$=>$?!g.isOpen&&g.open():g.close(),isAsync:t.isAsync??!1,...i},t.children),wp.element.createElement(ds,{onDismiss:g.close}))),t.description&&wp.element.createElement(we,{descriptionProps:e,parent:t},t.description))});var HU=Object.defineProperty,JU=u((t,e)=>HU(t,"name",{value:e,configurable:!0}),"i$9");const HQ={"simple-multiple":_U,simple:GU},JQ=JU(t=>typeof t=="string"?HQ[t]:["function","object"].includes(typeof t)?t:HQ[fallback],"getLayout");var eG=Object.defineProperty,tG=u((t,e)=>eG(t,"name",{value:e,configurable:!0}),"l$8"),e8=tG(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef();wp.element.useEffect(()=>{UQ(t,o)},[]);const{contains:a}=Cg({sensitivity:"base"}),o=rP({...t,onSelectionChange:g=>KQ(g,t,o),selectedKey:GQ(t),defaultFilter:a,disabledKeys:_Q(t)}),{buttonProps:s,inputProps:c,listBoxProps:d,labelProps:f,descriptionProps:h}=KD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},o),p=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),m=JQ(t.layout??"simple");return wp.element.createElement(m,{parent:t,labelProps:f,descriptionProps:h,inputProps:c,buttonProps:s,listBoxProps:d,itemProps:t.itemProps,ref:p,state:o,multiple:!1})},"ComboBox"),nG=Object.defineProperty,wh=u((t,e)=>nG(t,"name",{value:e,configurable:!0}),"n$7");const rG=wh(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef(),[a,o]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value&&!t.isAsync?t.value.split(","):[]);wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a.length]),wp.element.useEffect(()=>{UQ(t,c)},[]);const{contains:s}=Cg({sensitivity:"base"}),c=rP({...t,onSelectionChange:v=>KQ(v,t,c),selectedKey:GQ(t),defaultFilter:s,disabledKeys:_Q(t)}),{buttonProps:d,inputProps:f,listBoxProps:h,labelProps:p,descriptionProps:m}=KD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},c),g=wh(v=>{a.indexOf(v)===-1&&o([...a,v])},"add"),O=wh(v=>{a[v]&&o([...a.slice(0,v),...a.slice(v+1)])},"remove"),b=wh(()=>t.isAsync?a.map(v=>v.value):a,"getDisabledValues"),y=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),$=JQ(t.layout??"simple-multiple");return wp.element.createElement($,{parent:t,labelProps:p,descriptionProps:m,inputProps:f,buttonProps:d,listBoxProps:h,itemProps:t.itemProps,ref:y,state:c,multiple:{getDisabledValues:b,add:g,remove:O,values:a}})},"MultipleComboBox");var iG=Object.defineProperty,lG=u((t,e)=>iG(t,"name",{value:e,configurable:!0}),"t$6"),xh=lG(t=>{const[e,n]=wp.element.useState(t.isAsync?On(t.value??""):t.value??!1),r=t.isAsync?YU(t):{defaultItems:il(t.choices??{})};return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[r.selectedKeys]),t.multiple?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(rG,{...t,onChange:i=>n(t.isAsync?i:i.join(",")),value:e,label:t.label??null,placeholder:t.placeholder,description:t.description??!1,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple-multiple",itemProps:r,...r},Ld)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(e8,{focusStrategy:"first",label:t.label??null,placeholder:t.placeholder,description:t.description??!1,selectedKey:e,onSelectionChange:n,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple",itemProps:r,...r},Ld))},"default"),aG=Object.defineProperty,oG=u((t,e)=>aG(t,"name",{value:e,configurable:!0}),"i$8");const Sh=oG((t,e)=>{if(t instanceof Fe)return t;const n=String(t??"").split("-");return n.length===3?new Fe("AD",n[0],n[1],n[2]):e},"formatValue");var sG=Object.defineProperty,t8=u((t,e)=>sG(t,"name",{value:e,configurable:!0}),"o$7");const n8=wp.element.createContext(null),uG=t8(({value:t,children:e})=>{const n=On(t)??"",r=Cr(kr()),i={start:Sh(n.start??"",r),end:Sh(n.end??"",r)},[l,a]=wp.element.useState(i);return wp.element.createElement(n8.Provider,{value:{dateValue:l,setDateValue:a}},e)},"CalendarContextProvider"),Ch=t8(()=>{const t=wp.element.useContext(n8);if(!t)throw new Error("useCalendarContext must be used within a Calendar");return t},"useCalendarContext");var cG=Object.defineProperty,dG=u((t,e)=>cG(t,"name",{value:e,configurable:!0}),"t$5");const fG=dG(({state:t,date:e})=>{const n=wp.element.useRef(),{cellProps:r,buttonProps:i,isSelected:l,isOutsideVisibleRange:a,isDisabled:o,isUnavailable:s,formattedDate:c}=LV({date:e},t,n),{focusProps:d}=rs();let f="tf-calendar-cell";return l&&(f+=" tf-calendar-cell-selected"),o&&(f+=" tf-calendar-cell-disabled"),s&&(f+=" tf-calendar-cell-unavailable"),wp.element.createElement("td",{...r},wp.element.createElement("div",{...ne(i,d),ref:n,hidden:a,className:f},c))},"CalendarCell");var hG=Object.defineProperty,pG=u((t,e)=>hG(t,"name",{value:e,configurable:!0}),"l$7");const r8=pG(({state:t,...e})=>{const{locale:n}=Re(),r=e.dateRange??!1,i=t.visibleRange.start.add(e.offset??{}),l=Oa(i),{gridProps:a,headerProps:o,weekDays:s}=wx(r?{startDate:i,endDate:l}:e,t),c=z3(t.visibleRange.start,n);return wp.element.createElement("table",{className:"tf-calendar-table",...a},wp.element.createElement("thead",{...o},wp.element.createElement("tr",null,s.map((d,f)=>wp.element.createElement("th",{key:f},d)))),wp.element.createElement("tbody",null,[...new Array(c).keys()].map(d=>{const f=r?[d,i]:[d];return wp.element.createElement("tr",{key:d},t.getDatesInWeek(...f).map((h,p)=>h?wp.element.createElement(fG,{key:p,state:t,date:h,currentMonth:i}):wp.element.createElement("td",{key:p})))})))},"CalendarGrid");var mG=Object.defineProperty,$y=u((t,e)=>mG(t,"name",{value:e,configurable:!0}),"e");const kh=$y(({date:t,children:e})=>{const{setDateValue:n}=Ch();return wp.element.createElement(se,{onPress:$y(()=>{n(t)},"onPress")},e)},"Preset"),gG=$y(()=>{const t=Cr(kr());return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(kh,{date:{start:t,end:t}},"Today"),wp.element.createElement(kh,{date:{start:t.subtract({weeks:1}),end:t}},"Last Week"),wp.element.createElement(kh,{date:{start:_i(t),end:Oa(t)}},"This Month"),wp.element.createElement(kh,{date:{start:_i(t.subtract({months:1})),end:Oa(t.subtract({months:1}))}},"Last Month"))},"DateRangePresets");var OG=Object.defineProperty,bG=u((t,e)=>OG(t,"name",{value:e,configurable:!0}),"r$4");const i8=bG(t=>{const{locale:e}=Re(),{dateValue:n}=t.dateRange?Ch():{},r=t.dateRange?DI({...t,value:n,locale:e,visibleDuration:{months:t.multiMonth},createCalendar:mg}):J2({...t,locale:e,createCalendar:mg}),i=wp.element.useRef(),{calendarProps:l,prevButtonProps:a,nextButtonProps:o,title:s}=t.dateRange?FV(t,r,i):NV(t,r);return wp.element.createElement("div",{className:"tf-calendar",...l,ref:i},wp.element.createElement("div",{className:"tf-calendar-header"},wp.element.createElement("div",{className:"tf-calendar-buttons"},wp.element.createElement(se,{...a},"<"),wp.element.createElement("div",{className:"tf-calendar-month"},s),wp.element.createElement(se,{...o},">"))),wp.element.createElement("div",{className:"tf-calendar-tables"},t.multiMonth===1||!t.dateRange?wp.element.createElement(r8,{state:r}):Array.from({length:t.multiMonth},(c,d)=>wp.element.createElement(r8,{key:d,state:r,dateRange:t.dateRange,offset:{months:d}}))),t.dateRange&&t.datePresets&&wp.element.createElement("div",{className:"tf-calendar-presets"},wp.element.createElement(gG,null)))},"Calendar");var yG=Object.defineProperty,vG=u((t,e)=>yG(t,"name",{value:e,configurable:!0}),"o$6");const l8=vG(({segment:t,state:e})=>{const n=wp.element.useRef(),{segmentProps:r}=OF(t,e,n);let i="tf-date-segment";return t.isPlaceholder&&(i+=" tf-date-segment-placeholder"),wp.element.createElement("div",{className:i,...r,ref:n},wp.element.createElement("span",{"aria-hidden":"true"},t.placeholder),t.isPlaceholder?"":t.text)},"DateSegment");var $G=Object.defineProperty,wG=u((t,e)=>$G(t,"name",{value:e,configurable:!0}),"a$5");const wy=wG(t=>{const{locale:e}=Re(),n=WP({...t,locale:e,createCalendar:mg}),r=wp.element.useRef(),{fieldProps:i}=Q2(t,n,r);return wp.element.createElement("div",{className:"tf-date-field",...i,ref:r},n.segments.map((l,a)=>wp.element.createElement(l8,{key:a,segment:l,state:n})))},"DateField");var xG=Object.defineProperty,a8=u((t,e)=>xG(t,"name",{value:e,configurable:!0}),"i$7");const SG=wp.element.forwardRef(({datePickerProps:t,hasFutureOnly:e,state:n,...r},i)=>{const{groupProps:l,fieldProps:a,buttonProps:o,dialogProps:s,calendarProps:c,inputProps:d}=t,[f,h]=wp.element.useState(r.value);wp.element.useEffect(()=>{r.value!==f&&h(r.value)},[r.value]),wp.element.useEffect(()=>(document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)),[i]);const p=a8(g=>{const O=i.current??!1;O&&(O.contains(g.target)||n.setOpen(!1))},"onClickOutside");o.onPress=()=>n.setOpen(!n.isOpen);const m=a8(()=>n.value&&n.value.toString?n.value.toString():"","getStringValue");return wp.element.useEffect(()=>{if(r.onChange&&r.onChange(m()),e&&n.value&&r.value){const g=Cr(kr());n.value.compare(g)<0&&n.setValue(g)}},[n.value]),wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...d,type:"hidden",name:r.name??"",value:m()}),wp.element.createElement("div",{className:"tf-date-group",...l,ref:i},wp.element.createElement(wy,{...a}),wp.element.createElement(se,{type:"action",...o},"\u{1F5D3}")),n.isOpen&&wp.element.createElement(Rr,{state:n,triggerRef:i,placement:"bottom start"},wp.element.createElement(gs,{...s},wp.element.createElement(i8,{...c}))))});var CG=Object.defineProperty,kG=u((t,e)=>CG(t,"name",{value:e,configurable:!0}),"c$8");const DG=kG(t=>{const[e,n]=wp.element.useState(t.value??"");wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=NI({...t,value:Sh(t.value,i)}),o=wp.element.useRef(null),{labelProps:s,descriptionProps:c,inputProps:d,...f}=pF({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Ss,{...t,value:e,onValueSelection:n,ref:o,inputProps:f.inputProps},wp.element.createElement(SG,{ref:o,minValue:l,name:t.name??"",value:Sh(e),onChange:n,onFocusChange:t.onFocusChange??!1,dynamic:t.dynamic??!1,hasFutureOnly:r,state:a,datePickerProps:{inputProps:d,...f}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"Date");var PG=Object.defineProperty,EG=u((t,e)=>PG(t,"name",{value:e,configurable:!0}),"d$6");const TG=wp.element.forwardRef(({dateRangePickerProps:t,state:e,...n},r)=>{const{dateValue:i}=Ch(),[l,a]=wp.element.useState(i!==null?i.start:"");wp.element.useEffect(()=>{n.value&&n.value!==l&&a(n.value.start)},[n.value]);const{groupProps:o,startFieldProps:s,endFieldProps:c,buttonProps:d,dialogProps:f,calendarProps:h,inputProps:p}=M2(n,e,r),m=EG(()=>e.value&&e.value.start&&e.value.end?JSON.stringify({start:e.value.start.toString(),end:e.value.end.toString()}):"","getStringValue");return wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...p,type:"hidden",name:n.name??"",value:m()}),wp.element.createElement("div",{...o,ref:r,className:"tf-date-group"},wp.element.createElement(wy,{...s}),wp.element.createElement("span",{style:{padding:"0 4px"}},"\u2013"),wp.element.createElement(wy,{...c}),e.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}"),wp.element.createElement(se,{type:"action",...d},"\u{1F5D3}")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:r,placement:"bottom start"},wp.element.createElement(gs,{...f},wp.element.createElement(i8,{...h,dateRange:!0,datePresets:n.datePresets??!1,pageBehavior:"single",multiMonth:n.multiMonth,focusedValue:l,onFocusChange:a}))))});var AG=Object.defineProperty,QG=u((t,e)=>AG(t,"name",{value:e,configurable:!0}),"o$5");const MG=QG(t=>{const{dateValue:e,setDateValue:n}=Ch();wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{e!==t.value&&typeof t.value=="object"&&n(t.value)},[t.value]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=XI({...t,value:e}),o=wp.element.useRef(),{labelProps:s,descriptionProps:c,...d}=M2({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Ss,{...t,value:e,ref:o},wp.element.createElement(TG,{ref:o,name:t.name??"",minValue:l,value:e,hasFutureOnly:r,onChange:n,onFocusChange:t.onFocusChange??null,state:a,multiMonth:t.multiMonth??1,datePresets:t.datePresets??!1,dateRangePickerProps:{...d}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"DateRange");var BG=Object.defineProperty,RG=u((t,e)=>BG(t,"name",{value:e,configurable:!0}),"r$3"),VG=RG(t=>t.dateRange?wp.element.createElement(uG,{value:t.value},wp.element.createElement(MG,{...t})):wp.element.createElement(DG,{...t}),"default"),NG=Object.defineProperty,o8=u((t,e)=>NG(t,"name",{value:e,configurable:!0}),"s$7");const xy={},FG=o8(t=>{const[e,n]=wp.element.useState(t.value??""),[r,i]=wp.element.useState(fi()),l=wp.element.useRef(null),a=wp.element.useRef(null),o=wp.element.useRef(null),{labelProps:s,inputProps:c,descriptionProps:d}=si(t,l);wp.element.useEffect(()=>{xy[r]=VT(l.current,e,n,t.choices)},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const f=pi({}),{triggerProps:h,overlayProps:p}=us({type:"dialog"},f,a),m=o8(g=>{xy[r].dispatch({changes:{from:xy[r].state.doc.length,insert:`[[${g}]]`}})},"addDynamicElement");return wp.element.createElement("div",{className:"tf-dynamic-text"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement("div",{className:"tf-dynamic-text-field"},wp.element.createElement(gn,null,wp.element.createElement(U9,{label:t.label??!1,name:t.name??"",value:e})),wp.element.createElement("div",{ref:l,className:"tf-dynamic-text-input",...c}),wp.element.createElement(se,{type:"action",ref:a,...h},"Add"),f.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-text-popover",ref:o,...p},wp.element.createElement(xh,{label:"Select dynamic token",labelVisuallyHidden:!0,choices:t.choices??{},autoFocus:!0,showButton:!1,onChange:g=>{g&&(m(g),f.close())},onFocusChange:g=>g?!f.isOpen&&f.open():f.close()}),wp.element.createElement(ds,{onDismiss:f.close}))),t.description&&wp.element.createElement(we,{descriptionProps:d,parent:t},t.description))},"DynamicText");function lt(t){this.content=t}u(lt,"OrderedMap"),lt.prototype={constructor:lt,find:function(t){for(var e=0;e>1}},lt.from=function(t){if(t instanceof lt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new lt(e)};function s8(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),l=e.child(r);if(i==l){n+=i.nodeSize;continue}if(!i.sameMarkup(l))return n;if(i.isText&&i.text!=l.text){for(let a=0;i.text[a]==l.text[a];a++)n++;return n}if(i.content.size||l.content.size){let a=s8(i.content,l.content,n+1);if(a!=null)return a}n+=i.nodeSize}}u(s8,"findDiffStart");function u8(t,e,n,r){for(let i=t.childCount,l=e.childCount;;){if(i==0||l==0)return i==l?null:{a:n,b:r};let a=t.child(--i),o=e.child(--l),s=a.nodeSize;if(a==o){n-=s,r-=s;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let c=0,d=Math.min(a.text.length,o.text.length);for(;ce&&r(s,i+o,l||null,a)!==!1&&s.content.size){let d=o+1;s.nodesBetween(Math.max(0,e-d),Math.min(s.content.size,n-d),r,i+d)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let l="",a=!0;return this.nodesBetween(e,n,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,n-s):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&r&&(a?a=!1:l+=r),l+=c},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),l=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),l=1);le)for(let l=0,a=0;ae&&((an)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new st(r,i)}cutByIndex(e,n){return e==n?st.empty:e==0&&n==this.content.length?this:new st(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),l=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new st(i,l)}addToStart(e){return new st([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new st(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),l=r+i.nodeSize;if(l>=e)return l==e?Dh(n+1,l):Dh(n,r);r=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return st.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new st(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return st.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(l)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};u(Cc,"Mark");let ye=Cc;ye.none=[];const s$=class s$ extends Error{};u(s$,"ReplaceError");let eo=s$;const Fi=class Fi{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=d8(this.content,e+this.openStart,n);return r&&new Fi(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Fi(c8(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Fi.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Fi(j.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let l=e.firstChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.firstChild)r++;for(let l=e.lastChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.lastChild)i++;return new Fi(e,r,i)}};u(Fi,"Slice");let H=Fi;H.empty=new H(j.empty,0,0);function c8(t,e,n){let{index:r,offset:i}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:o}=t.findIndex(n);if(i==e||l.isText){if(o!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,l.copy(c8(l.content,e-i-1,n-i-1)))}u(c8,"removeRange");function d8(t,e,n,r){let{index:i,offset:l}=t.findIndex(e),a=t.maybeChild(i);if(l==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=d8(a.content,e-l-1,n,a);return o&&t.replaceChild(i,a.copy(o))}u(d8,"insertInto");function IG(t,e,n){if(n.openStart>t.depth)throw new eo("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new eo("Inconsistent open depths");return f8(t,e,n,0)}u(IG,"replace");function f8(t,e,n,r){let i=t.index(r),l=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}u(Cl,"addNode");function Su(t,e,n,r){let i=(e||t).node(n),l=0,a=e?e.index(n):i.childCount;t&&(l=t.index(n),t.depth>n?l++:t.textOffset&&(Cl(t.nodeAfter,r),l++));for(let o=l;oi&&Cy(t,e,i+1),a=r.depth>i&&Cy(n,r,i+1),o=[];return Su(null,t,i,o),l&&a&&e.index(i)==n.index(i)?(h8(l,a),Cl(kl(l,p8(t,e,n,r,i+1)),o)):(l&&Cl(kl(l,Eh(t,e,i+1)),o),Su(e,n,i,o),a&&Cl(kl(a,Eh(n,r,i+1)),o)),Su(r,null,i,o),new j(o)}u(p8,"replaceThreeWay");function Eh(t,e,n){let r=[];if(Su(null,t,n,r),t.depth>n){let i=Cy(t,e,n+1);Cl(kl(i,Eh(t,e,n+1)),r)}return Su(e,null,n,r),new j(r)}u(Eh,"replaceTwoWay");function LG(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let l=n-1;l>=0;l--)i=e.node(l).copy(j.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}u(LG,"prepareSliceForReplace");const kc=class kc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let l=0;l0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new to(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,l=n;for(let a=e;;){let{index:o,offset:s}=a.content.findIndex(l),c=l-s;if(r.push(a,o,i+s),!c||(a=a.child(o),a.isText))break;l=c-1,i+=s+1}return new kc(n,r,l)}static resolveCached(e,n){let r=m8.get(e);if(r)for(let l=0;le&&this.nodesBetween(e,n,l=>(r.isInSet(l.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),g8(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,i=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,l),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let s=i;sn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=j.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,i,r);return l.type.checkAttrs(l.attrs),l}},u(Hl,"Node"),Hl);Dl.prototype.text=void 0;const Dc=class Dc extends Dl{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):g8(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Dc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Dc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};u(Dc,"TextNode");let Dy=Dc;function g8(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}u(g8,"wrapMarks");const Yp=class Yp{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Py(e,n);if(r.next==null)return Yp.empty;let i=O8(r);r.next&&r.err("Unexpected trailing text");let l=UG(KG(i));return GG(l,r),l}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let l=i+(r.validEnd?"*":" ")+" ";for(let a=0;a"+e.indexOf(r.next[a].next);return l}).join(` -`)}};u(Yp,"ContentMatch");let Pl=Yp;Pl.empty=new Pl(!0);const d$=class d${constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};u(d$,"TokenStream");let Py=d$;function O8(t){let e=[];do e.push(XG(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}u(O8,"parseExpr");function XG(t){let e=[];do e.push(jG(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}u(XG,"parseExprSeq");function jG(t){let e=YG(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=qG(t,e);else break;return e}u(jG,"parseExprSubscript");function b8(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}u(b8,"parseNum");function qG(t,e){let n=b8(t),r=n;return t.eat(",")&&(t.next!="}"?r=b8(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}u(qG,"parseExprRange");function WG(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let l in n){let a=n[l];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}u(WG,"resolveName");function YG(t){if(t.eat("(")){let e=O8(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=WG(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}u(YG,"parseExprAtom");function KG(t){let e=[[]];return i(l(t,0),n()),e;function n(){return e.push([])-1}u(n,"node");function r(a,o,s){let c={term:s,to:o};return e[a].push(c),c}u(r,"edge");function i(a,o){a.forEach(s=>s.to=o)}u(i,"connect");function l(a,o){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(l(c,o)),[]);if(a.type=="seq")for(let s=0;;s++){let c=l(a.exprs[s],o);if(s==a.exprs.length-1)return c;i(c,o=n())}else if(a.type=="star"){let s=n();return r(o,s),i(l(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(l(a.expr,o),s),i(l(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(o)].concat(l(a.expr,o));if(a.type=="range"){let s=o;for(let c=0;c{t[a].forEach(({term:o,to:s})=>{if(!o)return;let c;for(let d=0;d{c||i.push([o,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let l=e[r.join(",")]=new Pl(r.indexOf(t.length-1)>-1);for(let a=0;a-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:w8(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Dl(this,this.computeAttrs(e),j.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=j.from(n),this.checkContent(n),new Dl(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=j.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),l=i&&i.fillBefore(j.empty,!0);return l?new Dl(this,e,n.append(l),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[l]=new Ao(l,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let l in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}},u(Ao,"NodeType"),Ao);function _G(t,e,n){let r=n.split("|");return i=>{let l=i===null?"null":typeof i;if(r.indexOf(l)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${l}`)}}u(_G,"validateType");const f$=class f${constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?_G(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}};u(f$,"Attribute");let Ey=f$;const Kp=class Kp{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=S8(e,i.attrs),this.excluded=null;let l=$8(this.attrs);this.instance=l?new ye(this,l):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,w8(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((l,a)=>r[l]=new Kp(l,i++,n,a)),r}removeFromSet(e){for(var n=0;n-1}};u(Kp,"MarkType");let Ah=Kp;const h$=class h${constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=lt.from(e.nodes),n.marks=lt.from(e.marks||{}),this.nodes=C8.compile(this.spec.nodes,this),this.marks=Ah.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let l=this.nodes[i],a=l.spec.content||"",o=l.spec.marks;if(l.contentMatch=r[a]||(r[a]=Pl.parse(a,this.nodes)),l.inlineContent=l.contentMatch.inlineContent,l.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!l.isInline||!l.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=l}l.markSet=o=="_"?null:o?k8(this,o.split(" ")):o==""||!l.inlineContent?[]:null}for(let i in this.marks){let l=this.marks[i],a=l.spec.excludes;l.excluded=a==null?[l]:a==""?[]:k8(this,a.split(" "))}this.nodeFromJSON=i=>Dl.fromJSON(this,i),this.markFromJSON=i=>ye.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof C8){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Dy(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};u(h$,"Schema");let Qh=h$;function k8(t,e){let n=[];for(let r=0;r-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}u(k8,"gatherMarks");function HG(t){return t.tag!=null}u(HG,"isTagRule");function JG(t){return t.style!=null}u(JG,"isStyleRule");const Pc=class Pc{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(HG(i))this.tags.push(i);else if(JG(i)){let l=/[^=]*/.exec(i.style)[0];r.indexOf(l)<0&&r.push(l),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let l=e.nodes[i.node];return l.contentMatch.matchType(l)})}parse(e,n={}){let r=new Mh(this,n,!1);return r.addAll(e,ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Mh(this,n,!0);return r.addAll(e,ye.none,n.from,n.to),H.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(e){let n=[];function r(i){let l=i.priority==null?50:i.priority,a=0;for(;a{r(a=T8(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let l=e.nodes[i].spec.parseDOM;l&&l.forEach(a=>{r(a=T8(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Pc(e,Pc.schemaRules(e)))}};u(Pc,"DOMParser");let Cu=Pc;const D8={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},e_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},P8={ol:!0,ul:!0},ku=1,Ty=2,Du=4;function E8(t,e,n){return e!=null?(e?ku:0)|(e==="full"?Ty:0):t&&t.whitespace=="pre"?ku|Ty:n&~Du}u(E8,"wsOptionsFor");const p$=class p${constructor(e,n,r,i,l,a){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=ye.none,this.match=l||(a&Du?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(j.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ku)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let l=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=l.withText(l.text.slice(0,l.text.length-i[0].length))}}let n=j.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!D8.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}};u(p$,"NodeContext");let no=p$;const m$=class m${constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,l,a=E8(null,n.preserveWhitespace,0)|(r?Du:0);i?l=new no(i.type,i.attrs,ye.none,!0,n.topMatch||i.type.contentMatch,a):r?l=new no(null,null,ye.none,!0,null,a):l=new no(e.schema.topNodeType,null,ye.none,!0,null,a),this.nodes=[l],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,l=i.options&Ty?"full":this.localPreserveWS||(i.options&ku)>0;if(l==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(l)l!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` -`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],o=e.previousSibling;(!a||o&&o.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,l=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;P8.hasOwnProperty(a)&&this.parser.normalizeLists&&t_(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(s?s.ignore:e_.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let c,d=this.needsBlock;if(D8.hasOwnProperty(a))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),c=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=s&&s.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(l),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,s,c,s.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!s.clearMark(c)):n=n.concat(this.parser.schema.marks[s.mark].create(s.attrs)),s.consuming===!1)o=s;else break}}return n}addElementByRule(e,n,r,i){let l,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let s=this.enter(a,n.attrs||null,r,n.preserveWhitespace);s&&(l=!0,r=s)}else{let s=this.parser.schema.marks[n.mark];r=r.concat(s.create(n.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(s=>this.insertNode(s,r,!1));else{let s=e;typeof n.contentElement=="string"?s=e.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(e):n.contentElement&&(s=n.contentElement),this.findAround(e,s,!0),this.addAll(s,r),this.findAround(e,s,!1)}l&&this.sync(o)&&this.open--}addAll(e,n,r,i){let l=r||0;for(let a=r?e.childNodes[r]:e.firstChild,o=i==null?null:e.childNodes[i];a!=o;a=a.nextSibling,++l)this.findAtPoint(e,l),this.addDOM(a,n);this.findAtPoint(e,l)}findPlace(e,n,r){let i,l;for(let a=this.open,o=0;a>=0;a--){let s=this.nodes[a],c=s.findWrapping(e);if(c&&(!i||i.length>c.length+o)&&(i=c,l=s,!c.length))break;if(s.solid){if(r)break;o+=2}}if(!i)return null;this.sync(l);for(let a=0;a(a.type?a.type.allowsMarkType(c.type):A8(c.type,e))?(s=c.addToSet(s),!1):!0),this.nodes.push(new no(e,n,s,i,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ku)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),l=-(r?r.depth+1:0)+(i?0:1),a=u((o,s)=>{for(;o>=0;o--){let c=n[o];if(c==""){if(o==n.length-1||o==0)continue;for(;s>=l;s--)if(a(o-1,s))return!0;return!1}else{let d=s>0||s==0&&i?this.nodes[s].type:r&&s>=l?r.node(s-l).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;s--}}return!0},"match");return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};u(m$,"ParseContext");let Mh=m$;function t_(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&P8.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}u(t_,"normalizeList");function n_(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}u(n_,"matches");function T8(t){let e={};for(let n in t)e[n]=t[n];return e}u(T8,"copy");function A8(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let l=[],a=u(o=>{l.push(o);for(let s=0;s{if(l.length||a.marks.length){let o=0,s=0;for(;o=0;i--){let l=this.serializeMark(e.marks[i],e.isInline,n);l&&((l.contentDOM||l.dom).appendChild(r),r=l.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Bh(Ay(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Bh(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Up(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Q8(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Q8(e.marks)}};u(Up,"DOMSerializer");let ro=Up;function Q8(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}u(Q8,"gatherToDOM");function Ay(t){return t.document||window.document}u(Ay,"doc$1");const M8=new WeakMap;function r_(t){let e=M8.get(t);return e===void 0&&M8.set(t,e=i_(t)),e}u(r_,"suspiciousAttributes");function i_(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let o,s=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let h=f.indexOf(" ");h>0?s.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):f=="style"&&s.style?s.style.cssText=c[f]:s.setAttribute(f,c[f])}}for(let f=d;fd)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:m}=Bh(t,h,n,r);if(s.appendChild(p),m){if(o)throw new RangeError("Multiple content holes");o=m}}}return{dom:s,contentDOM:o}}u(Bh,"renderSpec");const B8=65535,R8=Math.pow(2,16);function l_(t,e){return t+e*R8}u(l_,"makeRecover");function V8(t){return t&B8}u(V8,"recoverIndex");function a_(t){return(t-(t&B8))/R8}u(a_,"recoverOffset");const N8=1,F8=2,Rh=4,I8=8,g$=class g${constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&I8)>0}get deletedBefore(){return(this.delInfo&(N8|Rh))>0}get deletedAfter(){return(this.delInfo&(F8|Rh))>0}get deletedAcross(){return(this.delInfo&Rh)>0}};u(g$,"MapResult");let Pu=g$;const Ii=class Ii{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ii.empty)return Ii.empty}recover(e){let n=0,r=V8(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[o+l],d=this.ranges[o+a],f=s+c;if(e<=f){let h=c?e==s?-1:e==f?1:n:n,p=s+i+(h<0?0:d);if(r)return p;let m=e==(n<0?s:f)?null:l_(o/3,e-s),g=e==s?F8:e==f?N8:Rh;return(n<0?e!=s:e!=f)&&(g|=I8),new Pu(p,g,m)}i+=d-c}return r?e+i:new Pu(e+i,0,null)}touches(e,n){let r=0,i=V8(n),l=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;oe)break;let c=this.ranges[o+l],d=s+c;if(e<=d&&o==i*3)return!0;r+=this.ranges[o+a]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,l=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Ec;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;rl&&s!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,l)}invert(){return new El(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ea(n.pos,r.pos,this.mark)}merge(e){return e instanceof ea&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ea(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ea(n.from,n.to,e.markFromJSON(n.mark))}};u(ea,"AddMarkStep");let Eu=ea;Je.jsonID("addMark",Eu);const ta=class ta extends Je{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new H(My(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,r)}invert(){return new Eu(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ta(n.pos,r.pos,this.mark)}merge(e){return e instanceof ta&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ta(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ta(n.from,n.to,e.markFromJSON(n.mark))}};u(ta,"RemoveMarkStep");let El=ta;Je.jsonID("removeMark",El);const na=class na extends Je{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return at.fromReplace(e,this.pos,this.pos+1,new H(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Qo(n.pos,r.pos,i,l,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Qo(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}};u(Qo,"ReplaceAroundStep");let Pt=Qo;Je.jsonID("replaceAround",Pt);function By(t,e,n){let r=t.resolve(e),i=n-e,l=r.depth;for(;i>0&&l>0&&r.indexAfter(l)==r.node(l).childCount;)l--,i--;if(i>0){let a=r.node(l).maybeChild(r.indexAfter(l));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}u(By,"contentBetween");function o_(t,e,n,r){let i=[],l=[],a,o;t.doc.nodesBetween(e,n,(s,c,d)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let h=Math.max(c,e),p=Math.min(c+s.nodeSize,n),m=r.addToSet(f);for(let g=0;gt.step(s)),l.forEach(s=>t.step(s))}u(o_,"addMark");function s_(t,e,n,r){let i=[],l=0;t.doc.nodesBetween(e,n,(a,o)=>{if(!a.isInline)return;l++;let s=null;if(r instanceof Ah){let c=a.marks,d;for(;d=r.isInSet(c);)(s||(s=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(o+a.nodeSize,n);for(let d=0;dt.step(new El(a.from,a.to,a.style)))}u(s_,"removeMark");function Ry(t,e,n,r=n.contentMatch,i=!0){let l=t.doc.nodeAt(e),a=[],o=e+1;for(let s=0;s=0;s--)t.step(a[s])}u(Ry,"clearIncompatible");function u_(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}u(u_,"canCut");function Au(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),l=t.$from.index(r),a=t.$to.indexAfter(r);if(rn;m--)g||r.index(m)>0?(g=!0,d=j.from(r.node(m).copy(d)),f++):s--;let h=j.empty,p=0;for(let m=l,g=!1;m>n;m--)g||i.after(m+1)=0;a--){if(r.size){let o=n[a].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=j.from(n[a].type.create(n[a].attrs,r))}let i=e.start,l=e.end;t.step(new Pt(i,l,i,l,new H(r,0,0),n.length,!0))}u(h_,"wrap");function p_(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=t.steps.length;t.doc.nodesBetween(e,n,(a,o)=>{let s=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,s)&&m_(t.doc,t.mapping.slice(l).map(o),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}c===!1&&Z8(t,a,o,l),Ry(t,t.mapping.slice(l).map(o,1),r,void 0,c===null);let d=t.mapping.slice(l),f=d.map(o,1),h=d.map(o+a.nodeSize,1);return t.step(new Pt(f,h,f+1,h-1,new H(j.from(r.create(s,null,a.marks)),0,0),1,!0)),c===!0&&z8(t,a,o,l),!1}})}u(p_,"setBlockType$1");function z8(t,e,n,r){e.forEach((i,l)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let s=t.mapping.slice(r).map(n+1+l+a.index);t.replaceWith(s,s+1,e.type.schema.linebreakReplacement.create())}}})}u(z8,"replaceNewlines");function Z8(t,e,n,r){e.forEach((i,l)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+l);t.replaceWith(a,a+1,e.type.schema.text(` -`))}})}u(Z8,"replaceLinebreaks");function m_(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}u(m_,"canChangeType");function g_(t,e,n,r,i){let l=t.doc.nodeAt(e);if(!l)throw new RangeError("No node at given position");n||(n=l.type);let a=n.create(r,null,i||l.marks);if(l.isLeaf)return t.replaceWith(e,e+l.nodeSize,a);if(!n.validContent(l.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Pt(e,e+l.nodeSize,e+1,e+l.nodeSize-1,new H(j.from(a),0,0),1,!0))}u(g_,"setNodeMarkup");function lo(t,e,n=1,r){let i=t.resolve(e),l=i.depth-n,a=r&&r[r.length-1]||i.parent;if(l<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>l;c--,d--){let f=i.node(c),h=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let o=i.indexAfter(l),s=r&&r[0];return i.node(l).canReplaceWith(o,o,s?s.type:i.node(l+1).type)}u(lo,"canSplit");function O_(t,e,n=1,r){let i=t.doc.resolve(e),l=j.empty,a=j.empty;for(let o=i.depth,s=i.depth-n,c=n-1;o>s;o--,c--){l=j.from(i.node(o).copy(l));let d=r&&r[c];a=j.from(d?d.type.create(d.attrs,a):i.node(o).copy(a))}t.step(new Nn(e,e,new H(l.append(a),n,n),!0))}u(O_,"split");function ao(t,e){let n=t.resolve(e),r=n.index();return X8(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}u(ao,"canJoin");function b_(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(l=r.node(i+1),o++,a=r.node(i).maybeChild(o)):(l=r.node(i).maybeChild(o-1),a=r.node(i+1)),l&&!l.isTextblock&&X8(l,a)&&r.node(i).canReplace(o,o+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}u(j8,"joinPoint");function y_(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,l=t.doc.resolve(e-n),a=l.node().type;if(i&&a.inlineContent){let d=a.whitespace=="pre",f=!!a.contentMatch.matchType(i);d&&!f?r=!1:!d&&f&&(r=!0)}let o=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Z8(t,d.node(),d.before(),o)}a.inlineContent&&Ry(t,e+n-1,a,l.node().contentMatchAt(l.index()),r==null);let s=t.mapping.slice(o),c=s.map(e-n);if(t.step(new Nn(c,s.map(e+n,-1),H.empty,!0)),r===!0){let d=t.doc.resolve(c);z8(t,d.node(),d.before(),t.steps.length)}return t}u(y_,"join");function v_(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let l=r.index(i);if(r.node(i).canReplaceWith(l,l,n))return r.before(i+1);if(l>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let l=r.indexAfter(i);if(r.node(i).canReplaceWith(l,l,n))return r.after(i+1);if(l=0;a--){let o=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(o>0?1:0),c=r.node(a),d=!1;if(l==1)d=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);d=f&&c.canReplaceWith(s,s,f[0])}if(d)return o==0?r.pos:o<0?r.before(a+1):r.after(a+1)}return null}u(q8,"dropPoint");function Ny(t,e,n=e,r=H.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),l=t.resolve(n);return W8(i,l,r)?new Nn(e,n,r):new Fy(i,l,r).fit()}u(Ny,"replaceStep");function W8(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}u(W8,"fitsTrivially");const b$=class b${constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=j.empty;for(let i=0;i<=e.depth;i++){let l=e.node(i);this.frontier.push({type:l.type,match:l.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=j.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let l=this.placed,a=r.depth,o=i.depth;for(;a&&o&&l.childCount==1;)l=l.firstChild.content,a--,o--;let s=new H(l,a,o);return e>-1?new Pt(r.pos,e,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new Nn(r.pos,i.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),l.type.spec.isolating&&i<=r){e=r;break}n=l.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,l=null;r?(l=Iy(this.unplaced.content,r-1).firstChild,i=l.content):i=this.unplaced.content;let a=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:c}=this.frontier[o],d,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(j.from(a),!1)):l&&s.compatibleContent(l.type)))return{sliceDepth:r,frontierDepth:o,parent:l,inject:f};if(n==2&&a&&(d=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:o,parent:l,wrap:d};if(l&&c.matchType(l.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Iy(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new H(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Iy(e,n);if(i.childCount<=1&&n>0){let l=e.size-n<=n+i.size;this.unplaced=new H(Qu(e,n-1,1),n-1,l?n-1:r)}else this.unplaced=new H(Qu(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:l}){for(;this.depth>n;)this.closeFrontierNode();if(l)for(let g=0;g1||s==0||g.content.size)&&(f=O,d.push(Y8(g.mark(h.allowedMarks(g.marks)),c==1?s:0,c==o.childCount?p:-1)))}let m=c==o.childCount;m||(p=-1),this.placed=Mu(this.placed,n,j.from(d)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,O=o;g1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],l=n=0;o--){let{match:s,type:c}=this.frontier[o],d=Ly(e,o,c,s,!0);if(!d||d.childCount)continue e}return{depth:n,fit:a,move:l?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Mu(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),l=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,l)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Mu(this.placed,this.depth,j.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(j.empty,!0);n.childCount&&(this.placed=Mu(this.placed,this.frontier.length,n))}};u(b$,"Fitter");let Fy=b$;function Qu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Qu(t.firstChild.content,e-1,n)))}u(Qu,"dropFromFragment");function Mu(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Mu(t.lastChild.content,e-1,n)))}u(Mu,"addToFragment");function Iy(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Y8(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(j.empty,!0)))),t.copy(r)}u(Y8,"closeNodeStart");function Ly(t,e,n,r,i){let l=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==l.childCount&&!n.compatibleContent(l.type))return null;let o=r.fillBefore(l.content,!0,a);return o&&!$_(n,l.content,a)?o:null}u(Ly,"contentAfterFits");function $_(t,e,n){for(let r=n;r0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(h)>-1?o=h:i.before(h)==p&&a.splice(1,0,-h)}let s=a.indexOf(o),c=[],d=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(c.push(m),p==r.openStart)break;h=m.content}for(let h=d-1;h>=0;h--){let p=c[h],m=w_(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(o)-1)))d=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+d+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=a[h];p<0||(e=i.before(p),n=l.after(p))}}u(x_,"replaceRange");function K8(t,e,n,r,i){if(er){let l=i.contentMatchAt(0),a=l.fillBefore(t).append(t);t=a.append(l.matchFragment(a).fillBefore(j.empty,!0))}return t}u(K8,"closeFragment");function S_(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=v_(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new H(j.from(r),0,0))}u(S_,"replaceRangeWith");function C_(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),l=U8(r,i);for(let a=0;a0&&(s||r.node(o-1).canReplace(r.index(o-1),i.indexAfter(o-1))))return t.delete(r.before(o),i.after(o))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}u(C_,"deleteRange");function U8(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let l=t.start(i);if(le.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(l==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==l-1)&&n.push(i)}return n}u(U8,"coveredDepths");const Mo=class Mo extends Je{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at attribute step's position");let r=Object.create(null);for(let l in n.attrs)r[l]=n.attrs[l];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return at.fromReplace(e,this.pos,this.pos+1,new H(j.from(i),0,n.isLeaf?0:1))}getMap(){return Xr.empty}invert(e){return new Mo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mo(n.pos,n.attr,n.value)}};u(Mo,"AttrStep");let Nh=Mo;Je.jsonID("attr",Nh);const Ac=class Ac extends Je{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return at.ok(r)}getMap(){return Xr.empty}invert(e){return new Ac(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ac(n.attr,n.value)}};u(Ac,"DocAttrStep");let Fh=Ac;Je.jsonID("docAttr",Fh);let oo=(Qc=class extends Error{},u(Qc,"TransformError"),Qc);oo=u(function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},"TransformError"),oo.prototype=Object.create(Error.prototype),oo.prototype.constructor=oo,oo.prototype.name="TransformError";const y$=class y${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Vh}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new oo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=H.empty){let i=Ny(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new H(j.from(r),0,0))}delete(e,n){return this.replace(e,n,H.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return x_(this,e,n,r),this}replaceRangeWith(e,n,r){return S_(this,e,n,r),this}deleteRange(e,n){return C_(this,e,n),this}lift(e,n){return c_(this,e,n),this}join(e,n=1){return y_(this,e,n),this}wrap(e,n){return h_(this,e,n),this}setBlockType(e,n=e,r,i=null){return p_(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return g_(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Nh(e,n,r)),this}setDocAttribute(e,n){return this.step(new Fh(e,n)),this}addNodeMark(e,n){return this.step(new Tu(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof ye)n.isInSet(r.marks)&&this.step(new io(e,n));else{let i=r.marks,l,a=[];for(;l=n.isInSet(i);)a.push(new io(e,l)),i=l.removeFromSet(i);for(let o=a.length-1;o>=0;o--)this.step(a[o])}return this}split(e,n=1,r){return O_(this,e,n,r),this}addMark(e,n,r){return o_(this,e,n,r),this}removeMark(e,n,r){return s_(this,e,n,r),this}clearIncompatible(e,n,r){return Ry(this,e,n,r),this}};u(y$,"Transform");let zy=y$;const Zy=Object.create(null),v$=class v${constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Bu(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;l--){let a=n<0?so(e.node(0),e.node(l),e.before(l+1),e.index(l),n,r):so(e.node(0),e.node(l),e.after(l+1),e.index(l)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Fn(e.node(0))}static atStart(e){return so(e,e,0,0,1)||new Fn(e)}static atEnd(e){return so(e,e,e.content.size,e.childCount,-1)||new Fn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Zy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zy[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}};u(v$,"Selection");let de=v$;de.prototype.visible=!0;const $$=class $${constructor(e,n){this.$from=e,this.$to=n}};u($$,"SelectionRange");let Bu=$$,G8=!1;function _8(t){!G8&&!t.parent.inlineContent&&(G8=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}u(_8,"checkTextSelection");const ra=class ra extends de{constructor(e,n=e){_8(e),_8(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return de.near(r);let i=e.resolve(n.map(this.anchor));return new ra(i.parent.inlineContent?i:r,r)}replace(e,n=H.empty){if(super.replace(e,n),n==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ra&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ih(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ra(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let l=de.findFrom(n,r,!0)||de.findFrom(n,-r,!0);if(l)n=l.$head;else return de.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(de.findFrom(e,-r,!0)||de.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?a=0;a+=i){let o=e.child(a);if(o.isAtom){if(!l&&ae.isSelectable(o))return ae.create(t,n-(i<0?o.nodeSize:0))}else{let s=so(t,o,n+i,i<0?o.childCount:0,i,l);if(s)return s}n+=o.nodeSize*i}return null}u(so,"findSelectionIn");function H8(t,e,n){let r=t.steps.length-1;if(r{a==null&&(a=d)}),t.setSelection(de.near(t.doc.resolve(a),n))}u(H8,"selectionToInsertionEnd");const J8=1,Lh=2,eM=4,w$=class w$ extends zy{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Lh,this}ensureMarks(e){return ye.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Lh)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Lh,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ye.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let l=this.storedMarks;if(!l){let a=this.doc.resolve(n);l=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,l)),this.selection.empty||this.setSelection(de.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=eM,this}get scrolledIntoView(){return(this.updated&eM)>0}};u(w$,"Transaction");let jy=w$;function tM(t,e){return!e||!t?t:t.bind(e)}u(tM,"bind");const x$=class x${constructor(e,n,r){this.name=e,this.init=tM(n.init,r),this.apply=tM(n.apply,r)}};u(x$,"FieldDesc");let Tl=x$;const D_=[new Tl("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Tl("selection",{init(t,e){return t.selection||de.atStart(e.doc)},apply(t){return t.selection}}),new Tl("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Tl("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],S$=class S${constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=D_.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Tl(r.key,r.spec.state,r))})}};u(S$,"Configuration");let Ru=S$;const la=class la{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],l=i.spec.state;l&&l.toJSON&&(n[r]=l.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Ru(e.schema,e.plugins),l=new la(i);return i.fields.forEach(a=>{if(a.name=="doc")l.doc=Dl.fromJSON(e.schema,n.doc);else if(a.name=="selection")l.selection=de.fromJSON(l.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(l.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let o in r){let s=r[o],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,o)){l[a.name]=c.fromJSON.call(s,e,n[o],l);return}}l[a.name]=a.init(e,l)}}),l}};u(la,"EditorState");let qy=la;function nM(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=nM(i,e,{})),n[r]=i}return n}u(nM,"bindProps");const C$=class C${constructor(e){this.spec=e,this.props={},e.props&&nM(e.props,this,this.props),this.key=e.key?e.key.key:rM("plugin")}getState(e){return e[this.key]}};u(C$,"Plugin");let jr=C$;const Wy=Object.create(null);function rM(t){return t in Wy?t+"$"+ ++Wy[t]:(Wy[t]=0,t+"$")}u(rM,"createKey");const k$=class k${constructor(e="key"){this.key=rM(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};u(k$,"PluginKey");let zh=k$;const ot=u(function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},"domIndex"),uo=u(function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},"parentNode");let Yy=null;const qr=u(function(t,e,n){let r=Yy||(Yy=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},"textRange"),P_=u(function(){Yy=null},"clearReusedRange"),Al=u(function(t,e,n,r){return n&&(iM(t,e,n,r,-1)||iM(t,e,n,r,1))},"isEquivalentPosition"),E_=/^(img|br|input|textarea|hr)$/i;function iM(t,e,n,r,i){for(var l;;){if(t==n&&e==r)return!0;if(e==(i<0?0:wn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Vu(t)||E_.test(t.nodeName)||t.contentEditable=="false")return!1;e=ot(t)+(i<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((l=a.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)e+=i;else return!1;else t=a,e=i<0?wn(t):0}else return!1}}u(iM,"scanFor");function wn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}u(wn,"nodeSize");function T_(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=wn(t)}else if(t.parentNode&&!Vu(t))e=ot(t),t=t.parentNode;else return null}}u(T_,"textNodeBefore$1");function A_(t,e){for(;;){if(t.nodeType==3&&e2),Sn=co||(cr?/Mac/.test(cr.platform):!1),R_=cr?/Win/.test(cr.platform):!1,Wr=/Android \d/.test(Ai),Nu=!!lM&&"webkitFontSmoothing"in lM.documentElement.style,V_=Nu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function N_(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}u(N_,"windowRect");function Yr(t,e){return typeof t=="number"?t:t[e]}u(Yr,"getSide");function F_(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}u(F_,"clientRect");function sM(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,l=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=uo(a);continue}let o=a,s=o==l.body,c=s?N_(l):F_(o),d=0,f=0;if(e.topc.bottom-Yr(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Yr(i,"top")-c.top:e.bottom-c.bottom+Yr(i,"bottom")),e.leftc.right-Yr(r,"right")&&(d=e.right-c.right+Yr(i,"right")),d||f)if(s)l.defaultView.scrollBy(d,f);else{let p=o.scrollLeft,m=o.scrollTop;f&&(o.scrollTop+=f),d&&(o.scrollLeft+=d);let g=o.scrollLeft-p,O=o.scrollTop-m;e={left:e.left-g,top:e.top-O,right:e.right-g,bottom:e.bottom-O}}let h=s?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(h))break;a=h=="absolute"?a.offsetParent:uo(a)}}u(sM,"scrollRectIntoView");function I_(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let l=(e.left+e.right)/2,a=n+1;a=n-20){r=o,i=s.top;break}}return{refDOM:r,refTop:i,stack:uM(t.dom)}}u(I_,"storeScrollPos");function uM(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=uo(r));return e}u(uM,"scrollStack");function L_({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;cM(n,r==0?0:r-e)}u(L_,"resetScrollPos");function cM(t,e){for(let n=0;n=o){a=Math.max(m.bottom,a),o=Math.min(m.top,o);let g=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!s&&m.left<=e.left&&m.right>=e.left&&(s=d,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(l=f+1)}}return!n&&s&&(n=s,i=c,r=0),n&&n.nodeType==3?Z_(n,i):!n||r&&n.nodeType==1?{node:t,offset:l}:dM(n,i)}u(dM,"findOffsetInNode");function Z_(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(l.left+l.right)/2?1:0)}}return{node:t,offset:0}}u(Z_,"findOffsetInText");function _y(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}u(_y,"inRect");function X_(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,i,l)}u(j_,"posFromElement");function q_(t,e,n,r){let i=-1;for(let l=e,a=!1;l!=t.dom;){let o=t.docView.nearestDesc(l,!0),s;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((s=o.dom.getBoundingClientRect()).width||s.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!a&&s.left>r.left||s.top>r.top?i=o.posBefore:(!a&&s.right-1?i:t.docView.posFromDOM(e,n,-1)}u(q_,"posFromCaret");function fM(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let c;Nu&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(o=q_(t,r,i,e))}o==null&&(o=j_(t,a,e));let s=t.docView.nearestDesc(a,!0);return{pos:o,inside:s?s.posAtStart-s.border:-1}}u(W_,"posAtCoords");function hM(t){return t.top=0&&i==r.nodeValue.length?(s--,d=1):n<0?s--:c++,Fu(Mi(qr(r,s,c),d),d<0)}if(!t.state.doc.resolve(e-(l||0)).parent.inlineContent){if(l==null&&i&&(n<0||i==wn(r))){let s=r.childNodes[i-1];if(s.nodeType==1)return Hy(s.getBoundingClientRect(),!1)}if(l==null&&i=0)}if(l==null&&i&&(n<0||i==wn(r))){let s=r.childNodes[i-1],c=s.nodeType==3?qr(s,wn(s)-(a?0:1)):s.nodeType==1&&(s.nodeName!="BR"||!s.nextSibling)?s:null;if(c)return Fu(Mi(c,1),!1)}if(l==null&&i=0)}u(pM,"coordsAtPos");function Fu(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}u(Fu,"flattenV");function Hy(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}u(Hy,"flattenH");function mM(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}u(mM,"withFlushedState");function K_(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return mM(t,e,()=>{let{node:l}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let o=t.docView.nearestDesc(l,!0);if(!o)break;if(o.node.isBlock){l=o.contentDOM||o.dom;break}l=o.dom.parentNode}let a=pM(t,i.pos,1);for(let o=l.firstChild;o;o=o.nextSibling){let s;if(o.nodeType==1)s=o.getClientRects();else if(o.nodeType==3)s=qr(o,0,o.nodeValue.length).getClientRects();else continue;for(let c=0;cd.top+1&&(n=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}u(K_,"endOfTextblockVertical");const U_=/[\u0590-\u08ac]/;function G_(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,l=!i,a=i==r.parent.content.size,o=t.domSelection();return o?!U_.test(r.parent.textContent)||!o.modify?n=="left"||n=="backward"?l:a:mM(t,e,()=>{let{focusNode:s,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),h=o.caretBidiLevel;o.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),O=m&&!p.contains(m.nodeType==1?m:m.parentNode)||s==m&&c==g;try{o.collapse(d,f),s&&(s!=d||c!=f)&&o.extend&&o.extend(s,c)}catch{}return h!=null&&(o.caretBidiLevel=h),O}):r.pos==r.start()||r.pos==r.end()}u(G_,"endOfTextblockHorizontal");let gM=null,OM=null,bM=!1;function __(t,e,n){return gM==e&&OM==n?bM:(gM=e,OM=n,bM=n=="up"||n=="down"?K_(t,e,n):G_(t,e,n))}u(__,"endOfTextblock");const Cn=0,yM=1,Ml=2,dr=3,D$=class D${constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Cn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;not(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let l=e;;l=l.parentNode){if(l==this.dom){i=!1;break}if(l.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let l=e;;l=l.parentNode){if(l==this.dom){i=!0;break}if(l.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let l=this.getDesc(i),a;if(l&&(!n||l.node))if(r&&(a=l.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return l}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let l=this.getDesc(i);if(l)return l.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||a instanceof qh){i=e-l;break}l=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let l;r&&!(l=this.children[r-1]).size&&l instanceof Xh&&l.side>=0;r--);if(n<=0){let l,a=!0;for(;l=r?this.children[r-1]:null,!(!l||l.dom.parentNode==this.contentDOM);r--,a=!1);return l&&n&&a&&!l.border&&!l.domAtom?l.domFromPos(l.size,n):{node:this.contentDOM,offset:l?ot(l.dom)+1:0}}else{let l,a=!0;for(;l=r=d&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,n,d);e=a;for(let f=o;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ot(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(c>n||o==this.children.length-1)){n=c;for(let d=o+1;dm&&an){let m=o;o=s,s=m}let p=document.createRange();p.setEnd(s.node,s.offset),p.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let o=r+l.border,s=a-l.border;if(e>=o&&n<=s){this.dirty=e==r||n==a?Ml:yM,e==o&&n==s&&(l.contentLost||l.dom.parentNode!=this.contentDOM)?l.dirty=dr:l.markDirty(e-o,n-o);return}else l.dirty=l.dom==l.contentDOM&&l.dom.parentNode==this.contentDOM&&!l.children.length?Ml:dr}r=a}this.dirty=Ml}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ml:yM;n.dirty{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)})),!n.type.spec.raw){if(a.nodeType!=1){let o=document.createElement("span");o.appendChild(a),a=o}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,l=this}matchesWidget(e){return this.dirty==Cn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}};u(P$,"WidgetViewDesc");let Xh=P$;const E$=class E$ extends Bl{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}};u(E$,"CompositionViewDesc");let Jy=E$;const Mc=class Mc extends Bl{constructor(e,n,r,i,l){super(e,[],r,i),this.mark=n,this.spec=l}static create(e,n,r,i){let l=i.nodeViews[n.type.name],a=l&&l(n,i,r);return(!a||!a.dom)&&(a=ro.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Mc(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&dr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=dr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Cn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(l=r1(l,0,e,r));for(let o=0;o{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),d=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=ro.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let h=d;return d=xM(d,r,n),c?s=new e1(e,n,r,i,d,f||null,h,c,l,a+1):n.isText?new jh(e,n,r,i,d,h,l):new Hp(e,n,r,i,d,f||null,h,l,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>j.empty)}return e}matchesNode(e,n,r){return this.dirty==Cn&&e.eq(this.node)&&Wh(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,l=e.composing?this.localCompositionInfo(e,n):null,a=l&&l.pos>-1?l:null,o=l&&l.pos<0,s=new n1(this,a&&a.node,e);tH(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&s.syncToMarks(d==this.node.childCount?ye.none:this.node.child(d).marks,r,e),s.placeWidget(c,e,i)},(c,d,f,h)=>{s.syncToMarks(c.marks,r,e);let p;s.findNodeMatch(c,d,f,h)||o&&e.state.selection.from>i&&e.state.selection.to-1&&s.updateNodeAt(c,d,f,p,e)||s.updateNextNode(c,d,f,e,h,i)||s.addNode(c,d,f,e,i),i+=c.nodeSize}),s.syncToMarks([],r,e),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Ml)&&(a&&this.protectLocalComposition(e,a),$M(this.contentDOM,this.children,e),co&&nH(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ke)||rn+this.node.content.size)return null;let l=e.input.compositionNode;if(!l||!this.dom.contains(l.parentNode))return null;if(this.node.inlineContent){let a=l.nodeValue,o=rH(this.node.content,a,r-n,i-n);return o<0?null:{node:l,pos:o,text:a}}else return{node:l,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let l=n;for(;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=void 0)}let a=new Jy(this,l,n,i);e.input.compositionNodes.push(a),this.children=r1(this.children,r,r+i.length,e,a)}update(e,n,r,i){return this.dirty==dr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Cn}updateOuterDeco(e){if(Wh(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=wM(this.dom,this.nodeDOM,t1(this.outerDeco,this.node,n),t1(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};u(Hp,"NodeViewDesc");let Bi=Hp;function vM(t,e,n,r,i){xM(r,e,t);let l=new Bi(void 0,t,e,n,r,r,r,i,0);return l.contentDOM&&l.updateChildren(i,0),l}u(vM,"docViewDesc");const Jp=class Jp extends Bi{constructor(e,n,r,i,l,a,o){super(e,n,r,i,l,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==dr||this.dirty!=Cn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Cn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Cn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),l=document.createTextNode(i.text);return new Jp(this.parent,i,this.outerDeco,this.innerDeco,l,l,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=dr)}get domAtom(){return!1}isText(e){return this.node.text==e}};u(Jp,"TextViewDesc");let jh=Jp;const T$=class T$ extends Bl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Cn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}};u(T$,"TrailingHackViewDesc");let qh=T$;const A$=class A$ extends Bi{constructor(e,n,r,i,l,a,o,s,c,d){super(e,n,r,i,l,a,o,c,d),this.spec=s}update(e,n,r,i){if(this.dirty==dr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let l=this.spec.update(e,n,r);return l&&this.updateInner(e,n,r,i),l}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};u(A$,"CustomNodeViewDesc");let e1=A$;function $M(t,e,n){let r=t.firstChild,i=!1;for(let l=0;l>1,a=Math.min(l,e.length);for(;i-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let s=ho.create(this.top,e[l],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,l++}}findNodeMatch(e,n,r,i){let l=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))l=this.top.children.indexOf(a,this.index);else for(let o=this.index,s=Math.min(this.top.children.length,o+5);o0;){let o;for(;;)if(r){let c=n.children[r-1];if(c instanceof ho)n=c,r=c.children.length;else{o=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=o.node;if(s){if(s!=t.child(i-1))break;--i,l.set(o,i),a.push(o)}}return{index:i,matched:l,matches:a.reverse()}}u(J_,"preMatch");function eH(t,e){return t.type.side-e.type.side}u(eH,"compareSide");function tH(t,e,n,r){let i=e.locals(t),l=0;if(i.length==0){for(let c=0;cl;)o.push(i[a++]);let m=l+h.nodeSize;if(h.isText){let O=m;a!O.inline):o.slice();r(h,g,e.forChild(l,h),p),l=m}}u(tH,"iterDeco");function nH(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}u(nH,"iosHacks");function rH(t,e,n,r){for(let i=0,l=0;i=n){if(l>=r&&s.slice(r-e.length-o,r-o)==e)return r-e.length;let c=o=0&&c+e.length+o>=n)return o+c;if(n==r&&s.length>=r+e.length-o&&s.slice(r-o,r-o+e.length)==e)return r}}return-1}u(rH,"findTextInFragment");function r1(t,e,n,r,i){let l=[];for(let a=0,o=0;a=n||d<=e?l.push(s):(cn&&l.push(s.slice(n-c,s.size,r)))}return l}u(r1,"replaceNodes");function i1(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),l=i&&i.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let o=r.resolve(a),s,c;if(Zh(n)){for(s=a;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&ae.isSelectable(f)&&i.parent&&!(f.isInline&&Q_(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new ae(a==h?o:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=a,h=a;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!CM(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}u(iH,"removeClassOnSelectionChange");function lH(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,ot(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Xt&&Qi<=11&&(n.disabled=!0,n.disabled=!1)}u(lH,"selectCursorWrapper");function EM(t,e){if(e instanceof ae){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(TM(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else TM(t)}u(EM,"syncNodeSelection");function TM(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}u(TM,"clearNodeSelection");function a1(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ke.between(e,n,r)}u(a1,"selectionBetween");function AM(t){return t.editable&&!t.hasFocus()?!1:QM(t)}u(AM,"hasFocusAndSelection");function QM(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}u(QM,"hasSelection");function aH(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Al(e.node,e.offset,n.anchorNode,n.anchorOffset)}u(aH,"anchorInRightPlace");function o1(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),l=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return l&&de.findFrom(l,e)}u(o1,"moveSelectionBlock");function Ri(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}u(Ri,"apply");function MM(t,e,n){let r=t.state.selection;if(r instanceof ke)if(n.indexOf("s")>-1){let{$head:i}=r,l=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+l.nodeSize*(e<0?-1:1));return Ri(t,new ke(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=o1(t.state,e);return i&&i instanceof ae?Ri(t,i):!1}else if(!(Sn&&n.indexOf("m")>-1)){let i=r.$head,l=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!l||l.isText)return!1;let o=e<0?i.pos-l.nodeSize:i.pos;return l.isAtom||(a=t.docView.descAt(o))&&!a.contentDOM?ae.isSelectable(l)?Ri(t,new ae(e<0?t.state.doc.resolve(i.pos-l.nodeSize):i)):Nu?Ri(t,new ke(t.state.doc.resolve(e<0?o:o+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ae&&r.node.isInline)return Ri(t,new ke(e>0?r.$to:r.$from));{let i=o1(t.state,e);return i?Ri(t,i):!1}}}u(MM,"selectHorizontally");function Yh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}u(Yh,"nodeLen");function Lu(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}u(Lu,"isIgnorable");function po(t,e){return e<0?oH(t):sH(t)}u(po,"skipIgnoredNodes");function oH(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,l,a=!1;for(xn&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let o=n.childNodes[r-1];if(Lu(o,-1))i=n,l=--r;else if(o.nodeType==3)n=o,r=n.nodeValue.length;else break}}else{if(BM(n))break;{let o=n.previousSibling;for(;o&&Lu(o,-1);)i=n.parentNode,l=ot(o),o=o.previousSibling;if(o)n=o,r=Yh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?s1(t,n,r):i&&s1(t,i,l)}u(oH,"skipIgnoredNodesBefore");function sH(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Yh(n),l,a;for(;;)if(r{t.state==i&&Kr(t)},50)}u(s1,"setSelFocus");function RM(t,e){let n=t.state.doc.resolve(e);if(!(pt||R_)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let l=t.coordsAtPos(e-1),a=(l.top+l.bottom)/2;if(a>i.top&&a1)return l.lefti.top&&a1)return l.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}u(RM,"findDirection");function VM(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||Sn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:l}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=o1(t.state,e);if(a&&a instanceof ae)return Ri(t,a)}if(!i.parent.inlineContent){let a=e<0?i:l,o=r instanceof Fn?de.near(a,e):de.findFrom(a,e);return o?Ri(t,o):!1}return!1}u(VM,"selectVertically");function NM(t,e){if(!(t.state.selection instanceof ke))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let l=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(l&&!l.isText){let a=t.state.tr;return e<0?a.delete(n.pos-l.nodeSize,n.pos):a.delete(n.pos,n.pos+l.nodeSize),t.dispatch(a),!0}return!1}u(NM,"stopNativeHorizontalDelete");function FM(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}u(FM,"switchEditable");function dH(t){if(!Et||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;FM(t,r,"true"),setTimeout(()=>FM(t,r,"false"),20)}return!1}u(dH,"safariDownArrowBug");function fH(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}u(fH,"getMods");function hH(t,e){let n=e.keyCode,r=fH(e);if(n==8||Sn&&n==72&&r=="c")return NM(t,-1)||po(t,-1);if(n==46&&!e.shiftKey||Sn&&n==68&&r=="c")return NM(t,1)||po(t,1);if(n==13||n==27)return!0;if(n==37||Sn&&n==66&&r=="c"){let i=n==37?RM(t,t.state.selection.from)=="ltr"?-1:1:-1;return MM(t,i,r)||po(t,i)}else if(n==39||Sn&&n==70&&r=="c"){let i=n==39?RM(t,t.state.selection.from)=="ltr"?1:-1:1;return MM(t,i,r)||po(t,i)}else{if(n==38||Sn&&n==80&&r=="c")return VM(t,-1,r)||po(t,-1);if(n==40||Sn&&n==78&&r=="c")return dH(t)||VM(t,1,r)||po(t,1);if(r==(Sn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}u(hH,"captureKeyDown");function u1(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:l}=e;for(;i>1&&l>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,l--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=t.someProp("clipboardSerializer")||ro.fromSchema(t.state.schema),o=WM(),s=o.createElement("div");s.appendChild(a.serializeFragment(r,{document:o}));let c=s.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=jM[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let m=o.createElement(d[p]);for(;s.firstChild;)m.appendChild(s.firstChild);s.appendChild(m),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${l}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` +}`,{label:"class",detail:"definition",type:"keyword"}),Zt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Zt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],aU=OQ.concat([Zt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Zt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Zt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),bQ=new Ff,yQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function wu(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}u(wu,"defID");const oU=["FunctionDeclaration"],sU={FunctionDeclaration:wu("function"),ClassDeclaration:wu("class"),ClassExpression:()=>!0,EnumDeclaration:wu("constant"),TypeAliasDeclaration:wu("type"),NamespaceDeclaration:wu("namespace"),VariableDefinition(t,e){t.matchContext(oU)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function vQ(t,e){let n=bQ.get(e);if(n)return n;let r=[],i=!0;function l(a,o){let s=t.sliceString(a.from,a.to);r.push({label:s,type:o})}return u(l,"def"),e.cursor(Ae.IncludeAnonymous).iterate(a=>{if(i)i=!1;else if(a.name){let o=sU[a.name];if(o&&o(a,l)||yQ.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of vQ(t,a.node))r.push(o);return!1}}),bQ.set(e,r),r}u(vQ,"getScope");const $Q=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,wQ=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function uU(t){let e=ze(t.state).resolveInner(t.pos,-1);if(wQ.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&$Q.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)yQ.has(i.name)&&(r=r.concat(vQ(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:$Q}}u(uU,"localCompletionSource");const ur=iu.define({name:"javascript",parser:lU.configure({props:[Kf.add({IfStatement:Uf({except:/^\s*({|else\b)/}),TryStatement:Uf({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Dj,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:kj({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Uf({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Gf.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":u7,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),xQ={test:t=>/^JSX/.test(t.name),facet:r7({commentTokens:{block:{open:"{/*",close:"*/}"}}})},SQ=ur.configure({dialect:"ts"},"typescript"),CQ=ur.configure({dialect:"jsx",props:[ub.add(t=>t.isTop?[xQ]:void 0)]}),kQ=ur.configure({dialect:"jsx ts",props:[ub.add(t=>t.isTop?[xQ]:void 0)]},"typescript");let DQ=u(t=>({label:t,type:"keyword"}),"kwCompletion");const PQ="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(DQ),cU=PQ.concat(["declare","implements","private","protected","public"].map(DQ));function dU(t={}){let e=t.jsx?t.typescript?kQ:CQ:t.typescript?SQ:ur,n=t.typescript?aU.concat(cU):OQ.concat(PQ);return new ou(e,[ur.data.of({autocomplete:mW(wQ,pA(n))}),ur.data.of({autocomplete:uU}),t.jsx?pU:[]])}u(dU,"javascript");function fU(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}u(fU,"findOpenTag");function EQ(t,e,n=t.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}u(EQ,"elementName$1");const hU=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),pU=J.inputHandler.of((t,e,n,r,i)=>{if((hU?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!ur.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c;let{head:d}=s,f=ze(a).resolveInner(d-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(a.doc.sliceString(d-1,d)!=r||f.name=="JSXAttributeValue"&&f.to>d)){if(r==">"&&f.name=="JSXFragmentTag")return{range:s,changes:{from:d,insert:""}};if(r=="/"&&f.name=="JSXStartCloseTag"){let p=f.parent,m=p.parent;if(m&&p.from==d-2&&((h=EQ(a.doc,m.firstChild,d))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:X.cursor(d+g.length,-1),changes:{from:d,insert:g}}}}else if(r==">"){let p=fU(f);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(h=EQ(a.doc,p,d)))return{range:s,changes:{from:d,insert:``}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),xu=["_blank","_self","_top","_parent"],gy=["ascii","utf-8","utf-16","latin1","latin1"],Oy=["get","post","put","delete"],by=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],rn=["true","false"],te={},mU={a:{attrs:{href:null,ping:null,type:null,media:null,target:xu,hreflang:null}},abbr:te,address:te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:te,aside:te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:te,base:{attrs:{href:null,target:xu}},bdi:te,bdo:te,blockquote:{attrs:{cite:null}},body:te,br:te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:by,formmethod:Oy,formnovalidate:["novalidate"],formtarget:xu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:te,center:te,cite:te,code:te,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:te,div:te,dl:te,dt:te,em:te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:te,figure:te,footer:te,form:{attrs:{action:null,name:null,"accept-charset":gy,autocomplete:["on","off"],enctype:by,method:Oy,novalidate:["novalidate"],target:xu}},h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:te,hgroup:te,hr:te,html:{attrs:{manifest:null}},i:te,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:by,formmethod:Oy,formnovalidate:["novalidate"],formtarget:xu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:te,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gy,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:te,noscript:te,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:te,param:{attrs:{name:null,value:null}},pre:te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:te,rt:te,ruby:te,samp:te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gy}},section:te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:te,source:{attrs:{src:null,type:null,media:null}},span:te,strong:te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:te,summary:te,sup:te,table:te,tbody:te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:te,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:te,time:{attrs:{datetime:null}},title:te,tr:te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:te,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:te},TQ={accesskey:null,class:null,contenteditable:rn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:rn,autocorrect:rn,autocapitalize:rn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":rn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":rn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":rn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":rn,"aria-hidden":rn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":rn,"aria-multiselectable":rn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":rn,"aria-relevant":null,"aria-required":rn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},AQ="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of AQ)TQ[t]=null;let yh=(Sc=class{constructor(e,n){this.tags={...mU,...e},this.globalAttrs={...TQ,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}},u(Sc,"Schema"),Sc);yh.default=new yh;function Ha(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}u(Ha,"elementName");function Ja(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}u(Ja,"findParentElement");function QQ(t,e,n){let r=n.tags[Ha(t,Ja(e))];return r?.children||n.allTags}u(QQ,"allowedChildren");function yy(t,e){let n=[];for(let r=Ja(e);r&&!r.type.isTop;r=Ja(r.parent)){let i=Ha(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}u(yy,"openTags");const MQ=/^[:\-\.\w\u00b7-\uffff]*$/;function BQ(t,e,n,r,i){let l=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",a=Ja(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:QQ(t.doc,a,e).map(o=>({label:o,type:"type"})).concat(yy(t.doc,n).map((o,s)=>({label:"/"+o,apply:"/"+o+l,type:"type",boost:99-s}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}u(BQ,"completeTag");function RQ(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:yy(t.doc,e).map((l,a)=>({label:l,apply:l+i,type:"type",boost:99-a})),validFor:MQ}}u(RQ,"completeCloseTag");function gU(t,e,n,r){let i=[],l=0;for(let a of QQ(t.doc,n,e))i.push({label:"<"+a,type:"type"});for(let a of yy(t.doc,n))i.push({label:"",type:"type",boost:99-l++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}u(gU,"completeStartTag");function OU(t,e,n,r,i){let l=Ja(n),a=l?e.tags[Ha(t.doc,l)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],s=a&&a.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:s.map(c=>({label:c,type:"property"})),validFor:MQ}}u(OU,"completeAttrName");function bU(t,e,n,r,i){var l;let a=(l=n.parent)===null||l===void 0?void 0:l.getChild("AttributeName"),o=[],s;if(a){let c=t.sliceDoc(a.from,a.to),d=e.globalAttrs[c];if(!d){let f=Ja(n),h=f?e.tags[Ha(t.doc,f)]:null;d=h?.attrs&&h.attrs[c]}if(d){let f=t.sliceDoc(r,i).toLowerCase(),h='"',p='"';/^['"]/.test(f)?(s=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",p=t.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):s=/^[^\s<>='"]*$/;for(let m of d)o.push({label:m,apply:h+m+p,type:"constant"})}}return{from:r,to:i,options:o,validFor:s}}u(bU,"completeAttrValue");function yU(t,e){let{state:n,pos:r}=e,i=ze(n).resolveInner(r,-1),l=i.resolve(r);for(let a=r,o;l==i&&(o=i.childBefore(a));){let s=o.lastChild;if(!s||!s.type.isError||s.fromyU(r,i)}u(vU,"htmlCompletionSourceWith");const $U=ur.parser.configure({top:"SingleExpression"}),VQ=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:SQ.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:CQ.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:kQ.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:$U},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:ur.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:bh.parser}],NQ=[{name:"style",parser:bh.parser.configure({top:"Styles"})}].concat(AQ.map(t=>({name:t,parser:ur.parser}))),FQ=iu.define({name:"html",parser:YY.configure({props:[Kf.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),vh=FQ.configure({wrap:iQ(VQ,NQ)});function wU(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=iQ((t.nestedLanguages||[]).concat(VQ),(t.nestedAttributes||[]).concat(NQ)));let r=n?FQ.configure({wrap:n,dialect:e}):e?vh.configure({dialect:e}):vh;return new ou(r,[vh.data.of({autocomplete:vU(t)}),t.autoCloseTags!==!1?xU:[],dU().support,PK().support])}u(wU,"html");const IQ=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),xU=J.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!vh.isActiveAt(t.state,e,-1))return!1;let l=i(),{state:a}=l,o=a.changeByRange(s=>{var c,d,f;let h=a.doc.sliceString(s.from-1,s.to)==r,{head:p}=s,m=ze(a).resolveInner(p,-1),g;if(h&&r==">"&&m.name=="EndTag"){let O=m.parent;if(((d=(c=O.parent)===null||c===void 0?void 0:c.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(g=Ha(a.doc,O.parent,p))&&!IQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=``;return{range:s,changes:{from:p,to:b,insert:y}}}}else if(h&&r=="/"&&m.name=="IncompleteCloseTag"){let O=m.parent;if(m.from==p-2&&((f=O.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=Ha(a.doc,O,p))&&!IQ.has(g)){let b=p+(a.doc.sliceString(p,p+1)===">"?1:0),y=`${g}>`;return{range:X.cursor(p+y.length,-1),changes:{from:p,to:b,insert:y}}}}return{range:s}});return o.changes.empty?!1:(t.dispatch([l,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var SU=Object.defineProperty,LQ=u((t,e)=>SU(t,"name",{value:e,configurable:!0}),"i$d");const CU=LQ((t,e=!1)=>{const n=[TX(),MX(),iX(),cq(),Ij(),GZ(),su.of(" "),Ej(),Uj(),XW(),JW(),mX(),bX(),sX(),nY(),Df.of([hW,...WW,...fW,...yq,...Vj,...AA]),wU(),zj(Xj,{fallback:!0}),J.updateListener.of(r=>{r.docChanged&&e&&e(r.state.doc.toString())}),J.lineWrapping];return Xe.create({doc:t,extensions:n})},"createEditorState"),kU=LQ((t,e)=>new J({state:t,parent:e,lineWrapping:!0}),"createEditorView");var DU=Object.defineProperty,PU=u((t,e)=>DU(t,"name",{value:e,configurable:!0}),"i$c");const zQ=PU(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(null),i=wp.element.useRef(null);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{if(i.current)return;const l=CU(t.value??"",n);i.current=kU(l,r.current)},[r.current]),wp.element.createElement("div",{className:"tf-code"},wp.element.createElement("div",{className:"tf-code-editor",ref:r}))},"Editor");var EU=Object.defineProperty,TU=u((t,e)=>EU(t,"name",{value:e,configurable:!0}),"n$b");const AU=TU(t=>{const e=wp.element.useRef(null),[n,r]=wp.element.useState(t.value??""),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,e);return wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]),wp.element.createElement("div",{className:"tf-code"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",value:n,ref:e,name:t.name??""}),wp.element.createElement(zQ,{...t,value:n,onChange:r}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Code");var QU=Object.defineProperty,MU=u((t,e)=>QU(t,"name",{value:e,configurable:!0}),"c$e");const BU=MU(t=>{const e=wp.element.useRef(null),n=wp.element.useRef(null),r=wp.element.useRef(null),i=rN(t),{colorAreaProps:l,gradientProps:a,xInputProps:o,yInputProps:s,thumbProps:c}=ON({...t,inputXRef:e,inputYRef:n,containerRef:r},i),{focusProps:d}=rs();return wp.element.createElement("div",{className:"tf-color-area",ref:r,style:l.style,...l},wp.element.createElement("div",{className:"tf-color-area-gradient",style:a?.style,...a}),wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...c.style,background:i.getDisplayColor().toString("css")},...c},wp.element.createElement("input",{ref:e,...o,...d}),wp.element.createElement("input",{ref:n,...s,...d})))},"ColorArea");var RU=Object.defineProperty,VU=u((t,e)=>RU(t,"name",{value:e,configurable:!0}),"c$d");const ZQ=VU(t=>{const{locale:e}=Re(),n=sN({...t,locale:e}),r=wp.element.useRef(),i=wp.element.useRef(),l=t.label||n.value.getChannelName(t.channel,e),{trackProps:a,thumbProps:o,inputProps:s,labelProps:c,outputProps:d}=vN({...t,label:l,trackRef:r,inputRef:i},n),{focusProps:f}=rs();return wp.element.createElement("div",{className:"tf-color-slider"},wp.element.createElement("div",{className:"tf-color-slider-label"},wp.element.createElement("label",{...c},l),wp.element.createElement("output",{...d},n.value.formatChannelValue(t.channel,e))),wp.element.createElement("div",{className:"tf-color-slider-container",ref:r,style:a.style,...a},wp.element.createElement("div",{className:"tf-color-area-thumb",style:{...o.style,background:n.getDisplayColor().toString("css")},...o},wp.element.createElement(gn,null,wp.element.createElement("input",{ref:i,...s,...f})))))},"ColorSlider");var NU=Object.defineProperty,FU=u((t,e)=>NU(t,"name",{value:e,configurable:!0}),"t$7");const XQ=FU(t=>{const[e,n]=wp.element.useState(mn(t.value&&t.value!==""?t.value:"rgba(255, 255, 255, 1)").toHSB()),[r,i,l]=e.getColorChannels(),[a,o]=wp.element.useState(t.value);wp.element.useEffect(()=>{o(t.value)},[t.value]),wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]);const{focusWithinProps:s}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}}),c=t.hasAlpha??!0;return wp.element.createElement("div",{className:"tf-color-picker",...s},wp.element.createElement(gs,null,wp.element.createElement(vd,{autoFocus:!0,restoreFocus:!0},wp.element.createElement(BU,{"aria-labelledby":"hsb-label-id-1",value:e,onChange:n,xChannel:i,yChannel:l}),wp.element.createElement("div",{className:"tf-color-input"},wp.element.createElement("label",null,"Color"),wp.element.createElement("input",{type:"text",value:a,onChange:d=>{o(d.target.value)},onBlur:d=>{t.onChange(d.target.value)}})),wp.element.createElement("div",{className:"tf-color-sliders"},wp.element.createElement(ZQ,{channel:r,value:e,onChange:n}),c&&wp.element.createElement(ZQ,{channel:"alpha",value:e,onChange:n})))))},"ColorPicker");var IU=Object.defineProperty,LU=u((t,e)=>IU(t,"name",{value:e,configurable:!0}),"c$c");const zU=wp.element.forwardRef(({inputProps:t,state:e,...n},r)=>{const[i,l]=wp.element.useState(!1),a=n.format??"hexa",o=wp.element.useRef(),s=LU(c=>{const d=c.toString?c.toString(a):"";e.setInputValue(d),n.onChange&&n.onChange(d)},"onChange");return wp.element.useEffect(()=>e.setInputValue(e.colorValue?.toString(a)),[]),wp.element.createElement("div",{className:"tf-color-container",ref:o},wp.element.createElement("input",{ref:r,...t,onClick:()=>l(!0),value:e.inputValue??""}),i&&wp.element.createElement(Rr,{state:{isOpen:i,close:()=>l(!1)},triggerRef:r,placement:"bottom start",style:{width:o?.current?.offsetWidth},className:"tf-color-popover"},wp.element.createElement(XQ,{value:e.colorValue?.toString(a),onChange:s,hasAlpha:n.hasAlpha??!0,onFocusChange:c=>l(c)})))});var ZU=Object.defineProperty,XU=u((t,e)=>ZU(t,"name",{value:e,configurable:!0}),"n$a");const jQ=XU(t=>{let e;typeof t.value=="object"?e=t.value?.value||"#FFFFFF":e=t?.value||"#FFFFFF";const n={...t,value:e},r=wp.element.useRef(),i=dN(n),{labelProps:l,inputProps:a,descriptionProps:o}=wN(n,i,r),[s,c]=wp.element.useState(n.value??"");return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement("div",{className:"tf-color"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement(Ss,{...n,value:s,onValueSelection:c,inputProps:a,ref:r},wp.element.createElement(zU,{...n,value:s,onChange:t.onChange,state:i,inputProps:a,ref:r})),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Color");var jU=Object.defineProperty,qQ=u((t,e)=>jU(t,"name",{value:e,configurable:!0}),"c$b");const qU=qQ((t,e)=>{const{api:n,fetchResponse:r}=Zn();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(t,{method:"POST",body:e,headers:{"X-WP-Nonce":n.nonce??!1,enctype:"multipart/form-data"},credentials:"same-origin",processData:!1,contentType:!1}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"post"),WQ=qQ((t,e=!1)=>{const{api:n,fetchResponse:r}=Zn();return r?new Promise(i=>i(r)):new Promise((i,l)=>{fetch(`${t}?${e?new URLSearchParams(e):""}`,{method:"GET",headers:{"X-WP-Nonce":n.nonce??!1},credentials:"same-origin"}).then(a=>a.ok?i(a.json()):a.json().then(l))})},"get");var WU=Object.defineProperty,vy=u((t,e)=>WU(t,"name",{value:e,configurable:!0}),"i$b");const YU=vy(t=>{const e=wp.element.useRef({status:!1,callback:!1,firstLoad:!0}),n=YI({async load({filterText:r}){if(e.current.firstLoad)e.current.firstLoad=!1;else{if(e.current.status==="waiting"){const o=t.debounceTime??200;clearTimeout(e.current.callback),e.current={status:"waiting",callback:setTimeout(()=>{e.current.status=!1,n.setFilterText(r)},o)};return}e.current.status="waiting"}const i={...t.asyncArgs??{},search:r};let l=t.ajaxAction?await Tangible?.ajax(t.ajaxAction,i):await WQ(t.searchUrl??"",i);l.length===0&&l.push({id:"_noResults",title:"No results"}),!Array.isArray(l)&&typeof l=="object"&&(l=Object.values(l).map(o=>o));const a=t.mapResults?KU(l,t.mapResults):l;return{items:il((a??[]).reduce((o,s)=>({...o,[s.id]:s.title}),{}))}}});return{items:n.items,inputValue:n.filterText,onInputChange:n.setFilterText,selectedKeys:t.value.value??"",loadingState:n.loadingState}},"getAsyncProps"),KU=vy((t,e)=>t.map(n=>(e.id&&(n.id=YQ(n,e.id)),e.title&&(n.title=YQ(n,e.title)),n)),"mapResults"),YQ=vy((t,e)=>typeof e=="object"?t[e.key][e.attribute]:t[e],"mapResultsItem");var UU=Object.defineProperty,$h=u((t,e)=>UU(t,"name",{value:e,configurable:!0}),"n$9");const KQ=$h((t,e,n)=>{if(!e.isAsync){e.onSelectionChange&&e.onSelectionChange(t);return}const r=Y2(t,e.items);e.onSelectionChange&&e.onSelectionChange(r),e.multiple||n.setInputValue(r.label)},"onSelectionChange"),UQ=$h((t,e)=>t.isAsync&&t.selectedKey?e.setInputValue(t.selectedKey.label??""):null,"setInputValue"),GQ=$h(t=>t.isAsync&&t.selectedKey?.value?t.selectedKey.value:t.selectedKey??"","getSelectedKey"),_Q=$h(t=>[...t.disabledKeys??[],"_noResults"],"getDisabledKeys"),GU=wp.element.forwardRef(({parent:t,buttonProps:e,descriptionProps:n,labelProps:r,inputProps:i,listBoxProps:l,state:a,multiple:o=!1},s)=>{if(o)throw new Error("The simple layout does not support multiple values");const{focusWithinProps:c}=Wt({onFocusWithinChange:d=>{t.onFocusChange&&t.onFocusChange(d)}});return wp.element.createElement("div",{className:"tf-combo-box",...c},t.label&&wp.element.createElement(xe,{labelProps:r,parent:t},t.label),wp.element.createElement(vd,{autoFocus:t.autoFocus,restoreFocus:!0},wp.element.createElement("div",{className:"tf-combo-box-text",ref:s.current.wrapper},wp.element.createElement("input",{...i,ref:s.current.input,readOnly:t.readOnly}),t.showButton&&wp.element.createElement(se,{type:"action",ref:s.current.trigger,preventFocusOnPress:!0,...e,isDisabled:t.readOnly},wp.element.createElement("span",{"aria-hidden":"true"},"\u25BC")),a.isOpen&&!t.readOnly&&wp.element.createElement(Rr,{state:a,triggerRef:s.current.input,popoverRef:s.current.popover,placement:"bottom start",isNonModal:!0,style:{width:s.current.wrapper?.current?.offsetWidth},className:"tf-combo-box-popover"},wp.element.createElement(Vd,{loadingState:t.loadingState??"idle",listBoxRef:s.current.listbox,state:a,items:t.items,focusWithinProps:!0,shouldUseVirtualFocus:!0,...l})))),t.description&&wp.element.createElement(we,{descriptionProps:n,parent:t},t.description))}),_U=wp.element.forwardRef(({parent:t,descriptionProps:e,labelProps:n,inputProps:r,itemProps:i,multiple:l,state:a,...o},s)=>{if(!l)throw new Error("The simple-multiple layout only support multiple values");const{add:c,getDisabledValues:d,remove:f}=l,[h,p]=wp.element.useState(l.values??[]);wp.element.useEffect(()=>p(l.values),[l.values]);const m=wp.element.useRef(),g=pi({}),{triggerProps:O,overlayProps:b}=us({type:"dialog"},g,m),y=Array.isArray(t.choices)?t.choices.reduce(($,v)=>({...$,...v.choices??{}}),{}):t.choices;return wp.element.createElement("div",{className:"tf-multiple-combobox","data-enabled":!t.readOnly},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("div",{className:"tf-multiple-combobox-container"},wp.element.createElement("div",{ref:s.current.input,className:"tf-multiple-combobox-values",...r},h.length===0?t.placeholder??"No item selected":h.map(($,v)=>wp.element.createElement("span",{key:$.key??v,className:"tf-combo-box-item"},wp.element.createElement("span",null,t.isAsync?$.label:y[$]??""),t.readOnly!==!0&&wp.element.createElement(se,{onPress:()=>f(v)},"x")))),wp.element.createElement(se,{type:"action",ref:m,...O,isDisabled:t.readOnly},"Add"),g.isOpen&&wp.element.createElement("div",{className:"tf-popover",ref:s.current.overlay,...b},wp.element.createElement(eM,{focusStrategy:"first",label:"Select an item to add",labelVisuallyHidden:!0,description:!1,disabledKeys:d(),autoFocus:!0,multiple:!0,showButton:!1,menuTrigger:"focus",onSelectionChange:$=>{$&&(c($),g.close())},onFocusChange:$=>$?!g.isOpen&&g.open():g.close(),isAsync:t.isAsync??!1,...i},t.children),wp.element.createElement(ds,{onDismiss:g.close}))),t.description&&wp.element.createElement(we,{descriptionProps:e,parent:t},t.description))});var HU=Object.defineProperty,JU=u((t,e)=>HU(t,"name",{value:e,configurable:!0}),"i$9");const HQ={"simple-multiple":_U,simple:GU},JQ=JU(t=>typeof t=="string"?HQ[t]:["function","object"].includes(typeof t)?t:HQ[fallback],"getLayout");var eG=Object.defineProperty,tG=u((t,e)=>eG(t,"name",{value:e,configurable:!0}),"l$8"),eM=tG(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef();wp.element.useEffect(()=>{UQ(t,o)},[]);const{contains:a}=Cg({sensitivity:"base"}),o=rP({...t,onSelectionChange:g=>KQ(g,t,o),selectedKey:GQ(t),defaultFilter:a,disabledKeys:_Q(t)}),{buttonProps:s,inputProps:c,listBoxProps:d,labelProps:f,descriptionProps:h}=KD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},o),p=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),m=JQ(t.layout??"simple");return wp.element.createElement(m,{parent:t,labelProps:f,descriptionProps:h,inputProps:c,buttonProps:s,listBoxProps:d,itemProps:t.itemProps,ref:p,state:o,multiple:!1})},"ComboBox"),nG=Object.defineProperty,wh=u((t,e)=>nG(t,"name",{value:e,configurable:!0}),"n$7");const rG=wh(t=>{const e=wp.element.useRef(),n=wp.element.useRef(),r=wp.element.useRef(),i=wp.element.useRef(),l=wp.element.useRef(),[a,o]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value&&!t.isAsync?t.value.split(","):[]);wp.element.useEffect(()=>t.onChange&&t.onChange(a),[a.length]),wp.element.useEffect(()=>{UQ(t,c)},[]);const{contains:s}=Cg({sensitivity:"base"}),c=rP({...t,onSelectionChange:v=>KQ(v,t,c),selectedKey:GQ(t),defaultFilter:s,disabledKeys:_Q(t)}),{buttonProps:d,inputProps:f,listBoxProps:h,labelProps:p,descriptionProps:m}=KD({...t,inputRef:n,buttonRef:e,listBoxRef:r,popoverRef:i,menuTrigger:"input"},c),g=wh(v=>{a.indexOf(v)===-1&&o([...a,v])},"add"),O=wh(v=>{a[v]&&o([...a.slice(0,v),...a.slice(v+1)])},"remove"),b=wh(()=>t.isAsync?a.map(v=>v.value):a,"getDisabledValues"),y=wp.element.useRef({tirgger:e,input:n,popover:i,wrapper:l,listbox:r}),$=JQ(t.layout??"simple-multiple");return wp.element.createElement($,{parent:t,labelProps:p,descriptionProps:m,inputProps:f,buttonProps:d,listBoxProps:h,itemProps:t.itemProps,ref:y,state:c,multiple:{getDisabledValues:b,add:g,remove:O,values:a}})},"MultipleComboBox");var iG=Object.defineProperty,lG=u((t,e)=>iG(t,"name",{value:e,configurable:!0}),"t$6"),xh=lG(t=>{const[e,n]=wp.element.useState(t.isAsync?On(t.value??""):t.value??!1),r=t.isAsync?YU(t):{defaultItems:il(t.choices??{})};return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[r.selectedKeys]),t.multiple?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(rG,{...t,onChange:i=>n(t.isAsync?i:i.join(",")),value:e,label:t.label??null,placeholder:t.placeholder,description:t.description??!1,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple-multiple",itemProps:r,...r},Ld)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:t.isAsync?JSON.stringify(e):e}),wp.element.createElement(eM,{focusStrategy:"first",label:t.label??null,placeholder:t.placeholder,description:t.description??!1,selectedKey:e,onSelectionChange:n,onFocusChange:t.onFocusChange??!1,autoFocus:t.autoFocus??!1,isAsync:t.isAsync??!1,showButton:t.showButton??!0,menuTrigger:"focus",labelVisuallyHidden:t.labelVisuallyHidden??!1,descriptionVisuallyHidden:t.descriptionVisuallyHidden??!1,disabledKeys:t.disabledKeys??[],readOnly:t.readOnly??!1,layout:t.layout??"simple",itemProps:r,...r},Ld))},"default"),aG=Object.defineProperty,oG=u((t,e)=>aG(t,"name",{value:e,configurable:!0}),"i$8");const Sh=oG((t,e)=>{if(t instanceof Fe)return t;const n=String(t??"").split("-");return n.length===3?new Fe("AD",n[0],n[1],n[2]):e},"formatValue");var sG=Object.defineProperty,tM=u((t,e)=>sG(t,"name",{value:e,configurable:!0}),"o$7");const nM=wp.element.createContext(null),uG=tM(({value:t,children:e})=>{const n=On(t)??"",r=Cr(kr()),i={start:Sh(n.start??"",r),end:Sh(n.end??"",r)},[l,a]=wp.element.useState(i);return wp.element.createElement(nM.Provider,{value:{dateValue:l,setDateValue:a}},e)},"CalendarContextProvider"),Ch=tM(()=>{const t=wp.element.useContext(nM);if(!t)throw new Error("useCalendarContext must be used within a Calendar");return t},"useCalendarContext");var cG=Object.defineProperty,dG=u((t,e)=>cG(t,"name",{value:e,configurable:!0}),"t$5");const fG=dG(({state:t,date:e})=>{const n=wp.element.useRef(),{cellProps:r,buttonProps:i,isSelected:l,isOutsideVisibleRange:a,isDisabled:o,isUnavailable:s,formattedDate:c}=LV({date:e},t,n),{focusProps:d}=rs();let f="tf-calendar-cell";return l&&(f+=" tf-calendar-cell-selected"),o&&(f+=" tf-calendar-cell-disabled"),s&&(f+=" tf-calendar-cell-unavailable"),wp.element.createElement("td",{...r},wp.element.createElement("div",{...ne(i,d),ref:n,hidden:a,className:f},c))},"CalendarCell");var hG=Object.defineProperty,pG=u((t,e)=>hG(t,"name",{value:e,configurable:!0}),"l$7");const rM=pG(({state:t,...e})=>{const{locale:n}=Re(),r=e.dateRange??!1,i=t.visibleRange.start.add(e.offset??{}),l=Oa(i),{gridProps:a,headerProps:o,weekDays:s}=wx(r?{startDate:i,endDate:l}:e,t),c=z3(t.visibleRange.start,n);return wp.element.createElement("table",{className:"tf-calendar-table",...a},wp.element.createElement("thead",{...o},wp.element.createElement("tr",null,s.map((d,f)=>wp.element.createElement("th",{key:f},d)))),wp.element.createElement("tbody",null,[...new Array(c).keys()].map(d=>{const f=r?[d,i]:[d];return wp.element.createElement("tr",{key:d},t.getDatesInWeek(...f).map((h,p)=>h?wp.element.createElement(fG,{key:p,state:t,date:h,currentMonth:i}):wp.element.createElement("td",{key:p})))})))},"CalendarGrid");var mG=Object.defineProperty,$y=u((t,e)=>mG(t,"name",{value:e,configurable:!0}),"e");const kh=$y(({date:t,children:e})=>{const{setDateValue:n}=Ch();return wp.element.createElement(se,{onPress:$y(()=>{n(t)},"onPress")},e)},"Preset"),gG=$y(()=>{const t=Cr(kr());return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(kh,{date:{start:t,end:t}},"Today"),wp.element.createElement(kh,{date:{start:t.subtract({weeks:1}),end:t}},"Last Week"),wp.element.createElement(kh,{date:{start:_i(t),end:Oa(t)}},"This Month"),wp.element.createElement(kh,{date:{start:_i(t.subtract({months:1})),end:Oa(t.subtract({months:1}))}},"Last Month"))},"DateRangePresets");var OG=Object.defineProperty,bG=u((t,e)=>OG(t,"name",{value:e,configurable:!0}),"r$4");const iM=bG(t=>{const{locale:e}=Re(),{dateValue:n}=t.dateRange?Ch():{},r=t.dateRange?DI({...t,value:n,locale:e,visibleDuration:{months:t.multiMonth},createCalendar:mg}):J2({...t,locale:e,createCalendar:mg}),i=wp.element.useRef(),{calendarProps:l,prevButtonProps:a,nextButtonProps:o,title:s}=t.dateRange?FV(t,r,i):NV(t,r);return wp.element.createElement("div",{className:"tf-calendar",...l,ref:i},wp.element.createElement("div",{className:"tf-calendar-header"},wp.element.createElement("div",{className:"tf-calendar-buttons"},wp.element.createElement(se,{...a},"<"),wp.element.createElement("div",{className:"tf-calendar-month"},s),wp.element.createElement(se,{...o},">"))),wp.element.createElement("div",{className:"tf-calendar-tables"},t.multiMonth===1||!t.dateRange?wp.element.createElement(rM,{state:r}):Array.from({length:t.multiMonth},(c,d)=>wp.element.createElement(rM,{key:d,state:r,dateRange:t.dateRange,offset:{months:d}}))),t.dateRange&&t.datePresets&&wp.element.createElement("div",{className:"tf-calendar-presets"},wp.element.createElement(gG,null)))},"Calendar");var yG=Object.defineProperty,vG=u((t,e)=>yG(t,"name",{value:e,configurable:!0}),"o$6");const lM=vG(({segment:t,state:e})=>{const n=wp.element.useRef(),{segmentProps:r}=OF(t,e,n);let i="tf-date-segment";return t.isPlaceholder&&(i+=" tf-date-segment-placeholder"),wp.element.createElement("div",{className:i,...r,ref:n},wp.element.createElement("span",{"aria-hidden":"true"},t.placeholder),t.isPlaceholder?"":t.text)},"DateSegment");var $G=Object.defineProperty,wG=u((t,e)=>$G(t,"name",{value:e,configurable:!0}),"a$5");const wy=wG(t=>{const{locale:e}=Re(),n=WP({...t,locale:e,createCalendar:mg}),r=wp.element.useRef(),{fieldProps:i}=Q2(t,n,r);return wp.element.createElement("div",{className:"tf-date-field",...i,ref:r},n.segments.map((l,a)=>wp.element.createElement(lM,{key:a,segment:l,state:n})))},"DateField");var xG=Object.defineProperty,aM=u((t,e)=>xG(t,"name",{value:e,configurable:!0}),"i$7");const SG=wp.element.forwardRef(({datePickerProps:t,hasFutureOnly:e,state:n,...r},i)=>{const{groupProps:l,fieldProps:a,buttonProps:o,dialogProps:s,calendarProps:c,inputProps:d}=t,[f,h]=wp.element.useState(r.value);wp.element.useEffect(()=>{r.value!==f&&h(r.value)},[r.value]),wp.element.useEffect(()=>(document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)),[i]);const p=aM(g=>{const O=i.current??!1;O&&(O.contains(g.target)||n.setOpen(!1))},"onClickOutside");o.onPress=()=>n.setOpen(!n.isOpen);const m=aM(()=>n.value&&n.value.toString?n.value.toString():"","getStringValue");return wp.element.useEffect(()=>{if(r.onChange&&r.onChange(m()),e&&n.value&&r.value){const g=Cr(kr());n.value.compare(g)<0&&n.setValue(g)}},[n.value]),wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...d,type:"hidden",name:r.name??"",value:m()}),wp.element.createElement("div",{className:"tf-date-group",...l,ref:i},wp.element.createElement(wy,{...a}),wp.element.createElement(se,{type:"action",...o},"\u{1F5D3}")),n.isOpen&&wp.element.createElement(Rr,{state:n,triggerRef:i,placement:"bottom start"},wp.element.createElement(gs,{...s},wp.element.createElement(iM,{...c}))))});var CG=Object.defineProperty,kG=u((t,e)=>CG(t,"name",{value:e,configurable:!0}),"c$8");const DG=kG(t=>{const[e,n]=wp.element.useState(t.value??"");wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=NI({...t,value:Sh(t.value,i)}),o=wp.element.useRef(null),{labelProps:s,descriptionProps:c,inputProps:d,...f}=pF({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Ss,{...t,value:e,onValueSelection:n,ref:o,inputProps:f.inputProps},wp.element.createElement(SG,{ref:o,minValue:l,name:t.name??"",value:Sh(e),onChange:n,onFocusChange:t.onFocusChange??!1,dynamic:t.dynamic??!1,hasFutureOnly:r,state:a,datePickerProps:{inputProps:d,...f}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"Date");var PG=Object.defineProperty,EG=u((t,e)=>PG(t,"name",{value:e,configurable:!0}),"d$6");const TG=wp.element.forwardRef(({dateRangePickerProps:t,state:e,...n},r)=>{const{dateValue:i}=Ch(),[l,a]=wp.element.useState(i!==null?i.start:"");wp.element.useEffect(()=>{n.value&&n.value!==l&&a(n.value.start)},[n.value]);const{groupProps:o,startFieldProps:s,endFieldProps:c,buttonProps:d,dialogProps:f,calendarProps:h,inputProps:p}=M2(n,e,r),m=EG(()=>e.value&&e.value.start&&e.value.end?JSON.stringify({start:e.value.start.toString(),end:e.value.end.toString()}):"","getStringValue");return wp.element.createElement("div",{className:"tf-date-field-container"},wp.element.createElement("input",{...p,type:"hidden",name:n.name??"",value:m()}),wp.element.createElement("div",{...o,ref:r,className:"tf-date-group"},wp.element.createElement(wy,{...s}),wp.element.createElement("span",{style:{padding:"0 4px"}},"\u2013"),wp.element.createElement(wy,{...c}),e.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}"),wp.element.createElement(se,{type:"action",...d},"\u{1F5D3}")),e.isOpen&&wp.element.createElement(Rr,{state:e,triggerRef:r,placement:"bottom start"},wp.element.createElement(gs,{...f},wp.element.createElement(iM,{...h,dateRange:!0,datePresets:n.datePresets??!1,pageBehavior:"single",multiMonth:n.multiMonth,focusedValue:l,onFocusChange:a}))))});var AG=Object.defineProperty,QG=u((t,e)=>AG(t,"name",{value:e,configurable:!0}),"o$5");const MG=QG(t=>{const{dateValue:e,setDateValue:n}=Ch();wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.useEffect(()=>{e!==t.value&&typeof t.value=="object"&&n(t.value)},[t.value]);const r=t.futureOnly&&t.futureOnly===!0,i=Cr(kr()),l=r?i:new Fe("AD","1","1","1"),a=XI({...t,value:e}),o=wp.element.useRef(),{labelProps:s,descriptionProps:c,...d}=M2({...t,minValue:l},a,o);return wp.element.createElement("div",{className:"tf-date-picker"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement(Ss,{...t,value:e,ref:o},wp.element.createElement(TG,{ref:o,name:t.name??"",minValue:l,value:e,hasFutureOnly:r,onChange:n,onFocusChange:t.onFocusChange??null,state:a,multiMonth:t.multiMonth??1,datePresets:t.datePresets??!1,dateRangePickerProps:{...d}})),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"DateRange");var BG=Object.defineProperty,RG=u((t,e)=>BG(t,"name",{value:e,configurable:!0}),"r$3"),VG=RG(t=>t.dateRange?wp.element.createElement(uG,{value:t.value},wp.element.createElement(MG,{...t})):wp.element.createElement(DG,{...t}),"default"),NG=Object.defineProperty,oM=u((t,e)=>NG(t,"name",{value:e,configurable:!0}),"s$7");const xy={},FG=oM(t=>{const[e,n]=wp.element.useState(t.value??""),[r,i]=wp.element.useState(fi()),l=wp.element.useRef(null),a=wp.element.useRef(null),o=wp.element.useRef(null),{labelProps:s,inputProps:c,descriptionProps:d}=si(t,l);wp.element.useEffect(()=>{xy[r]=VT(l.current,e,n,t.choices)},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]);const f=pi({}),{triggerProps:h,overlayProps:p}=us({type:"dialog"},f,a),m=oM(g=>{xy[r].dispatch({changes:{from:xy[r].state.doc.length,insert:`[[${g}]]`}})},"addDynamicElement");return wp.element.createElement("div",{className:"tf-dynamic-text"},t.label&&wp.element.createElement(xe,{labelProps:s,parent:t},t.label),wp.element.createElement("div",{className:"tf-dynamic-text-field"},wp.element.createElement(gn,null,wp.element.createElement(U9,{label:t.label??!1,name:t.name??"",value:e})),wp.element.createElement("div",{ref:l,className:"tf-dynamic-text-input",...c}),wp.element.createElement(se,{type:"action",ref:a,...h},"Add"),f.isOpen&&wp.element.createElement("div",{className:"tf-dynamic-text-popover",ref:o,...p},wp.element.createElement(xh,{label:"Select dynamic token",labelVisuallyHidden:!0,choices:t.choices??{},autoFocus:!0,showButton:!1,onChange:g=>{g&&(m(g),f.close())},onFocusChange:g=>g?!f.isOpen&&f.open():f.close()}),wp.element.createElement(ds,{onDismiss:f.close}))),t.description&&wp.element.createElement(we,{descriptionProps:d,parent:t},t.description))},"DynamicText");function lt(t){this.content=t}u(lt,"OrderedMap"),lt.prototype={constructor:lt,find:function(t){for(var e=0;e>1}},lt.from=function(t){if(t instanceof lt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new lt(e)};function sM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),l=e.child(r);if(i==l){n+=i.nodeSize;continue}if(!i.sameMarkup(l))return n;if(i.isText&&i.text!=l.text){for(let a=0;i.text[a]==l.text[a];a++)n++;return n}if(i.content.size||l.content.size){let a=sM(i.content,l.content,n+1);if(a!=null)return a}n+=i.nodeSize}}u(sM,"findDiffStart");function uM(t,e,n,r){for(let i=t.childCount,l=e.childCount;;){if(i==0||l==0)return i==l?null:{a:n,b:r};let a=t.child(--i),o=e.child(--l),s=a.nodeSize;if(a==o){n-=s,r-=s;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let c=0,d=Math.min(a.text.length,o.text.length);for(;ce&&r(s,i+o,l||null,a)!==!1&&s.content.size){let d=o+1;s.nodesBetween(Math.max(0,e-d),Math.min(s.content.size,n-d),r,i+d)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let l="",a=!0;return this.nodesBetween(e,n,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,n-s):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&r&&(a?a=!1:l+=r),l+=c},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),l=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),l=1);le)for(let l=0,a=0;ae&&((an)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new st(r,i)}cutByIndex(e,n){return e==n?st.empty:e==0&&n==this.content.length?this:new st(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),l=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new st(i,l)}addToStart(e){return new st([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new st(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),l=r+i.nodeSize;if(l>=e)return l==e?Dh(n+1,l):Dh(n,r);r=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return st.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new st(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return st.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(l)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};u(Cc,"Mark");let ye=Cc;ye.none=[];const s$=class s$ extends Error{};u(s$,"ReplaceError");let eo=s$;const Fi=class Fi{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=dM(this.content,e+this.openStart,n);return r&&new Fi(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Fi(cM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Fi.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Fi(j.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let l=e.firstChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.firstChild)r++;for(let l=e.lastChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.lastChild)i++;return new Fi(e,r,i)}};u(Fi,"Slice");let H=Fi;H.empty=new H(j.empty,0,0);function cM(t,e,n){let{index:r,offset:i}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:o}=t.findIndex(n);if(i==e||l.isText){if(o!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,l.copy(cM(l.content,e-i-1,n-i-1)))}u(cM,"removeRange");function dM(t,e,n,r){let{index:i,offset:l}=t.findIndex(e),a=t.maybeChild(i);if(l==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=dM(a.content,e-l-1,n,a);return o&&t.replaceChild(i,a.copy(o))}u(dM,"insertInto");function IG(t,e,n){if(n.openStart>t.depth)throw new eo("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new eo("Inconsistent open depths");return fM(t,e,n,0)}u(IG,"replace");function fM(t,e,n,r){let i=t.index(r),l=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}u(Cl,"addNode");function Su(t,e,n,r){let i=(e||t).node(n),l=0,a=e?e.index(n):i.childCount;t&&(l=t.index(n),t.depth>n?l++:t.textOffset&&(Cl(t.nodeAfter,r),l++));for(let o=l;oi&&Cy(t,e,i+1),a=r.depth>i&&Cy(n,r,i+1),o=[];return Su(null,t,i,o),l&&a&&e.index(i)==n.index(i)?(hM(l,a),Cl(kl(l,pM(t,e,n,r,i+1)),o)):(l&&Cl(kl(l,Eh(t,e,i+1)),o),Su(e,n,i,o),a&&Cl(kl(a,Eh(n,r,i+1)),o)),Su(r,null,i,o),new j(o)}u(pM,"replaceThreeWay");function Eh(t,e,n){let r=[];if(Su(null,t,n,r),t.depth>n){let i=Cy(t,e,n+1);Cl(kl(i,Eh(t,e,n+1)),r)}return Su(e,null,n,r),new j(r)}u(Eh,"replaceTwoWay");function LG(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let l=n-1;l>=0;l--)i=e.node(l).copy(j.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}u(LG,"prepareSliceForReplace");const kc=class kc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let l=0;l0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new to(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,l=n;for(let a=e;;){let{index:o,offset:s}=a.content.findIndex(l),c=l-s;if(r.push(a,o,i+s),!c||(a=a.child(o),a.isText))break;l=c-1,i+=s+1}return new kc(n,r,l)}static resolveCached(e,n){let r=mM.get(e);if(r)for(let l=0;le&&this.nodesBetween(e,n,l=>(r.isInSet(l.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),gM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,i=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,l),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let s=i;sn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=j.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,i,r);return l.type.checkAttrs(l.attrs),l}},u(Hl,"Node"),Hl);Dl.prototype.text=void 0;const Dc=class Dc extends Dl{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):gM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Dc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Dc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};u(Dc,"TextNode");let Dy=Dc;function gM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}u(gM,"wrapMarks");const Yp=class Yp{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Py(e,n);if(r.next==null)return Yp.empty;let i=OM(r);r.next&&r.err("Unexpected trailing text");let l=UG(KG(i));return GG(l,r),l}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let l=i+(r.validEnd?"*":" ")+" ";for(let a=0;a"+e.indexOf(r.next[a].next);return l}).join(` +`)}};u(Yp,"ContentMatch");let Pl=Yp;Pl.empty=new Pl(!0);const d$=class d${constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};u(d$,"TokenStream");let Py=d$;function OM(t){let e=[];do e.push(XG(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}u(OM,"parseExpr");function XG(t){let e=[];do e.push(jG(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}u(XG,"parseExprSeq");function jG(t){let e=YG(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=qG(t,e);else break;return e}u(jG,"parseExprSubscript");function bM(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}u(bM,"parseNum");function qG(t,e){let n=bM(t),r=n;return t.eat(",")&&(t.next!="}"?r=bM(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}u(qG,"parseExprRange");function WG(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let l in n){let a=n[l];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}u(WG,"resolveName");function YG(t){if(t.eat("(")){let e=OM(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=WG(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}u(YG,"parseExprAtom");function KG(t){let e=[[]];return i(l(t,0),n()),e;function n(){return e.push([])-1}u(n,"node");function r(a,o,s){let c={term:s,to:o};return e[a].push(c),c}u(r,"edge");function i(a,o){a.forEach(s=>s.to=o)}u(i,"connect");function l(a,o){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(l(c,o)),[]);if(a.type=="seq")for(let s=0;;s++){let c=l(a.exprs[s],o);if(s==a.exprs.length-1)return c;i(c,o=n())}else if(a.type=="star"){let s=n();return r(o,s),i(l(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(l(a.expr,o),s),i(l(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(o)].concat(l(a.expr,o));if(a.type=="range"){let s=o;for(let c=0;c{t[a].forEach(({term:o,to:s})=>{if(!o)return;let c;for(let d=0;d{c||i.push([o,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let l=e[r.join(",")]=new Pl(r.indexOf(t.length-1)>-1);for(let a=0;a-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:wM(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Dl(this,this.computeAttrs(e),j.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=j.from(n),this.checkContent(n),new Dl(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=j.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),l=i&&i.fillBefore(j.empty,!0);return l?new Dl(this,e,n.append(l),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[l]=new Ao(l,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let l in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}},u(Ao,"NodeType"),Ao);function _G(t,e,n){let r=n.split("|");return i=>{let l=i===null?"null":typeof i;if(r.indexOf(l)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${l}`)}}u(_G,"validateType");const f$=class f${constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?_G(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}};u(f$,"Attribute");let Ey=f$;const Kp=class Kp{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=SM(e,i.attrs),this.excluded=null;let l=$M(this.attrs);this.instance=l?new ye(this,l):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,wM(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((l,a)=>r[l]=new Kp(l,i++,n,a)),r}removeFromSet(e){for(var n=0;n-1}};u(Kp,"MarkType");let Ah=Kp;const h$=class h${constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=lt.from(e.nodes),n.marks=lt.from(e.marks||{}),this.nodes=CM.compile(this.spec.nodes,this),this.marks=Ah.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let l=this.nodes[i],a=l.spec.content||"",o=l.spec.marks;if(l.contentMatch=r[a]||(r[a]=Pl.parse(a,this.nodes)),l.inlineContent=l.contentMatch.inlineContent,l.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!l.isInline||!l.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=l}l.markSet=o=="_"?null:o?kM(this,o.split(" ")):o==""||!l.inlineContent?[]:null}for(let i in this.marks){let l=this.marks[i],a=l.spec.excludes;l.excluded=a==null?[l]:a==""?[]:kM(this,a.split(" "))}this.nodeFromJSON=i=>Dl.fromJSON(this,i),this.markFromJSON=i=>ye.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof CM){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Dy(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};u(h$,"Schema");let Qh=h$;function kM(t,e){let n=[];for(let r=0;r-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}u(kM,"gatherMarks");function HG(t){return t.tag!=null}u(HG,"isTagRule");function JG(t){return t.style!=null}u(JG,"isStyleRule");const Pc=class Pc{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(HG(i))this.tags.push(i);else if(JG(i)){let l=/[^=]*/.exec(i.style)[0];r.indexOf(l)<0&&r.push(l),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let l=e.nodes[i.node];return l.contentMatch.matchType(l)})}parse(e,n={}){let r=new Mh(this,n,!1);return r.addAll(e,ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Mh(this,n,!0);return r.addAll(e,ye.none,n.from,n.to),H.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(e){let n=[];function r(i){let l=i.priority==null?50:i.priority,a=0;for(;a{r(a=TM(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let l=e.nodes[i].spec.parseDOM;l&&l.forEach(a=>{r(a=TM(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Pc(e,Pc.schemaRules(e)))}};u(Pc,"DOMParser");let Cu=Pc;const DM={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},e_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},PM={ol:!0,ul:!0},ku=1,Ty=2,Du=4;function EM(t,e,n){return e!=null?(e?ku:0)|(e==="full"?Ty:0):t&&t.whitespace=="pre"?ku|Ty:n&~Du}u(EM,"wsOptionsFor");const p$=class p${constructor(e,n,r,i,l,a){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=ye.none,this.match=l||(a&Du?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(j.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ku)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let l=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=l.withText(l.text.slice(0,l.text.length-i[0].length))}}let n=j.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!DM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}};u(p$,"NodeContext");let no=p$;const m$=class m${constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,l,a=EM(null,n.preserveWhitespace,0)|(r?Du:0);i?l=new no(i.type,i.attrs,ye.none,!0,n.topMatch||i.type.contentMatch,a):r?l=new no(null,null,ye.none,!0,null,a):l=new no(e.schema.topNodeType,null,ye.none,!0,null,a),this.nodes=[l],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,l=i.options&Ty?"full":this.localPreserveWS||(i.options&ku)>0;if(l==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(l)l!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` +`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],o=e.previousSibling;(!a||o&&o.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,l=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;PM.hasOwnProperty(a)&&this.parser.normalizeLists&&t_(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(s?s.ignore:e_.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let c,d=this.needsBlock;if(DM.hasOwnProperty(a))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),c=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=s&&s.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(l),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,s,c,s.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!s.clearMark(c)):n=n.concat(this.parser.schema.marks[s.mark].create(s.attrs)),s.consuming===!1)o=s;else break}}return n}addElementByRule(e,n,r,i){let l,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let s=this.enter(a,n.attrs||null,r,n.preserveWhitespace);s&&(l=!0,r=s)}else{let s=this.parser.schema.marks[n.mark];r=r.concat(s.create(n.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(s=>this.insertNode(s,r,!1));else{let s=e;typeof n.contentElement=="string"?s=e.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(e):n.contentElement&&(s=n.contentElement),this.findAround(e,s,!0),this.addAll(s,r),this.findAround(e,s,!1)}l&&this.sync(o)&&this.open--}addAll(e,n,r,i){let l=r||0;for(let a=r?e.childNodes[r]:e.firstChild,o=i==null?null:e.childNodes[i];a!=o;a=a.nextSibling,++l)this.findAtPoint(e,l),this.addDOM(a,n);this.findAtPoint(e,l)}findPlace(e,n,r){let i,l;for(let a=this.open,o=0;a>=0;a--){let s=this.nodes[a],c=s.findWrapping(e);if(c&&(!i||i.length>c.length+o)&&(i=c,l=s,!c.length))break;if(s.solid){if(r)break;o+=2}}if(!i)return null;this.sync(l);for(let a=0;a(a.type?a.type.allowsMarkType(c.type):AM(c.type,e))?(s=c.addToSet(s),!1):!0),this.nodes.push(new no(e,n,s,i,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ku)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),l=-(r?r.depth+1:0)+(i?0:1),a=u((o,s)=>{for(;o>=0;o--){let c=n[o];if(c==""){if(o==n.length-1||o==0)continue;for(;s>=l;s--)if(a(o-1,s))return!0;return!1}else{let d=s>0||s==0&&i?this.nodes[s].type:r&&s>=l?r.node(s-l).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;s--}}return!0},"match");return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};u(m$,"ParseContext");let Mh=m$;function t_(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&PM.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}u(t_,"normalizeList");function n_(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}u(n_,"matches");function TM(t){let e={};for(let n in t)e[n]=t[n];return e}u(TM,"copy");function AM(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let l=[],a=u(o=>{l.push(o);for(let s=0;s{if(l.length||a.marks.length){let o=0,s=0;for(;o=0;i--){let l=this.serializeMark(e.marks[i],e.isInline,n);l&&((l.contentDOM||l.dom).appendChild(r),r=l.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Bh(Ay(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Bh(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Up(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=QM(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return QM(e.marks)}};u(Up,"DOMSerializer");let ro=Up;function QM(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}u(QM,"gatherToDOM");function Ay(t){return t.document||window.document}u(Ay,"doc$1");const MM=new WeakMap;function r_(t){let e=MM.get(t);return e===void 0&&MM.set(t,e=i_(t)),e}u(r_,"suspiciousAttributes");function i_(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let o,s=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let h=f.indexOf(" ");h>0?s.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):f=="style"&&s.style?s.style.cssText=c[f]:s.setAttribute(f,c[f])}}for(let f=d;fd)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:m}=Bh(t,h,n,r);if(s.appendChild(p),m){if(o)throw new RangeError("Multiple content holes");o=m}}}return{dom:s,contentDOM:o}}u(Bh,"renderSpec");const BM=65535,RM=Math.pow(2,16);function l_(t,e){return t+e*RM}u(l_,"makeRecover");function VM(t){return t&BM}u(VM,"recoverIndex");function a_(t){return(t-(t&BM))/RM}u(a_,"recoverOffset");const NM=1,FM=2,Rh=4,IM=8,g$=class g${constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&IM)>0}get deletedBefore(){return(this.delInfo&(NM|Rh))>0}get deletedAfter(){return(this.delInfo&(FM|Rh))>0}get deletedAcross(){return(this.delInfo&Rh)>0}};u(g$,"MapResult");let Pu=g$;const Ii=class Ii{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ii.empty)return Ii.empty}recover(e){let n=0,r=VM(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[o+l],d=this.ranges[o+a],f=s+c;if(e<=f){let h=c?e==s?-1:e==f?1:n:n,p=s+i+(h<0?0:d);if(r)return p;let m=e==(n<0?s:f)?null:l_(o/3,e-s),g=e==s?FM:e==f?NM:Rh;return(n<0?e!=s:e!=f)&&(g|=IM),new Pu(p,g,m)}i+=d-c}return r?e+i:new Pu(e+i,0,null)}touches(e,n){let r=0,i=VM(n),l=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;oe)break;let c=this.ranges[o+l],d=s+c;if(e<=d&&o==i*3)return!0;r+=this.ranges[o+a]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,l=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Ec;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;rl&&s!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,l)}invert(){return new El(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ea(n.pos,r.pos,this.mark)}merge(e){return e instanceof ea&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ea(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ea(n.from,n.to,e.markFromJSON(n.mark))}};u(ea,"AddMarkStep");let Eu=ea;Je.jsonID("addMark",Eu);const ta=class ta extends Je{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new H(My(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,r)}invert(){return new Eu(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ta(n.pos,r.pos,this.mark)}merge(e){return e instanceof ta&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ta(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ta(n.from,n.to,e.markFromJSON(n.mark))}};u(ta,"RemoveMarkStep");let El=ta;Je.jsonID("removeMark",El);const na=class na extends Je{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return at.fromReplace(e,this.pos,this.pos+1,new H(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Qo(n.pos,r.pos,i,l,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Qo(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}};u(Qo,"ReplaceAroundStep");let Pt=Qo;Je.jsonID("replaceAround",Pt);function By(t,e,n){let r=t.resolve(e),i=n-e,l=r.depth;for(;i>0&&l>0&&r.indexAfter(l)==r.node(l).childCount;)l--,i--;if(i>0){let a=r.node(l).maybeChild(r.indexAfter(l));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}u(By,"contentBetween");function o_(t,e,n,r){let i=[],l=[],a,o;t.doc.nodesBetween(e,n,(s,c,d)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let h=Math.max(c,e),p=Math.min(c+s.nodeSize,n),m=r.addToSet(f);for(let g=0;gt.step(s)),l.forEach(s=>t.step(s))}u(o_,"addMark");function s_(t,e,n,r){let i=[],l=0;t.doc.nodesBetween(e,n,(a,o)=>{if(!a.isInline)return;l++;let s=null;if(r instanceof Ah){let c=a.marks,d;for(;d=r.isInSet(c);)(s||(s=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(o+a.nodeSize,n);for(let d=0;dt.step(new El(a.from,a.to,a.style)))}u(s_,"removeMark");function Ry(t,e,n,r=n.contentMatch,i=!0){let l=t.doc.nodeAt(e),a=[],o=e+1;for(let s=0;s=0;s--)t.step(a[s])}u(Ry,"clearIncompatible");function u_(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}u(u_,"canCut");function Au(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),l=t.$from.index(r),a=t.$to.indexAfter(r);if(rn;m--)g||r.index(m)>0?(g=!0,d=j.from(r.node(m).copy(d)),f++):s--;let h=j.empty,p=0;for(let m=l,g=!1;m>n;m--)g||i.after(m+1)=0;a--){if(r.size){let o=n[a].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=j.from(n[a].type.create(n[a].attrs,r))}let i=e.start,l=e.end;t.step(new Pt(i,l,i,l,new H(r,0,0),n.length,!0))}u(h_,"wrap");function p_(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=t.steps.length;t.doc.nodesBetween(e,n,(a,o)=>{let s=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,s)&&m_(t.doc,t.mapping.slice(l).map(o),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}c===!1&&ZM(t,a,o,l),Ry(t,t.mapping.slice(l).map(o,1),r,void 0,c===null);let d=t.mapping.slice(l),f=d.map(o,1),h=d.map(o+a.nodeSize,1);return t.step(new Pt(f,h,f+1,h-1,new H(j.from(r.create(s,null,a.marks)),0,0),1,!0)),c===!0&&zM(t,a,o,l),!1}})}u(p_,"setBlockType$1");function zM(t,e,n,r){e.forEach((i,l)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let s=t.mapping.slice(r).map(n+1+l+a.index);t.replaceWith(s,s+1,e.type.schema.linebreakReplacement.create())}}})}u(zM,"replaceNewlines");function ZM(t,e,n,r){e.forEach((i,l)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+l);t.replaceWith(a,a+1,e.type.schema.text(` +`))}})}u(ZM,"replaceLinebreaks");function m_(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}u(m_,"canChangeType");function g_(t,e,n,r,i){let l=t.doc.nodeAt(e);if(!l)throw new RangeError("No node at given position");n||(n=l.type);let a=n.create(r,null,i||l.marks);if(l.isLeaf)return t.replaceWith(e,e+l.nodeSize,a);if(!n.validContent(l.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Pt(e,e+l.nodeSize,e+1,e+l.nodeSize-1,new H(j.from(a),0,0),1,!0))}u(g_,"setNodeMarkup");function lo(t,e,n=1,r){let i=t.resolve(e),l=i.depth-n,a=r&&r[r.length-1]||i.parent;if(l<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>l;c--,d--){let f=i.node(c),h=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let o=i.indexAfter(l),s=r&&r[0];return i.node(l).canReplaceWith(o,o,s?s.type:i.node(l+1).type)}u(lo,"canSplit");function O_(t,e,n=1,r){let i=t.doc.resolve(e),l=j.empty,a=j.empty;for(let o=i.depth,s=i.depth-n,c=n-1;o>s;o--,c--){l=j.from(i.node(o).copy(l));let d=r&&r[c];a=j.from(d?d.type.create(d.attrs,a):i.node(o).copy(a))}t.step(new Nn(e,e,new H(l.append(a),n,n),!0))}u(O_,"split");function ao(t,e){let n=t.resolve(e),r=n.index();return XM(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}u(ao,"canJoin");function b_(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(l=r.node(i+1),o++,a=r.node(i).maybeChild(o)):(l=r.node(i).maybeChild(o-1),a=r.node(i+1)),l&&!l.isTextblock&&XM(l,a)&&r.node(i).canReplace(o,o+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}u(jM,"joinPoint");function y_(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,l=t.doc.resolve(e-n),a=l.node().type;if(i&&a.inlineContent){let d=a.whitespace=="pre",f=!!a.contentMatch.matchType(i);d&&!f?r=!1:!d&&f&&(r=!0)}let o=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);ZM(t,d.node(),d.before(),o)}a.inlineContent&&Ry(t,e+n-1,a,l.node().contentMatchAt(l.index()),r==null);let s=t.mapping.slice(o),c=s.map(e-n);if(t.step(new Nn(c,s.map(e+n,-1),H.empty,!0)),r===!0){let d=t.doc.resolve(c);zM(t,d.node(),d.before(),t.steps.length)}return t}u(y_,"join");function v_(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let l=r.index(i);if(r.node(i).canReplaceWith(l,l,n))return r.before(i+1);if(l>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let l=r.indexAfter(i);if(r.node(i).canReplaceWith(l,l,n))return r.after(i+1);if(l=0;a--){let o=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(o>0?1:0),c=r.node(a),d=!1;if(l==1)d=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);d=f&&c.canReplaceWith(s,s,f[0])}if(d)return o==0?r.pos:o<0?r.before(a+1):r.after(a+1)}return null}u(qM,"dropPoint");function Ny(t,e,n=e,r=H.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),l=t.resolve(n);return WM(i,l,r)?new Nn(e,n,r):new Fy(i,l,r).fit()}u(Ny,"replaceStep");function WM(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}u(WM,"fitsTrivially");const b$=class b${constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=j.empty;for(let i=0;i<=e.depth;i++){let l=e.node(i);this.frontier.push({type:l.type,match:l.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=j.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let l=this.placed,a=r.depth,o=i.depth;for(;a&&o&&l.childCount==1;)l=l.firstChild.content,a--,o--;let s=new H(l,a,o);return e>-1?new Pt(r.pos,e,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new Nn(r.pos,i.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),l.type.spec.isolating&&i<=r){e=r;break}n=l.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,l=null;r?(l=Iy(this.unplaced.content,r-1).firstChild,i=l.content):i=this.unplaced.content;let a=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:c}=this.frontier[o],d,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(j.from(a),!1)):l&&s.compatibleContent(l.type)))return{sliceDepth:r,frontierDepth:o,parent:l,inject:f};if(n==2&&a&&(d=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:o,parent:l,wrap:d};if(l&&c.matchType(l.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Iy(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new H(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Iy(e,n);if(i.childCount<=1&&n>0){let l=e.size-n<=n+i.size;this.unplaced=new H(Qu(e,n-1,1),n-1,l?n-1:r)}else this.unplaced=new H(Qu(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:l}){for(;this.depth>n;)this.closeFrontierNode();if(l)for(let g=0;g1||s==0||g.content.size)&&(f=O,d.push(YM(g.mark(h.allowedMarks(g.marks)),c==1?s:0,c==o.childCount?p:-1)))}let m=c==o.childCount;m||(p=-1),this.placed=Mu(this.placed,n,j.from(d)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,O=o;g1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],l=n=0;o--){let{match:s,type:c}=this.frontier[o],d=Ly(e,o,c,s,!0);if(!d||d.childCount)continue e}return{depth:n,fit:a,move:l?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Mu(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),l=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,l)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Mu(this.placed,this.depth,j.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(j.empty,!0);n.childCount&&(this.placed=Mu(this.placed,this.frontier.length,n))}};u(b$,"Fitter");let Fy=b$;function Qu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Qu(t.firstChild.content,e-1,n)))}u(Qu,"dropFromFragment");function Mu(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Mu(t.lastChild.content,e-1,n)))}u(Mu,"addToFragment");function Iy(t,e){for(let n=0;n1&&(r=r.replaceChild(0,YM(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(j.empty,!0)))),t.copy(r)}u(YM,"closeNodeStart");function Ly(t,e,n,r,i){let l=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==l.childCount&&!n.compatibleContent(l.type))return null;let o=r.fillBefore(l.content,!0,a);return o&&!$_(n,l.content,a)?o:null}u(Ly,"contentAfterFits");function $_(t,e,n){for(let r=n;r0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(h)>-1?o=h:i.before(h)==p&&a.splice(1,0,-h)}let s=a.indexOf(o),c=[],d=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(c.push(m),p==r.openStart)break;h=m.content}for(let h=d-1;h>=0;h--){let p=c[h],m=w_(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(o)-1)))d=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+d+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=a[h];p<0||(e=i.before(p),n=l.after(p))}}u(x_,"replaceRange");function KM(t,e,n,r,i){if(er){let l=i.contentMatchAt(0),a=l.fillBefore(t).append(t);t=a.append(l.matchFragment(a).fillBefore(j.empty,!0))}return t}u(KM,"closeFragment");function S_(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=v_(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new H(j.from(r),0,0))}u(S_,"replaceRangeWith");function C_(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),l=UM(r,i);for(let a=0;a0&&(s||r.node(o-1).canReplace(r.index(o-1),i.indexAfter(o-1))))return t.delete(r.before(o),i.after(o))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}u(C_,"deleteRange");function UM(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let l=t.start(i);if(le.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(l==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==l-1)&&n.push(i)}return n}u(UM,"coveredDepths");const Mo=class Mo extends Je{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at attribute step's position");let r=Object.create(null);for(let l in n.attrs)r[l]=n.attrs[l];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return at.fromReplace(e,this.pos,this.pos+1,new H(j.from(i),0,n.isLeaf?0:1))}getMap(){return Xr.empty}invert(e){return new Mo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mo(n.pos,n.attr,n.value)}};u(Mo,"AttrStep");let Nh=Mo;Je.jsonID("attr",Nh);const Ac=class Ac extends Je{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return at.ok(r)}getMap(){return Xr.empty}invert(e){return new Ac(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ac(n.attr,n.value)}};u(Ac,"DocAttrStep");let Fh=Ac;Je.jsonID("docAttr",Fh);let oo=(Qc=class extends Error{},u(Qc,"TransformError"),Qc);oo=u(function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},"TransformError"),oo.prototype=Object.create(Error.prototype),oo.prototype.constructor=oo,oo.prototype.name="TransformError";const y$=class y${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Vh}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new oo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=H.empty){let i=Ny(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new H(j.from(r),0,0))}delete(e,n){return this.replace(e,n,H.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return x_(this,e,n,r),this}replaceRangeWith(e,n,r){return S_(this,e,n,r),this}deleteRange(e,n){return C_(this,e,n),this}lift(e,n){return c_(this,e,n),this}join(e,n=1){return y_(this,e,n),this}wrap(e,n){return h_(this,e,n),this}setBlockType(e,n=e,r,i=null){return p_(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return g_(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Nh(e,n,r)),this}setDocAttribute(e,n){return this.step(new Fh(e,n)),this}addNodeMark(e,n){return this.step(new Tu(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof ye)n.isInSet(r.marks)&&this.step(new io(e,n));else{let i=r.marks,l,a=[];for(;l=n.isInSet(i);)a.push(new io(e,l)),i=l.removeFromSet(i);for(let o=a.length-1;o>=0;o--)this.step(a[o])}return this}split(e,n=1,r){return O_(this,e,n,r),this}addMark(e,n,r){return o_(this,e,n,r),this}removeMark(e,n,r){return s_(this,e,n,r),this}clearIncompatible(e,n,r){return Ry(this,e,n,r),this}};u(y$,"Transform");let zy=y$;const Zy=Object.create(null),v$=class v${constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Bu(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;l--){let a=n<0?so(e.node(0),e.node(l),e.before(l+1),e.index(l),n,r):so(e.node(0),e.node(l),e.after(l+1),e.index(l)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Fn(e.node(0))}static atStart(e){return so(e,e,0,0,1)||new Fn(e)}static atEnd(e){return so(e,e,e.content.size,e.childCount,-1)||new Fn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Zy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zy[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}};u(v$,"Selection");let de=v$;de.prototype.visible=!0;const $$=class $${constructor(e,n){this.$from=e,this.$to=n}};u($$,"SelectionRange");let Bu=$$,GM=!1;function _M(t){!GM&&!t.parent.inlineContent&&(GM=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}u(_M,"checkTextSelection");const ra=class ra extends de{constructor(e,n=e){_M(e),_M(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return de.near(r);let i=e.resolve(n.map(this.anchor));return new ra(i.parent.inlineContent?i:r,r)}replace(e,n=H.empty){if(super.replace(e,n),n==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ra&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ih(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ra(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let l=de.findFrom(n,r,!0)||de.findFrom(n,-r,!0);if(l)n=l.$head;else return de.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(de.findFrom(e,-r,!0)||de.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?a=0;a+=i){let o=e.child(a);if(o.isAtom){if(!l&&ae.isSelectable(o))return ae.create(t,n-(i<0?o.nodeSize:0))}else{let s=so(t,o,n+i,i<0?o.childCount:0,i,l);if(s)return s}n+=o.nodeSize*i}return null}u(so,"findSelectionIn");function HM(t,e,n){let r=t.steps.length-1;if(r{a==null&&(a=d)}),t.setSelection(de.near(t.doc.resolve(a),n))}u(HM,"selectionToInsertionEnd");const JM=1,Lh=2,e8=4,w$=class w$ extends zy{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Lh,this}ensureMarks(e){return ye.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Lh)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Lh,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ye.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let l=this.storedMarks;if(!l){let a=this.doc.resolve(n);l=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,l)),this.selection.empty||this.setSelection(de.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=e8,this}get scrolledIntoView(){return(this.updated&e8)>0}};u(w$,"Transaction");let jy=w$;function t8(t,e){return!e||!t?t:t.bind(e)}u(t8,"bind");const x$=class x${constructor(e,n,r){this.name=e,this.init=t8(n.init,r),this.apply=t8(n.apply,r)}};u(x$,"FieldDesc");let Tl=x$;const D_=[new Tl("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Tl("selection",{init(t,e){return t.selection||de.atStart(e.doc)},apply(t){return t.selection}}),new Tl("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Tl("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],S$=class S${constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=D_.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Tl(r.key,r.spec.state,r))})}};u(S$,"Configuration");let Ru=S$;const la=class la{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],l=i.spec.state;l&&l.toJSON&&(n[r]=l.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Ru(e.schema,e.plugins),l=new la(i);return i.fields.forEach(a=>{if(a.name=="doc")l.doc=Dl.fromJSON(e.schema,n.doc);else if(a.name=="selection")l.selection=de.fromJSON(l.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(l.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let o in r){let s=r[o],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,o)){l[a.name]=c.fromJSON.call(s,e,n[o],l);return}}l[a.name]=a.init(e,l)}}),l}};u(la,"EditorState");let qy=la;function n8(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=n8(i,e,{})),n[r]=i}return n}u(n8,"bindProps");const C$=class C${constructor(e){this.spec=e,this.props={},e.props&&n8(e.props,this,this.props),this.key=e.key?e.key.key:r8("plugin")}getState(e){return e[this.key]}};u(C$,"Plugin");let jr=C$;const Wy=Object.create(null);function r8(t){return t in Wy?t+"$"+ ++Wy[t]:(Wy[t]=0,t+"$")}u(r8,"createKey");const k$=class k${constructor(e="key"){this.key=r8(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};u(k$,"PluginKey");let zh=k$;const ot=u(function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},"domIndex"),uo=u(function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},"parentNode");let Yy=null;const qr=u(function(t,e,n){let r=Yy||(Yy=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},"textRange"),P_=u(function(){Yy=null},"clearReusedRange"),Al=u(function(t,e,n,r){return n&&(i8(t,e,n,r,-1)||i8(t,e,n,r,1))},"isEquivalentPosition"),E_=/^(img|br|input|textarea|hr)$/i;function i8(t,e,n,r,i){for(var l;;){if(t==n&&e==r)return!0;if(e==(i<0?0:wn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Vu(t)||E_.test(t.nodeName)||t.contentEditable=="false")return!1;e=ot(t)+(i<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((l=a.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)e+=i;else return!1;else t=a,e=i<0?wn(t):0}else return!1}}u(i8,"scanFor");function wn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}u(wn,"nodeSize");function T_(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=wn(t)}else if(t.parentNode&&!Vu(t))e=ot(t),t=t.parentNode;else return null}}u(T_,"textNodeBefore$1");function A_(t,e){for(;;){if(t.nodeType==3&&e2),Sn=co||(cr?/Mac/.test(cr.platform):!1),R_=cr?/Win/.test(cr.platform):!1,Wr=/Android \d/.test(Ai),Nu=!!l8&&"webkitFontSmoothing"in l8.documentElement.style,V_=Nu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function N_(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}u(N_,"windowRect");function Yr(t,e){return typeof t=="number"?t:t[e]}u(Yr,"getSide");function F_(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}u(F_,"clientRect");function s8(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,l=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=uo(a);continue}let o=a,s=o==l.body,c=s?N_(l):F_(o),d=0,f=0;if(e.topc.bottom-Yr(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Yr(i,"top")-c.top:e.bottom-c.bottom+Yr(i,"bottom")),e.leftc.right-Yr(r,"right")&&(d=e.right-c.right+Yr(i,"right")),d||f)if(s)l.defaultView.scrollBy(d,f);else{let p=o.scrollLeft,m=o.scrollTop;f&&(o.scrollTop+=f),d&&(o.scrollLeft+=d);let g=o.scrollLeft-p,O=o.scrollTop-m;e={left:e.left-g,top:e.top-O,right:e.right-g,bottom:e.bottom-O}}let h=s?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(h))break;a=h=="absolute"?a.offsetParent:uo(a)}}u(s8,"scrollRectIntoView");function I_(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let l=(e.left+e.right)/2,a=n+1;a=n-20){r=o,i=s.top;break}}return{refDOM:r,refTop:i,stack:u8(t.dom)}}u(I_,"storeScrollPos");function u8(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=uo(r));return e}u(u8,"scrollStack");function L_({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;c8(n,r==0?0:r-e)}u(L_,"resetScrollPos");function c8(t,e){for(let n=0;n=o){a=Math.max(m.bottom,a),o=Math.min(m.top,o);let g=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!s&&m.left<=e.left&&m.right>=e.left&&(s=d,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(l=f+1)}}return!n&&s&&(n=s,i=c,r=0),n&&n.nodeType==3?Z_(n,i):!n||r&&n.nodeType==1?{node:t,offset:l}:d8(n,i)}u(d8,"findOffsetInNode");function Z_(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(l.left+l.right)/2?1:0)}}return{node:t,offset:0}}u(Z_,"findOffsetInText");function _y(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}u(_y,"inRect");function X_(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,i,l)}u(j_,"posFromElement");function q_(t,e,n,r){let i=-1;for(let l=e,a=!1;l!=t.dom;){let o=t.docView.nearestDesc(l,!0),s;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((s=o.dom.getBoundingClientRect()).width||s.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!a&&s.left>r.left||s.top>r.top?i=o.posBefore:(!a&&s.right-1?i:t.docView.posFromDOM(e,n,-1)}u(q_,"posFromCaret");function f8(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let c;Nu&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(o=q_(t,r,i,e))}o==null&&(o=j_(t,a,e));let s=t.docView.nearestDesc(a,!0);return{pos:o,inside:s?s.posAtStart-s.border:-1}}u(W_,"posAtCoords");function h8(t){return t.top=0&&i==r.nodeValue.length?(s--,d=1):n<0?s--:c++,Fu(Mi(qr(r,s,c),d),d<0)}if(!t.state.doc.resolve(e-(l||0)).parent.inlineContent){if(l==null&&i&&(n<0||i==wn(r))){let s=r.childNodes[i-1];if(s.nodeType==1)return Hy(s.getBoundingClientRect(),!1)}if(l==null&&i=0)}if(l==null&&i&&(n<0||i==wn(r))){let s=r.childNodes[i-1],c=s.nodeType==3?qr(s,wn(s)-(a?0:1)):s.nodeType==1&&(s.nodeName!="BR"||!s.nextSibling)?s:null;if(c)return Fu(Mi(c,1),!1)}if(l==null&&i=0)}u(p8,"coordsAtPos");function Fu(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}u(Fu,"flattenV");function Hy(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}u(Hy,"flattenH");function m8(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}u(m8,"withFlushedState");function K_(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return m8(t,e,()=>{let{node:l}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let o=t.docView.nearestDesc(l,!0);if(!o)break;if(o.node.isBlock){l=o.contentDOM||o.dom;break}l=o.dom.parentNode}let a=p8(t,i.pos,1);for(let o=l.firstChild;o;o=o.nextSibling){let s;if(o.nodeType==1)s=o.getClientRects();else if(o.nodeType==3)s=qr(o,0,o.nodeValue.length).getClientRects();else continue;for(let c=0;cd.top+1&&(n=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}u(K_,"endOfTextblockVertical");const U_=/[\u0590-\u08ac]/;function G_(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,l=!i,a=i==r.parent.content.size,o=t.domSelection();return o?!U_.test(r.parent.textContent)||!o.modify?n=="left"||n=="backward"?l:a:m8(t,e,()=>{let{focusNode:s,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),h=o.caretBidiLevel;o.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),O=m&&!p.contains(m.nodeType==1?m:m.parentNode)||s==m&&c==g;try{o.collapse(d,f),s&&(s!=d||c!=f)&&o.extend&&o.extend(s,c)}catch{}return h!=null&&(o.caretBidiLevel=h),O}):r.pos==r.start()||r.pos==r.end()}u(G_,"endOfTextblockHorizontal");let g8=null,O8=null,b8=!1;function __(t,e,n){return g8==e&&O8==n?b8:(g8=e,O8=n,b8=n=="up"||n=="down"?K_(t,e,n):G_(t,e,n))}u(__,"endOfTextblock");const Cn=0,y8=1,Ml=2,dr=3,D$=class D${constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Cn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;not(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let l=e;;l=l.parentNode){if(l==this.dom){i=!1;break}if(l.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let l=e;;l=l.parentNode){if(l==this.dom){i=!0;break}if(l.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let l=this.getDesc(i),a;if(l&&(!n||l.node))if(r&&(a=l.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return l}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let l=this.getDesc(i);if(l)return l.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||a instanceof qh){i=e-l;break}l=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let l;r&&!(l=this.children[r-1]).size&&l instanceof Xh&&l.side>=0;r--);if(n<=0){let l,a=!0;for(;l=r?this.children[r-1]:null,!(!l||l.dom.parentNode==this.contentDOM);r--,a=!1);return l&&n&&a&&!l.border&&!l.domAtom?l.domFromPos(l.size,n):{node:this.contentDOM,offset:l?ot(l.dom)+1:0}}else{let l,a=!0;for(;l=r=d&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,n,d);e=a;for(let f=o;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ot(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(c>n||o==this.children.length-1)){n=c;for(let d=o+1;dm&&an){let m=o;o=s,s=m}let p=document.createRange();p.setEnd(s.node,s.offset),p.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let o=r+l.border,s=a-l.border;if(e>=o&&n<=s){this.dirty=e==r||n==a?Ml:y8,e==o&&n==s&&(l.contentLost||l.dom.parentNode!=this.contentDOM)?l.dirty=dr:l.markDirty(e-o,n-o);return}else l.dirty=l.dom==l.contentDOM&&l.dom.parentNode==this.contentDOM&&!l.children.length?Ml:dr}r=a}this.dirty=Ml}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ml:y8;n.dirty{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)})),!n.type.spec.raw){if(a.nodeType!=1){let o=document.createElement("span");o.appendChild(a),a=o}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,l=this}matchesWidget(e){return this.dirty==Cn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}};u(P$,"WidgetViewDesc");let Xh=P$;const E$=class E$ extends Bl{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}};u(E$,"CompositionViewDesc");let Jy=E$;const Mc=class Mc extends Bl{constructor(e,n,r,i,l){super(e,[],r,i),this.mark=n,this.spec=l}static create(e,n,r,i){let l=i.nodeViews[n.type.name],a=l&&l(n,i,r);return(!a||!a.dom)&&(a=ro.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Mc(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&dr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=dr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Cn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(l=r1(l,0,e,r));for(let o=0;o{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),d=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=ro.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let h=d;return d=x8(d,r,n),c?s=new e1(e,n,r,i,d,f||null,h,c,l,a+1):n.isText?new jh(e,n,r,i,d,h,l):new Hp(e,n,r,i,d,f||null,h,l,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>j.empty)}return e}matchesNode(e,n,r){return this.dirty==Cn&&e.eq(this.node)&&Wh(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,l=e.composing?this.localCompositionInfo(e,n):null,a=l&&l.pos>-1?l:null,o=l&&l.pos<0,s=new n1(this,a&&a.node,e);tH(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&s.syncToMarks(d==this.node.childCount?ye.none:this.node.child(d).marks,r,e),s.placeWidget(c,e,i)},(c,d,f,h)=>{s.syncToMarks(c.marks,r,e);let p;s.findNodeMatch(c,d,f,h)||o&&e.state.selection.from>i&&e.state.selection.to-1&&s.updateNodeAt(c,d,f,p,e)||s.updateNextNode(c,d,f,e,h,i)||s.addNode(c,d,f,e,i),i+=c.nodeSize}),s.syncToMarks([],r,e),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Ml)&&(a&&this.protectLocalComposition(e,a),$8(this.contentDOM,this.children,e),co&&nH(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ke)||rn+this.node.content.size)return null;let l=e.input.compositionNode;if(!l||!this.dom.contains(l.parentNode))return null;if(this.node.inlineContent){let a=l.nodeValue,o=rH(this.node.content,a,r-n,i-n);return o<0?null:{node:l,pos:o,text:a}}else return{node:l,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let l=n;for(;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=void 0)}let a=new Jy(this,l,n,i);e.input.compositionNodes.push(a),this.children=r1(this.children,r,r+i.length,e,a)}update(e,n,r,i){return this.dirty==dr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Cn}updateOuterDeco(e){if(Wh(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=w8(this.dom,this.nodeDOM,t1(this.outerDeco,this.node,n),t1(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};u(Hp,"NodeViewDesc");let Bi=Hp;function v8(t,e,n,r,i){x8(r,e,t);let l=new Bi(void 0,t,e,n,r,r,r,i,0);return l.contentDOM&&l.updateChildren(i,0),l}u(v8,"docViewDesc");const Jp=class Jp extends Bi{constructor(e,n,r,i,l,a,o){super(e,n,r,i,l,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==dr||this.dirty!=Cn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Cn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Cn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),l=document.createTextNode(i.text);return new Jp(this.parent,i,this.outerDeco,this.innerDeco,l,l,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=dr)}get domAtom(){return!1}isText(e){return this.node.text==e}};u(Jp,"TextViewDesc");let jh=Jp;const T$=class T$ extends Bl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Cn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}};u(T$,"TrailingHackViewDesc");let qh=T$;const A$=class A$ extends Bi{constructor(e,n,r,i,l,a,o,s,c,d){super(e,n,r,i,l,a,o,c,d),this.spec=s}update(e,n,r,i){if(this.dirty==dr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let l=this.spec.update(e,n,r);return l&&this.updateInner(e,n,r,i),l}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};u(A$,"CustomNodeViewDesc");let e1=A$;function $8(t,e,n){let r=t.firstChild,i=!1;for(let l=0;l>1,a=Math.min(l,e.length);for(;i-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let s=ho.create(this.top,e[l],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,l++}}findNodeMatch(e,n,r,i){let l=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))l=this.top.children.indexOf(a,this.index);else for(let o=this.index,s=Math.min(this.top.children.length,o+5);o0;){let o;for(;;)if(r){let c=n.children[r-1];if(c instanceof ho)n=c,r=c.children.length;else{o=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=o.node;if(s){if(s!=t.child(i-1))break;--i,l.set(o,i),a.push(o)}}return{index:i,matched:l,matches:a.reverse()}}u(J_,"preMatch");function eH(t,e){return t.type.side-e.type.side}u(eH,"compareSide");function tH(t,e,n,r){let i=e.locals(t),l=0;if(i.length==0){for(let c=0;cl;)o.push(i[a++]);let m=l+h.nodeSize;if(h.isText){let O=m;a!O.inline):o.slice();r(h,g,e.forChild(l,h),p),l=m}}u(tH,"iterDeco");function nH(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}u(nH,"iosHacks");function rH(t,e,n,r){for(let i=0,l=0;i=n){if(l>=r&&s.slice(r-e.length-o,r-o)==e)return r-e.length;let c=o=0&&c+e.length+o>=n)return o+c;if(n==r&&s.length>=r+e.length-o&&s.slice(r-o,r-o+e.length)==e)return r}}return-1}u(rH,"findTextInFragment");function r1(t,e,n,r,i){let l=[];for(let a=0,o=0;a=n||d<=e?l.push(s):(cn&&l.push(s.slice(n-c,s.size,r)))}return l}u(r1,"replaceNodes");function i1(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),l=i&&i.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let o=r.resolve(a),s,c;if(Zh(n)){for(s=a;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&ae.isSelectable(f)&&i.parent&&!(f.isInline&&Q_(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new ae(a==h?o:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=a,h=a;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!C8(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}u(iH,"removeClassOnSelectionChange");function lH(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,ot(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Xt&&Qi<=11&&(n.disabled=!0,n.disabled=!1)}u(lH,"selectCursorWrapper");function E8(t,e){if(e instanceof ae){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(T8(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else T8(t)}u(E8,"syncNodeSelection");function T8(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}u(T8,"clearNodeSelection");function a1(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ke.between(e,n,r)}u(a1,"selectionBetween");function A8(t){return t.editable&&!t.hasFocus()?!1:Q8(t)}u(A8,"hasFocusAndSelection");function Q8(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}u(Q8,"hasSelection");function aH(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Al(e.node,e.offset,n.anchorNode,n.anchorOffset)}u(aH,"anchorInRightPlace");function o1(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),l=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return l&&de.findFrom(l,e)}u(o1,"moveSelectionBlock");function Ri(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}u(Ri,"apply");function M8(t,e,n){let r=t.state.selection;if(r instanceof ke)if(n.indexOf("s")>-1){let{$head:i}=r,l=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+l.nodeSize*(e<0?-1:1));return Ri(t,new ke(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=o1(t.state,e);return i&&i instanceof ae?Ri(t,i):!1}else if(!(Sn&&n.indexOf("m")>-1)){let i=r.$head,l=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!l||l.isText)return!1;let o=e<0?i.pos-l.nodeSize:i.pos;return l.isAtom||(a=t.docView.descAt(o))&&!a.contentDOM?ae.isSelectable(l)?Ri(t,new ae(e<0?t.state.doc.resolve(i.pos-l.nodeSize):i)):Nu?Ri(t,new ke(t.state.doc.resolve(e<0?o:o+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ae&&r.node.isInline)return Ri(t,new ke(e>0?r.$to:r.$from));{let i=o1(t.state,e);return i?Ri(t,i):!1}}}u(M8,"selectHorizontally");function Yh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}u(Yh,"nodeLen");function Lu(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}u(Lu,"isIgnorable");function po(t,e){return e<0?oH(t):sH(t)}u(po,"skipIgnoredNodes");function oH(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,l,a=!1;for(xn&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let o=n.childNodes[r-1];if(Lu(o,-1))i=n,l=--r;else if(o.nodeType==3)n=o,r=n.nodeValue.length;else break}}else{if(B8(n))break;{let o=n.previousSibling;for(;o&&Lu(o,-1);)i=n.parentNode,l=ot(o),o=o.previousSibling;if(o)n=o,r=Yh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?s1(t,n,r):i&&s1(t,i,l)}u(oH,"skipIgnoredNodesBefore");function sH(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Yh(n),l,a;for(;;)if(r{t.state==i&&Kr(t)},50)}u(s1,"setSelFocus");function R8(t,e){let n=t.state.doc.resolve(e);if(!(pt||R_)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let l=t.coordsAtPos(e-1),a=(l.top+l.bottom)/2;if(a>i.top&&a1)return l.lefti.top&&a1)return l.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}u(R8,"findDirection");function V8(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||Sn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:l}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=o1(t.state,e);if(a&&a instanceof ae)return Ri(t,a)}if(!i.parent.inlineContent){let a=e<0?i:l,o=r instanceof Fn?de.near(a,e):de.findFrom(a,e);return o?Ri(t,o):!1}return!1}u(V8,"selectVertically");function N8(t,e){if(!(t.state.selection instanceof ke))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let l=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(l&&!l.isText){let a=t.state.tr;return e<0?a.delete(n.pos-l.nodeSize,n.pos):a.delete(n.pos,n.pos+l.nodeSize),t.dispatch(a),!0}return!1}u(N8,"stopNativeHorizontalDelete");function F8(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}u(F8,"switchEditable");function dH(t){if(!Et||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;F8(t,r,"true"),setTimeout(()=>F8(t,r,"false"),20)}return!1}u(dH,"safariDownArrowBug");function fH(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}u(fH,"getMods");function hH(t,e){let n=e.keyCode,r=fH(e);if(n==8||Sn&&n==72&&r=="c")return N8(t,-1)||po(t,-1);if(n==46&&!e.shiftKey||Sn&&n==68&&r=="c")return N8(t,1)||po(t,1);if(n==13||n==27)return!0;if(n==37||Sn&&n==66&&r=="c"){let i=n==37?R8(t,t.state.selection.from)=="ltr"?-1:1:-1;return M8(t,i,r)||po(t,i)}else if(n==39||Sn&&n==70&&r=="c"){let i=n==39?R8(t,t.state.selection.from)=="ltr"?1:-1:1;return M8(t,i,r)||po(t,i)}else{if(n==38||Sn&&n==80&&r=="c")return V8(t,-1,r)||po(t,-1);if(n==40||Sn&&n==78&&r=="c")return dH(t)||V8(t,1,r)||po(t,1);if(r==(Sn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}u(hH,"captureKeyDown");function u1(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:l}=e;for(;i>1&&l>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,l--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=t.someProp("clipboardSerializer")||ro.fromSchema(t.state.schema),o=W8(),s=o.createElement("div");s.appendChild(a.serializeFragment(r,{document:o}));let c=s.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=j8[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let m=o.createElement(d[p]);for(;s.firstChild;)m.appendChild(s.firstChild);s.appendChild(m),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${l}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` -`);return{dom:s,text:h,slice:e}}u(u1,"serializeForClipboard");function IM(t,e,n,r,i){let l=i.parent.type.spec.code,a,o;if(!n&&!e)return null;let s=!!e&&(r||l||!n);if(s){if(t.someProp("transformPastedText",h=>{e=h(e,l||r,t)}),l)return o=new H(j.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0),t.someProp("transformPasted",h=>{o=h(o,t,!0)}),o;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)o=f;else{let h=i.marks(),{schema:p}=t.state,m=ro.fromSchema(p);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let O=a.appendChild(document.createElement("p"));g&&O.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),a=OH(n),Nu&&bH(a);let c=a&&a.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let h=a.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;a=h}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||Cu.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||d),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!pH.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)o=yH(XM(o,+d[1],+d[2]),d[4]);else if(o=H.maxOpen(mH(o.content,i),!0),o.openStart||o.openEnd){let f=0,h=0;for(let p=o.content.firstChild;f{o=f(o,t,s)}),o}u(IM,"parseFromClipboard");const pH=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function mH(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),l,a=[];if(t.forEach(o=>{if(!a)return;let s=i.findWrapping(o.type),c;if(!s)return a=null;if(c=a.length&&l.length&&zM(s,l,o,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=ZM(a[a.length-1],l.length));let d=LM(o,s);a.push(d),i=i.matchType(d.type),l=s}}),a)return j.from(a)}return t}u(mH,"normalizeSiblings");function LM(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,j.from(t));return t}u(LM,"withWrappers");function zM(t,e,n,r,i){if(i1&&(l=0),i=n&&(o=e<0?a.contentMatchAt(0).fillBefore(o,l<=i).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore(j.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(o))}u(c1,"closeRange");function XM(t,e,n){return en})),d1.createHTML(t)):t}u(gH,"maybeWrapTrusted");function OH(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=WM().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&jM[r[1].toLowerCase()])&&(t=i.map(l=>"<"+l+">").join("")+t+i.map(l=>"").reverse().join("")),n.innerHTML=gH(t),i)for(let l=0;l=0;o-=2){let s=n.nodes[r[o]];if(!s||s.hasRequiredAttrs())break;i=j.from(s.create(r[o+1],i)),l++,a++}return new H(i,l,a)}u(yH,"addContext");const Tt={},At={},vH={touchstart:!0,touchmove:!0},M$=class M${constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};u(M$,"InputState");let f1=M$;function $H(t){for(let e in Tt){let n=Tt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{xH(t,r)&&!p1(t,r)&&(t.editable||!(r.type in At))&&n(t,r)},vH[e]?{passive:!0}:void 0)}Et&&t.dom.addEventListener("input",()=>null),h1(t)}u($H,"initInput");function Vi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}u(Vi,"setSelectionOrigin");function wH(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}u(wH,"destroyInput");function h1(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>p1(t,r))})}u(h1,"ensureListeners");function p1(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}u(p1,"runCustomHandler");function xH(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}u(xH,"eventBelongsToView");function SH(t,e){!p1(t,e)&&Tt[e.type]&&(t.editable||!(e.type in At))&&Tt[e.type](t,e)}u(SH,"dispatchEvent"),At.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!KM(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Wr&&pt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),co&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Ql(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||hH(t,n)?n.preventDefault():Vi(t,"key")},At.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},At.keypress=(t,e)=>{let n=e;if(KM(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Sn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),l=u(()=>t.state.tr.insertText(i).scrollIntoView(),"deflt");!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,i,l))&&t.dispatch(l()),n.preventDefault()}};function Kh(t){return{left:t.clientX,top:t.clientY}}u(Kh,"eventCoords");function CH(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}u(CH,"isNear");function m1(t,e,n,r,i){if(r==-1)return!1;let l=t.state.doc.resolve(r);for(let a=l.depth+1;a>0;a--)if(t.someProp(e,o=>a>l.depth?o(t,n,l.nodeAfter,l.before(a),i,!0):o(t,n,l.node(a),l.before(a),i,!1)))return!0;return!1}u(m1,"runHandlerOnContext");function mo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}u(mo,"updateSelection");function kH(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ae.isSelectable(r)?(mo(t,new ae(n),"pointer"),!0):!1}u(kH,"selectClickedLeaf");function DH(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ae&&(r=n.node);let l=t.state.doc.resolve(e);for(let a=l.depth+1;a>0;a--){let o=a>l.depth?l.nodeAfter:l.node(a);if(ae.isSelectable(o)){r&&n.$from.depth>0&&a>=n.$from.depth&&l.before(n.$from.depth+1)==n.$from.pos?i=l.before(n.$from.depth):i=l.before(a);break}}return i!=null?(mo(t,ae.create(t.state.doc,i),"pointer"),!0):!1}u(DH,"selectClickedNode");function PH(t,e,n,r,i){return m1(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(i?DH(t,n):kH(t,n))}u(PH,"handleSingleClick");function EH(t,e,n,r){return m1(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}u(EH,"handleDoubleClick");function TH(t,e,n,r){return m1(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||AH(t,n,r)}u(TH,"handleTripleClick");function AH(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(mo(t,ke.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let l=i.depth+1;l>0;l--){let a=l>i.depth?i.nodeAfter:i.node(l),o=i.before(l);if(a.inlineContent)mo(t,ke.create(r,o+1,o+1+a.content.size),"pointer");else if(ae.isSelectable(a))mo(t,ae.create(r,o),"pointer");else continue;return!0}}u(AH,"defaultTripleClick");function g1(t){return Uh(t)}u(g1,"forceDOMFlush");const YM=Sn?"metaKey":"ctrlKey";Tt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=g1(t),i=Date.now(),l="singleClick";i-t.input.lastClick.time<500&&CH(n,t.input.lastClick)&&!n[YM]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?l="doubleClick":t.input.lastClick.type=="doubleClick"&&(l="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:l,button:n.button};let a=t.posAtCoords(Kh(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new O1(t,a,n,!!r)):(l=="doubleClick"?EH:TH)(t,a.pos,a.inside,n)?n.preventDefault():Vi(t,"pointer"))};const B$=class B${constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[YM],this.allowDefault=r.shiftKey;let l,a;if(n.inside>-1)l=e.state.doc.nodeAt(n.inside),a=n.inside;else{let d=e.state.doc.resolve(n.pos);l=d.parent,a=d.depth?d.before():0}const o=i?null:r.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||c instanceof ae&&c.from<=a&&c.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Vi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Kr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Kh(e))),this.updateAllowDefault(e),this.allowDefault||!n?Vi(this.view,"pointer"):PH(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Et&&this.mightDrag&&!this.mightDrag.node.isAtom||pt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(mo(this.view,de.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Vi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Vi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};u(B$,"MouseDown");let O1=B$;Tt.touchstart=t=>{t.input.lastTouch=Date.now(),g1(t),Vi(t,"pointer")},Tt.touchmove=t=>{t.input.lastTouch=Date.now(),Vi(t,"pointer")},Tt.contextmenu=t=>g1(t);function KM(t,e){return t.composing?!0:Et&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}u(KM,"inOrNearComposition");const QH=Wr?5e3:-1;At.compositionstart=At.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Uh(t,!0),t.markCursor=null;else if(Uh(t,!e.selection.empty),xn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,l=r.focusOffset;i&&i.nodeType==1&&l!=0;){let a=l<0?i.lastChild:i.childNodes[l-1];if(!a)break;if(a.nodeType==3){let o=t.domSelection();o&&o.collapse(a,a.nodeValue.length);break}else i=a,l=-1}}t.input.composing=!0}UM(t,QH)},At.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,UM(t,20))};function UM(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Uh(t),e))}u(UM,"scheduleComposeEnd");function GM(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=BH());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}u(GM,"clearComposition");function MH(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=T_(e.focusNode,e.focusOffset),r=A_(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,l=t.domObserver.lastChangedTextNode;if(n==l||r==l)return l;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}u(MH,"findCompositionNode");function BH(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}u(BH,"timestampFromCustomEvent");function Uh(t,e=!1){if(!(Wr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),GM(t),e||t.docView&&t.docView.dirty){let n=i1(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}u(Uh,"endComposition");function RH(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}u(RH,"captureCopy");const zu=Xt&&Qi<15||co&&V_<604;Tt.copy=At.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let l=zu?null:n.clipboardData,a=r.content(),{dom:o,text:s}=u1(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",o.innerHTML),l.setData("text/plain",s)):RH(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function VH(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}u(VH,"sliceSingleNode");function NH(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Zu(t,r.value,null,i,e):Zu(t,r.textContent,r.innerHTML,i,e)},50)}u(NH,"capturePaste");function Zu(t,e,n,r,i){let l=IM(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",s=>s(t,i,l||H.empty)))return!0;if(!l)return!1;let a=VH(l),o=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(l);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}u(Zu,"doPaste");function _M(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}u(_M,"getText"),At.paste=(t,e)=>{let n=e;if(t.composing&&!Wr)return;let r=zu?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Zu(t,_M(r),r.getData("text/html"),i,n)?n.preventDefault():NH(t,n)};const R$=class R${constructor(e,n,r){this.slice=e,this.move=n,this.node=r}};u(R$,"Dragging");let Gh=R$;const FH=Sn?"altKey":"ctrlKey";function HM(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[FH]}u(HM,"dragMoves"),Tt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,l=i.empty?null:t.posAtCoords(Kh(n)),a;if(!(l&&l.pos>=i.from&&l.pos<=(i instanceof ae?i.to-1:i.to))){if(r&&r.mightDrag)a=ae.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(a=ae.create(t.state.doc,f.posBefore))}}let o=(a||t.state.selection).content(),{dom:s,text:c,slice:d}=u1(t,o);(!n.dataTransfer.files.length||!pt||oM>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(zu?"Text":"text/html",s.innerHTML),n.dataTransfer.effectAllowed="copyMove",zu||n.dataTransfer.setData("text/plain",c),t.dragging=new Gh(d,HM(t,n),a)},Tt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},At.dragover=At.dragenter=(t,e)=>e.preventDefault(),At.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Kh(n));if(!i)return;let l=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",m=>{a=m(a,t,!1)}):a=IM(t,_M(n.dataTransfer),zu?null:n.dataTransfer.getData("text/html"),!1,l);let o=!!(r&&HM(t,n));if(t.someProp("handleDrop",m=>m(t,n,a||H.empty,o))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?q8(t.state.doc,l.pos,a):l.pos;s==null&&(s=l.pos);let c=t.state.tr;if(o){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let d=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,h=c.doc;if(f?c.replaceRangeWith(d,d,a.content.firstChild):c.replaceRange(d,d,a),c.doc.eq(h))return;let p=c.doc.resolve(d);if(f&&ae.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ae(p));else{let m=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((g,O,b,y)=>m=y),c.setSelection(a1(t,p,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Tt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Kr(t)},20))},Tt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Tt.beforeinput=(t,e)=>{if(pt&&Wr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",l=>l(t,Ql(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in At)Tt[t]=At[t];function Xu(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}u(Xu,"compareObjs");const em=class em{constructor(e,n){this.toDOM=e,this.spec=n||Nl,this.side=this.spec.side||0}map(e,n,r,i){let{pos:l,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Ur(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof em&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Xu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};u(em,"WidgetType");let _h=em;const Bc=class Bc{constructor(e,n){this.attrs=e,this.spec=n||Nl}map(e,n,r,i){let l=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return l>=a?null:new Ur(l,a,this)}valid(e,n){return n.from=e&&(!l||l(o.spec))&&r.push(o.copy(o.from+i,o.to+i))}for(let a=0;ae){let o=this.children[a]+1;this.children[a+2].findInner(e-o,n-o,r,i+o,l)}}map(e,n,r){return this==mt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Nl)}mapInner(e,n,r,i,l){let a;for(let o=0;o{let c=s+r,d;if(d=e9(n,o,c)){for(i||(i=this.children.slice());lo&&f.to=e){this.children[o]==e&&(r=this.children[o+2]);break}let l=e+1,a=l+n.content.size;for(let o=0;ol&&s.type instanceof Vl){let c=Math.max(l,s.from)-l,d=Math.min(a,s.to)-l;ci.map(e,n,Nl));return Li.from(r)}forChild(e,n){if(n.isLeaf)return ln.empty;let r=[];for(let i=0;in instanceof ln)?e:e.reduce((n,r)=>n.concat(r instanceof ln?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let O=g-m-(p-h);for(let b=0;by+d-f)continue;let $=o[b]+d-f;p>=$?o[b+1]=h<=$?-2:-1:h>=d&&O&&(o[b]+=O,o[b+1]+=O)}f+=O}),d=n.maps[c].map(d,-1)}let s=!1;for(let c=0;c=r.content.size){s=!0;continue}let h=n.map(t[c+1]+l,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),O=r.maybeChild(m);if(O&&g==f&&g+O.nodeSize==p){let b=o[c+2].mapInner(n,O,d+1,t[c]+l+1,a);b!=mt?(o[c]=f,o[c+1]=p,o[c+2]=b):(o[c+1]=-2,s=!0)}else s=!0}if(s){let c=LH(o,t,e,n,i,l,a),d=Jh(c,r,0,a);e=d.local;for(let f=0;fn&&a.to{let c=e9(t,o,s+n);if(c){l=!0;let d=Jh(c,o,n+s+1,r);d!=mt&&i.push(s,s+o.nodeSize,d)}});let a=JM(l?t9(t):t,-n).sort(Fl);for(let o=0;o0;)e++;t.splice(e,0,n)}u(n9,"insertAhead");function v1(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=mt&&e.push(r)}),t.cursorWrapper&&e.push(ln.create(t.state.doc,[t.cursorWrapper.deco])),Hh.from(e)}u(v1,"viewDecorations");const zH={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ZH=Xt&&Qi<=11,V$=class V${constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}};u(V$,"SelectionState");let $1=V$;const N$=class N${constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new $1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ZH&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,zH)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(AM(this.view)){if(this.suppressingSelectionUpdates)return Kr(this.view);if(Xt&&Qi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Al(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let l=e.focusNode;l;l=uo(l))n.add(l);for(let l=e.anchorNode;l;l=uo(l))if(n.has(l)){r=l;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&AM(e)&&!this.ignoreSelectionChange(r),l=-1,a=-1,o=!1,s=[];if(e.editable)for(let d=0;df.nodeName=="BR");if(d.length==2){let[f,h]=d;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of d){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||qH(e,f)!=p)&&h.remove()}}}let c=null;l<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(l>-1&&(e.docView.markDirty(l,a),XH(e)),this.handleDOMChange(l,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Kr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;O--){let b=r.childNodes[O-1],y=b.pmViewDesc;if(b.nodeName=="BR"&&!y){l=O;break}if(!y||y.size)break}let f=t.state.doc,h=t.someProp("domParser")||Cu.fromSchema(t.state.schema),p=f.resolve(a),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:l,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:YH,context:p});if(c&&c[0].pos!=null){let O=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=O),m={anchor:O+a,head:b+a}}return{doc:g,sel:m,from:a,to:o}}u(WH,"parseBetween");function YH(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Et&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Et&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}u(YH,"ruleFromNode");const KH=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function UH(t,e,n,r,i){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=i1(t,C);if(Q&&!t.state.selection.eq(Q)){if(pt&&Wr&&t.input.lastKeyCode===13&&Date.now()-100B(t,Ql(13,"Enter"))))return;let T=t.state.tr.setSelection(Q);C=="pointer"?T.setMeta("pointer",!0):C=="key"&&T.scrollIntoView(),l&&T.setMeta("composition",l),t.dispatch(T)}return}let a=t.state.doc.resolve(e),o=a.sharedDepth(n);e=a.before(o+1),n=t.state.doc.resolve(n).after(o+1);let s=t.state.selection,c=WH(t,e,n),d=t.state.doc,f=d.slice(c.from,c.to),h,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Wr)&&i.some(C=>C.nodeType==1&&!KH.test(C.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",C=>C(t,Ql(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&s instanceof ke&&!s.empty&&s.$head.sameParent(s.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:s.from,endA:s.to,endB:s.to};else{if(c.sel){let C=a9(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let Q=t.state.tr.setSelection(C);l&&Q.setMeta("composition",l),t.dispatch(Q)}}return}t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Xt&&Qi<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" \xA0"&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),O=c.doc.resolveNoCache(m.endB-c.from),b=d.resolve(m.start),y=g.sameParent(O)&&g.parent.inlineContent&&b.end()>=m.endA;if((co&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!y&&g.posC(t,Ql(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&_H(d,m.start,m.endA,g,O)&&t.someProp("handleKeyDown",C=>C(t,Ql(8,"Backspace")))){Wr&&pt&&t.domObserver.suppressSelectionUpdates();return}pt&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),Wr&&!y&&g.start()!=O.start()&&O.parentOffset==0&&g.depth==O.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,O=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,Ql(13,"Enter"))})},20));let $=m.start,v=m.endA,S=u(C=>{let Q=C||t.state.tr.replace($,v,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let T=a9(t,Q.doc,c.sel);T&&!(pt&&t.composing&&T.empty&&(m.start!=m.endB||t.input.lastChromeDeleteKr(t),20));let C=S(t.state.tr.delete($,v)),Q=d.resolve(m.start).marksAcross(d.resolve(m.endA));Q&&C.ensureMarks(Q),t.dispatch(C)}else if(m.endA==m.endB&&(x=GH(g.parent.content.cut(g.parentOffset,O.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let C=S(t.state.tr);x.type=="add"?C.addMark($,v,x.mark):C.removeMark($,v,x.mark),t.dispatch(C)}else if(g.parent.child(g.index()).isText&&g.index()==O.index()-(O.textOffset?0:1)){let C=g.parent.textBetween(g.parentOffset,O.parentOffset),Q=u(()=>S(t.state.tr.insertText(C,$,v)),"deflt");t.someProp("handleTextInput",T=>T(t,$,v,C,Q))||t.dispatch(Q())}else t.dispatch(S());else t.dispatch(S())}u(UH,"readDOMChange");function a9(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:a1(t,e.resolve(n.anchor),e.resolve(n.head))}u(a9,"resolveSelection");function GH(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,l=r,a,o,s;for(let d=0;dd.mark(o.addToSet(d.marks)),"update");else if(i.length==0&&l.length==1)o=l[0],a="remove",s=u(d=>d.mark(o.removeFromSet(d.marks)),"update");else return null;let c=[];for(let d=0;dn||x1(a,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let l=t.node(r).maybeChild(t.indexAfter(r));for(;l&&!l.isLeaf;)l=l.firstChild,i++}return i}u(x1,"skipClosingAndOpening");function HH(t,e,n,r,i){let l=t.findDiffStart(e,n);if(l==null)return null;let{a,b:o}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let s=Math.max(0,l-Math.min(a,o));r-=a+s-l}if(a=a?l-r:0;l-=s,l&&l=o?l-r:0;l-=s,l&&l=56320&&e<=57343&&n>=55296&&n<=56319}u(o9,"isSurrogatePair");const F$=class F${constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new f1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(f9),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=c9(this),u9(this),this.nodeViews=d9(this),this.docView=vM(this.state.doc,s9(this),v1(this),this.dom,this),this.domObserver=new w1(this,(r,i,l,a)=>UH(this,r,i,l,a)),this.domObserver.start(),$H(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&h1(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(f9),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(GM(this),a=!0),this.state=e;let o=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(o||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=d9(this);eJ(p,this.nodeViews)&&(this.nodeViews=p,l=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&h1(this),this.editable=c9(this),u9(this);let s=v1(this),c=s9(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=l||!this.docView.matchesNode(e.doc,c,s);(f||!e.selection.eq(i.selection))&&(a=!0);let h=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&I_(this);if(a){this.domObserver.stop();let p=f&&(Xt||pt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&JH(i.selection,e.selection);if(f){let m=pt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=MH(this)),(l||!this.docView.update(e.doc,c,s,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=vM(e.doc,c,s,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&aH(this))?Kr(this,p):(EM(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&L_(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ae){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&sM(this,n.getBoundingClientRect(),e)}else sM(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(l))==r.node&&(i=l)}this.dragging=new Gh(e.slice,e.move,i<0?void 0:ae.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;an.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return W_(this,e)}coordsAtPos(e,n=1){return pM(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return __(this,n||this.state,e)}pasteHTML(e,n){return Zu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Zu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return u1(this,e)}destroy(){this.docView&&(wH(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],v1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,P_())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return SH(this,e)}domSelectionRange(){let e=this.domSelection();return e?Et&&this.root.nodeType===11&&M_(this.dom.ownerDocument)==this.dom&&jH(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};u(F$,"EditorView");let ep=F$;ep.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function s9(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ur.node(0,t.state.doc.content.size,e)]}u(s9,"computeDocDeco");function u9(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ur.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}u(u9,"updateCursorWrapper");function c9(t){return!t.someProp("editable",e=>e(t.state)===!1)}u(c9,"getEditable");function JH(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}u(JH,"selectionContextChanged");function d9(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return u(n,"add"),t.someProp("nodeViews",n),t.someProp("markViews",n),e}u(d9,"buildNodeViews");function eJ(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}u(eJ,"changedNodeViews");function f9(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}u(f9,"checkStateComponent");const tJ=["p",0],nJ=["blockquote",0],rJ=["hr"],iJ=["pre",["code",0]],lJ=["br"],aJ={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return tJ}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM(){return nJ}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return rJ}},heading:{attrs:{level:{default:1,validate:"number"}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM(){return iJ}},text:{group:"inline"},image:{inline:!0,attrs:{src:{validate:"string"},alt:{default:null,validate:"string|null"},title:{default:null,validate:"string|null"}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){let{src:e,alt:n,title:r}=t.attrs;return["img",{src:e,alt:n,title:r}]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return lJ}}},oJ=["em",0],sJ=["strong",0],uJ=["code",0],cJ={link:{attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){let{href:e,title:n}=t.attrs;return["a",{href:e,title:n},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return oJ}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return sJ}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return uJ}}},h9=new Qh({nodes:aJ,marks:cJ}),dJ=["ol",0],fJ=["ul",0],hJ=["li",0],pJ={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM(t){return t.attrs.order==1?dJ:["ol",{start:t.attrs.order},0]}},mJ={parseDOM:[{tag:"ul"}],toDOM(){return fJ}},gJ={parseDOM:[{tag:"li"}],toDOM(){return hJ},defining:!0};function S1(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}u(S1,"add");function OJ(t,e,n){return t.append({ordered_list:S1(pJ,{content:"list_item+",group:n}),bullet_list:S1(mJ,{content:"list_item+",group:n}),list_item:S1(gJ,{content:e})})}u(OJ,"addListNodes");function C1(t,e=null){return function(n,r){let{$from:i,$to:l}=n.selection,a=i.blockRange(l);if(!a)return!1;let o=r?n.tr:null;return bJ(o,a,t,e)?(r&&r(o.scrollIntoView()),!0):!1}}u(C1,"wrapInList");function bJ(t,e,n,r=null){let i=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let s=a.resolve(e.start-2);l=new to(s,s,e.depth),e.endIndex=0;d--)l=j.from(n[d].type.create(n[d].attrs,l));t.step(new Pt(e.start-(r?2:0),e.end,e.start,e.end,new H(l,0,0),n.length,!0));let a=0;for(let d=0;d=i.depth-3;b--)f=j.from(i.node(b).copy(f));let p=i.indexAfter(-1){if(O>-1)return!1;b.isTextblock&&b.content.size==0&&(O=y+1)}),O>-1&&g.setSelection(de.near(g.doc.resolve(O))),r(g.scrollIntoView())}return!0}let s=l.pos==i.end()?o.contentMatchAt(0).defaultType:null,c=n.tr.delete(i.pos,l.pos),d=s?[e?{type:t,attrs:e}:null,{type:s}]:void 0;return lo(c.doc,i.pos,2,d)?(r&&r(c.split(i.pos,2,d).scrollIntoView()),!0):!1}}u(vJ,"splitListItem");function $J(t){return function(e,n){let{$from:r,$to:i}=e.selection,l=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==t);return l?n?r.node(l.depth-1).type==t?wJ(e,n,t,l):xJ(e,n,l):!0:!1}}u($J,"liftListItem");function wJ(t,e,n,r){let i=t.tr,l=r.end,a=r.$to.end(r.depth);lg;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let o=n.startIndex==0,s=n.endIndex==i.childCount,c=l.node(-1),d=l.index(-1);if(!c.canReplace(d+(o?0:1),d+1,a.content.append(s?j.empty:j.from(i))))return!1;let f=l.pos,h=f+a.nodeSize;return r.step(new Pt(f-(o?1:0),h+(s?1:0),f+1,h-1,new H((o?j.empty:j.from(i.copy(j.empty))).append(s?j.empty:j.from(i.copy(j.empty))),o?0:1,s?0:1),o?0:1)),e(r.scrollIntoView()),!0}u(xJ,"liftOutOfList");function SJ(t){return function(e,n){let{$from:r,$to:i}=e.selection,l=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(a==0)return!1;let o=l.parent,s=o.child(a-1);if(s.type!=t)return!1;if(n){let c=s.lastChild&&s.lastChild.type==o.type,d=j.from(c?t.create():null),f=new H(j.from(t.create(null,j.from(o.type.create(null,d)))),c?3:1,0),h=l.start,p=l.end;n(e.tr.step(new Pt(h-(c?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}u(SJ,"sinkListItem");const CJ=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),kJ=typeof navigator<"u"&&/Win/.test(navigator.platform);function DJ(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,l,a;for(let o=0;o=n?et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},"slice"),et.prototype.get=u(function(e){if(!(e<0||e>=this.length))return this.getInner(e)},"get"),et.prototype.forEach=u(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},"forEach"),et.prototype.map=u(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(l,a){return i.push(e(l,a))},n,r),i},"map"),et.from=u(function(e){return e instanceof et?e:e&&e.length?new g9(e):et.empty},"from");var g9=function(t){function e(r){t.call(this),this.values=r}u(e,"Leaf"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=u(function(){return this.values},"flatten"),e.prototype.sliceInner=u(function(i,l){return i==0&&l==this.length?this:new e(this.values.slice(i,l))},"sliceInner"),e.prototype.getInner=u(function(i){return this.values[i]},"getInner"),e.prototype.forEachInner=u(function(i,l,a,o){for(var s=l;s=a;s--)if(i(this.values[s],o+s)===!1)return!1},"forEachInvertedInner"),e.prototype.leafAppend=u(function(i){if(this.length+i.length<=tp)return new e(this.values.concat(i.flatten()))},"leafAppend"),e.prototype.leafPrepend=u(function(i){if(this.length+i.length<=tp)return new e(i.flatten().concat(this.values))},"leafPrepend"),n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(et);et.empty=new g9([]);var EJ=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return u(e,"Append"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=u(function(){return this.left.flatten().concat(this.right.flatten())},"flatten"),e.prototype.getInner=u(function(r){return ro&&this.right.forEachInner(r,Math.max(i-o,0),Math.min(this.length,l)-o,a+o)===!1)return!1},"forEachInner"),e.prototype.forEachInvertedInner=u(function(r,i,l,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(r,i-o,Math.max(l,o)-o,a+o)===!1||l=l?this.right.slice(r-l,i-l):this.left.slice(r,l).append(this.right.slice(0,i-l))},"sliceInner"),e.prototype.leafAppend=u(function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},"leafAppend"),e.prototype.leafPrepend=u(function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},"leafPrepend"),e.prototype.appendInner=u(function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},"appendInner"),e}(et);const TJ=500,zi=class zi{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,l;n&&(i=this.remapping(r,this.items.length),l=i.maps.length);let a=e.tr,o,s,c=[],d=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),l=i.maps.length),l--,d.push(f);return}if(i){d.push(new fr(f.map));let p=f.step.map(i.slice(l)),m;p&&a.maybeStep(p).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],c.push(new fr(m,void 0,void 0,c.length+d.length))),l--,m&&i.appendMap(m,l)}else a.maybeStep(f.step);if(f.selection)return o=i?f.selection.map(i.slice(l)):f.selection,s=new zi(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,n,r,i){let l=[],a=this.eventCount,o=this.items,s=!i&&o.length?o.get(o.length-1):null;for(let d=0;dQJ&&(o=AJ(o,c),a-=c),new zi(o.append(l),a)}remapping(e,n){let r=new Vh;return this.items.forEach((i,l)=>{let a=i.mirrorOffset!=null&&l-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new zi(this.items.append(e.map(n=>new fr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),l=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach(h=>{h.selection&&o--},i);let s=n;this.items.forEach(h=>{let p=l.getMirror(--s);if(p==null)return;a=Math.min(a,p);let m=l.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),O=h.selection&&h.selection.map(l.slice(s+1,p));O&&o++,r.push(new fr(m,g,O))}else r.push(new fr(m))},i);let c=[];for(let h=n;hTJ&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],l=0;return this.items.forEach((a,o)=>{if(o>=e)i.push(a),a.selection&&l++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let d=a.selection&&a.selection.map(n.slice(r));d&&l++;let f=new fr(c.invert(),s,d),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else a.map&&r--},this.items.length,0),new zi(et.from(i.reverse()),l)}};u(zi,"Branch");let Il=zi;Il.empty=new Il(et.empty,0);function AJ(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}u(AJ,"cutOffEvents");const nm=class nm{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new nm(n.getMap().invert(),n,this.selection)}}};u(nm,"Item");let fr=nm;const I$=class I${constructor(e,n,r,i,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=l}};u(I$,"HistoryState");let hr=I$;const QJ=20;function MJ(t,e,n,r){let i=n.getMeta(Ll),l;if(i)return i.historyState;n.getMeta(VJ)&&(t=new hr(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Ll))return a.getMeta(Ll).redo?new hr(t.done.addTransform(n,void 0,r,np(e)),t.undone,O9(n.mapping.maps),t.prevTime,t.prevComposition):new hr(t.done,t.undone.addTransform(n,void 0,r,np(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),s=t.prevTime==0||!a&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!BJ(n,t.prevRanges)),c=a?D1(t.prevRanges,n.mapping):O9(n.mapping.maps);return new hr(t.done.addTransform(n,s?e.selection.getBookmark():void 0,r,np(e)),Il.empty,c,n.time,o??t.prevComposition)}else return(l=n.getMeta("rebased"))?new hr(t.done.rebased(n,l),t.undone.rebased(n,l),D1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new hr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),D1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}u(MJ,"applyTransaction");function BJ(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let l=0;l=e[l]&&(n=!0)}),n}u(BJ,"isAdjacentTo");function O9(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,l,a)=>e.push(l,a));return e}u(O9,"rangesFor");function D1(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=Ll.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let l=RJ(i,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}u(y9,"buildCommand");const rp=y9(!1,!0),ju=y9(!0,!0),v9=u((t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),"deleteSelection");function FJ(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}u(FJ,"atBlockStart");const IJ=u((t,e,n)=>{let r=FJ(t,n);if(!r)return!1;let i=$9(r);if(!i){let a=r.blockRange(),o=a&&Au(a);return o==null?!1:(e&&e(t.tr.lift(a,o).scrollIntoView()),!0)}let l=i.nodeBefore;if(S9(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Oo(l,"end")||ae.isSelectable(l)))for(let a=r.depth;;a--){let o=Ny(t.doc,r.before(a),r.after(a),H.empty);if(o&&o.slice.size1)break}return l.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-l.nodeSize,i.pos).scrollIntoView()),!0):!1},"joinBackward");function Oo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}u(Oo,"textblockAt");const LJ=u((t,e,n)=>{let{$head:r,empty:i}=t.selection,l=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;l=$9(r)}let a=l&&l.nodeBefore;return!a||!ae.isSelectable(a)?!1:(e&&e(t.tr.setSelection(ae.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)},"selectNodeBackward");function $9(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}u($9,"findCutBefore");function zJ(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=zJ(t,n);if(!r)return!1;let i=w9(r);if(!i)return!1;let l=i.nodeAfter;if(S9(t,i,e,1))return!0;if(r.parent.content.size==0&&(Oo(l,"start")||ae.isSelectable(l))){let a=Ny(t.doc,r.before(),r.after(),H.empty);if(a&&a.slice.size{let{$head:r,empty:i}=t.selection,l=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof ae,i;if(r){if(n.node.isTextblock||!ao(t.doc,n.from))return!1;i=n.from}else if(i=j8(t.doc,n.from,-1),i==null)return!1;if(e){let l=t.tr.join(i);r&&l.setSelection(ae.create(l.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},"joinUp"),jJ=u((t,e)=>{let n=t.selection,r;if(n instanceof ae){if(n.node.isTextblock||!ao(t.doc,n.to))return!1;r=n.to}else if(r=j8(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},"joinDown"),T1=u((t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),l=i&&Au(i);return l==null?!1:(e&&e(t.tr.lift(i,l).scrollIntoView()),!0)},"lift"),qJ=u((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)},"newlineInCode");function A1(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),l=n.indexAfter(-1),a=A1(i.contentMatchAt(l));if(!a||!i.canReplaceWith(l,l,a))return!1;if(e){let o=n.after(),s=t.tr.replaceWith(o,o,a.createAndFill());s.setSelection(de.near(s.doc.resolve(o),1)),e(s.scrollIntoView())}return!0},"exitCode"),WJ=u((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let l=A1(i.parent.contentMatchAt(i.indexAfter()));if(!l||!l.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let l=n.before();if(lo(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Au(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},"liftEmptyBlock");function KJ(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ae&&e.selection.node.isBlock)return!r.parentOffset||!lo(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,o,s=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){s=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),o=A1(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let g=t&&t(i.parent,s,r);l.unshift(g||(s&&o?{type:o}:null)),a=p;break}else{if(p==1)return!1;l.unshift(null)}let d=e.tr;(e.selection instanceof ke||e.selection instanceof Fn)&&d.deleteSelection();let f=d.mapping.map(r.pos),h=lo(d.doc,f,l.length,l);if(h||(l[0]=o?{type:o}:null,h=lo(d.doc,f,l.length,l)),!h)return!1;if(d.split(f,l.length,l),!s&&c&&r.node(a).type!=o){let p=d.mapping.map(r.before(a)),m=d.doc.resolve(p);o&&r.node(a-1).canReplaceWith(m.index(),m.index()+1,o)&&d.setNodeMarkup(d.mapping.map(r.before(a)),o)}return n&&n(d.scrollIntoView()),!0}}u(KJ,"splitBlockAs");const UJ=KJ(),Q1=u((t,e)=>{let{$from:n,to:r}=t.selection,i,l=n.sharedDepth(r);return l==0?!1:(i=n.before(l),e&&e(t.tr.setSelection(ae.create(t.doc,i))),!0)},"selectParentNode"),GJ=u((t,e)=>(e&&e(t.tr.setSelection(new Fn(t.doc))),!0),"selectAll");function _J(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,l=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(l,l+1)||!(i.isTextblock||ao(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}u(_J,"joinMaybeClear");function S9(t,e,n,r){let i=e.nodeBefore,l=e.nodeAfter,a,o,s=i.type.spec.isolating||l.type.spec.isolating;if(!s&&_J(t,e,n))return!0;let c=!s&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(l.type))&&o.matchType(a[0]||l.type).validEnd){if(n){let p=e.pos+l.nodeSize,m=j.empty;for(let b=a.length-1;b>=0;b--)m=j.from(a[b].create(null,m));m=j.from(i.copy(m));let g=t.tr.step(new Pt(e.pos-1,p,e.pos,p,new H(m,1,0),a.length,!0)),O=g.doc.resolve(p+2*a.length);O.nodeAfter&&O.nodeAfter.type==i.type&&ao(g.doc,O.pos)&&g.join(O.pos),n(g.scrollIntoView())}return!0}let d=l.type.spec.isolating||r>0&&s?null:de.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),h=f&&Au(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(c&&Oo(l,"start",!0)&&Oo(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=l,O=1;for(;!g.isTextblock;g=g.firstChild)O++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=j.empty;for(let $=m.length-1;$>=0;$--)b=j.from(m[$].copy(b));let y=t.tr.step(new Pt(e.pos-m.length,e.pos+l.nodeSize,e.pos+O,e.pos+l.nodeSize-O,new H(b,m.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}u(S9,"deleteBarrier");function C9(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,l=i.depth;for(;i.node(l).isInline;){if(!l)return!1;l--}return i.node(l).isTextblock?(n&&n(e.tr.setSelection(ke.create(e.doc,t<0?i.start(l):i.end(l)))),!0):!1}}u(C9,"selectTextblockSide");const HJ=C9(-1),JJ=C9(1);function M1(t,e=null){return function(n,r){let{$from:i,$to:l}=n.selection,a=i.blockRange(l),o=a&&Vy(a,t,e);return o?(r&&r(n.tr.wrap(a,o).scrollIntoView()),!0):!1}}u(M1,"wrapIn");function ip(t,e=null){return function(n,r){let i=!1;for(let l=0;l{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(t,e)))if(s.type==t)i=!0;else{let d=n.doc.resolve(c),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let l=n.tr;for(let a=0;a{if(o||!r&&s.isAtom&&s.isInline&&c>=l.pos&&c+s.nodeSize<=a.pos)return!1;o=s.inlineContent&&s.type.allowsMarkType(n)}),o)return!0}return!1}u(eee,"markApplies");function tee(t){let e=[];for(let n=0;n{if(l.isAtom&&l.content.size&&l.isInline&&a>=r.pos&&a+l.nodeSize<=i.pos)return a+1>r.pos&&e.push(new Bu(r,r.doc.resolve(a+1))),r=r.doc.resolve(a+1+l.content.size),!1}),r.posa.doc.rangeHasMark(p.$from.pos,p.$to.pos,t)):f=!d.every(p=>{let m=!1;return h.doc.nodesBetween(p.$from.pos,p.$to.pos,(g,O,b)=>{if(m)return!1;m=!t.isInSet(g.marks)&&!!b&&b.type.allowsMarkType(t)&&!(g.isText&&/^\s*$/.test(g.textBetween(Math.max(0,p.$from.pos-O),Math.min(g.nodeSize,p.$to.pos-O))))}),!m});for(let p=0;p{let l=u(a=>{this[i](a)},"handler");return e.dom.addEventListener(i,l),{name:i,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,l=i.getBoundingClientRect(),a=l.width/i.offsetWidth,o=l.height/i.offsetHeight;if(n){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let O=this.width/2*o;r={left:m.left,right:m.right,top:g-O,bottom:g+O}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!s||s==document.body&&getComputedStyle(s).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=s.getBoundingClientRect(),h=f.width/s.offsetWidth,p=f.height/s.offsetHeight;c=f.left-s.scrollLeft*h,d=f.top-s.scrollTop*p}this.element.style.left=(r.left-c)/a+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,l=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!l){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=q8(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};u(L$,"DropCursorView");let R1=L$;const br=class br extends de{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return br.valid(r)?new br(r):de.near(r)}content(){return H.empty}eq(e){return e instanceof br&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new br(e.resolve(n.pos))}getBookmark(){return new V1(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!iee(e)||!lee(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&br.valid(e))return e;let i=e.pos,l=null;for(let a=e.depth;;a--){let o=e.node(a);if(n>0?e.indexAfter(a)0){l=o.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let s=e.doc.resolve(i);if(br.valid(s))return s}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!ae.isSelectable(l)){e=e.doc.resolve(i+l.nodeSize*n),r=!1;continue e}break}l=a,i+=n;let o=e.doc.resolve(i);if(br.valid(o))return o}return null}}};u(br,"GapCursor");let gt=br;gt.prototype.visible=!1,gt.findFrom=gt.findGapCursorFrom,de.jsonID("gapcursor",gt);const rm=class rm{constructor(e){this.pos=e}map(e){return new rm(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return gt.valid(n)?new gt(n):de.near(n)}};u(rm,"GapBookmark");let V1=rm;function P9(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}u(P9,"needsGap");function iee(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||P9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(iee,"closedBefore");function lee(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||P9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(lee,"closedAfter");function aee(){return new jr({props:{decorations:cee,createSelectionBetween(t,e,n){return e.pos==n.pos&>.valid(n)?new gt(n):null},handleClick:see,handleKeyDown:oee,handleDOMEvents:{beforeinput:uee}}})}u(aee,"gapCursor");const oee=m9({ArrowLeft:ap("horiz",-1),ArrowRight:ap("horiz",1),ArrowUp:ap("vert",-1),ArrowDown:ap("vert",1)});function ap(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,l){let a=r.selection,o=e>0?a.$to:a.$from,s=a.empty;if(a instanceof ke){if(!l.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=r.doc.resolve(e>0?o.after():o.before())}let c=gt.findGapCursorFrom(o,e,s);return c?(i&&i(r.tr.setSelection(new gt(c))),!0):!1}}u(ap,"arrow");function see(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!gt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new gt(r))),!0)}u(see,"handleClick");function uee(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof gt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=j.empty;for(let a=r.length-1;a>=0;a--)i=j.from(r[a].createAndFill(null,i));let l=t.state.tr.replace(n.pos,n.pos,new H(i,0,0));return l.setSelection(ke.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}u(uee,"beforeinput");function cee(t){if(!(t.selection instanceof gt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ln.create(t.doc,[Ur.widget(t.selection.head,e,{key:"gapcursor"})])}u(cee,"drawGapCursor");const qu="http://www.w3.org/2000/svg",dee="http://www.w3.org/1999/xlink",N1="ProseMirror-icon";function fee(t){let e=0;for(let n=0;n{l.preventDefault(),r.classList.contains(jt+"-disabled")||n.run(e.state,e.dispatch,e,l)});function i(l){if(n.select){let o=n.select(l);if(r.style.display=o?"":"none",!o)return!1}let a=!0;if(n.enable&&(a=n.enable(l)||!1,L1(r,jt+"-disabled",!a)),n.active){let o=a&&n.active(l)||!1;L1(r,jt+"-active",o)}return!0}return u(i,"update"),{dom:r,update:i}}};u(z$,"MenuItem");let an=z$;function Wu(t,e){return t._props.translate?t._props.translate(e):e}u(Wu,"translate");let Yu={time:0,node:null};function E9(t){Yu.time=Date.now(),Yu.node=t.target}u(E9,"markMenuEvent");function T9(t){return Date.now()-100{a&&a.close()&&(a=null,r.removeEventListener("mousedown",o))},"close");i.addEventListener("mousedown",d=>{d.preventDefault(),E9(d),a?s():(a=this.expand(l,n.dom),r.addEventListener("mousedown",o=u(()=>{T9(l)||s()},"listeningOnClose")))});function c(d){let f=n.update(d);return l.style.display=f?"":"none",f}return u(c,"update"),{dom:l,update:c}}expand(e,n){let r=_t("div",{class:jt+"-dropdown-menu "+(this.options.class||"")},n),i=!1;function l(){return i?!1:(i=!0,e.removeChild(r),!0)}return u(l,"close"),e.appendChild(r),{close:l,node:r}}};u(Z$,"Dropdown");let op=Z$;function A9(t,e){let n=[],r=[];for(let i=0;i{let r=!1;for(let i=0;i{s.preventDefault(),E9(s),L1(l,jt+"-submenu-wrap-active",!1),a||r.addEventListener("mousedown",a=u(()=>{T9(l)||(l.classList.remove(jt+"-submenu-wrap-active"),r.removeEventListener("mousedown",a),a=null)},"listeningOnClose"))});function o(s){let c=n.update(s);return l.style.display=c?"":"none",c}return u(o,"update"),{dom:l,update:o}}};u(X$,"DropdownSubmenu");let F1=X$;function M9(t,e){let n=document.createDocumentFragment(),r=[],i=[];for(let a=0;aE1(t),icon:kn.join}),Oee=new an({title:"Lift out of enclosing block",run:T1,select:t=>T1(t),icon:kn.lift}),bee=new an({title:"Select parent node",run:Q1,select:t=>Q1(t),icon:kn.selectParentNode});let yee=new an({title:"Undo last change",run:rp,enable:t=>rp(t),icon:kn.undo}),vee=new an({title:"Redo last undone change",run:ju,enable:t=>ju(t),icon:kn.redo});function $ee(t,e){let n={run(r,i){return M1(t,e.attrs)(r,i)},select(r){return M1(t,e.attrs)(r)}};for(let r in e)n[r]=e[r];return new an(n)}u($ee,"wrapItem");function I1(t,e){let n=ip(t,e.attrs),r={run:n,enable(i){return n(i)},active(i){let{$from:l,to:a,node:o}=i.selection;return o?o.hasMarkup(t,e.attrs):a<=l.end()&&l.parent.hasMarkup(t,e.attrs)}};for(let i in e)r[i]=e[i];return new an(r)}u(I1,"blockTypeItem");function L1(t,e,n){n?t.classList.add(e):t.classList.remove(e)}u(L1,"setClass");const sp="ProseMirror-menubar";function wee(){if(typeof navigator>"u")return!1;let t=navigator.userAgent;return!/Edge\/\d/.test(t)&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t)}u(wee,"isIOS");function xee(t){return new jr({view(e){return new z1(e,t)}})}u(xee,"menuBar");const j$=class j${constructor(e,n){this.editorView=e,this.options=n,this.spacer=null,this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.scrollHandler=null,this.root=e.root,this.wrapper=_t("div",{class:sp+"-wrapper"}),this.menu=this.wrapper.appendChild(_t("div",{class:sp})),this.menu.className=sp,e.dom.parentNode&&e.dom.parentNode.replaceChild(this.wrapper,e.dom),this.wrapper.appendChild(e.dom);let{dom:r,update:i}=M9(this.editorView,this.options.content);if(this.contentUpdate=i,this.menu.appendChild(r),this.update(),n.floating&&!wee()){this.updateFloat();let l=kee(this.wrapper);this.scrollHandler=a=>{let o=this.editorView.root;(o.body||o).contains(this.wrapper)?this.updateFloat(a.target.getBoundingClientRect?a.target:void 0):l.forEach(s=>s.removeEventListener("scroll",this.scrollHandler))},l.forEach(a=>a.addEventListener("scroll",this.scrollHandler))}}update(){if(this.editorView.root!=this.root){let{dom:e,update:n}=M9(this.editorView,this.options.content);this.contentUpdate=n,this.menu.replaceChild(e,this.menu.firstChild),this.root=this.editorView.root}this.contentUpdate(this.editorView.state),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))}updateScrollCursor(){let e=this.editorView.root.getSelection();if(!e.focusNode)return;let n=e.getRangeAt(0).getClientRects(),r=n[See(e)?0:n.length-1];if(!r)return;let i=this.menu.getBoundingClientRect();if(r.topi.top){let l=Cee(this.wrapper);l&&(l.scrollTop-=i.bottom-r.top)}}updateFloat(e){let n=this.wrapper,r=n.getBoundingClientRect(),i=e?Math.max(0,e.getBoundingClientRect().top):0;if(this.floating)if(r.top>=i||r.bottom(this.editorView.dom.ownerDocument.defaultView||window).innerHeight?"none":"",e&&(this.menu.style.top=i+"px")}else if(r.top=this.menu.offsetHeight+10){this.floating=!0;let l=this.menu.getBoundingClientRect();this.menu.style.left=l.left+"px",this.menu.style.width=l.width+"px",e&&(this.menu.style.top=i+"px"),this.menu.style.position="fixed",this.spacer=_t("div",{class:sp+"-spacer",style:`height: ${l.height}px`}),n.insertBefore(this.spacer,this.menu)}}destroy(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)}};u(j$,"MenuBarView");let z1=j$;function See(t){return t.anchorNode==t.focusNode?t.anchorOffset>t.focusOffset:t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}u(See,"selectionIsInverted");function Cee(t){for(let e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}u(Cee,"findWrappingScrollable");function kee(t){let e=[t.ownerDocument.defaultView||window];for(let n=t.parentNode;n;n=n.parentNode)e.push(n);return e}u(kee,"getAllWrapping");const q$=class q${constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?Dee(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}};u(q$,"InputRule");let pr=q$;function Dee(t){return function(e,n,r,i){let l=t;if(n[1]){let a=n[0].lastIndexOf(n[1]);l+=n[0].slice(a+n[1].length),r+=a;let o=r-i;o>0&&(l=n[0].slice(a-o,a)+l,r=i)}return e.tr.insertText(l,r,i)}}u(Dee,"stringHandler");const Pee=500;function Eee({rules:t}){let e=new jr({state:{init(){return null},apply(n,r){let i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,l){return B9(n,r,i,l,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&B9(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}u(Eee,"inputRules");function B9(t,e,n,r,i,l){if(t.composing)return!1;let a=t.state,o=a.doc.resolve(e),s=o.parent.textBetween(Math.max(0,o.parentOffset-Pee),o.parentOffset,null,"\uFFFC")+r;for(let c=0;cm.type.spec.code))continue;if(o.parent.type.spec.code){if(!d.inCode)continue}else if(d.inCode==="only")continue;let f=d.match.exec(s);if(!f||f[0].length{g.isInline&&g.marks.some(O=>O.type.spec.code)&&(m=!0)}),m)continue}let p=d.handler(a,f,h,n);if(p)return d.undoable&&p.setMeta(l,{transform:p,from:e,to:n,text:r}),t.dispatch(p),!0}return!1}u(B9,"run");const Tee=u((t,e)=>{let n=t.plugins;for(let r=0;r=0;s--)a.step(o.steps[s].invert(o.docs[s]));if(l.text){let s=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,s))}else a.delete(l.from,l.to);e(a)}return!0}}return!1},"undoInputRule"),Aee=new pr(/--$/,"\u2014",{inCodeMark:!1}),Qee=new pr(/\.\.\.$/,"\u2026",{inCodeMark:!1}),Mee=new pr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C",{inCodeMark:!1}),Bee=new pr(/"$/,"\u201D",{inCodeMark:!1}),Ree=new pr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),Vee=new pr(/'$/,"\u2019",{inCodeMark:!1}),Nee=[Mee,Bee,Ree,Vee];function Z1(t,e,n=null,r){return new pr(t,(i,l,a,o)=>{let s=n instanceof Function?n(l):n,c=i.tr.delete(a,o),d=c.doc.resolve(a),f=d.blockRange(),h=f&&Vy(f,e,s);if(!h)return null;c.wrap(f,h);let p=c.doc.resolve(a-1).nodeBefore;return p&&p.type==e&&ao(c.doc,a-1)&&(!r||r(l,p))&&c.join(a-1),c})}u(Z1,"wrappingInputRule");function R9(t,e,n=null){return new pr(t,(r,i,l,a)=>{let o=r.doc.resolve(l),s=n instanceof Function?n(i):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e)?r.tr.delete(l,a).setBlockType(l,l,e,s):null})}u(R9,"textblockTypeInputRule");const up="ProseMirror-prompt";function V9(t){let e=document.body.appendChild(document.createElement("div"));e.className=up;let n=u(h=>{e.contains(h.target)||r()},"mouseOutside");setTimeout(()=>window.addEventListener("mousedown",n),50);let r=u(()=>{window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},"close"),i=[];for(let h in t.fields)i.push(t.fields[h].render());let l=document.createElement("button");l.type="submit",l.className=up+"-submit",l.textContent="OK";let a=document.createElement("button");a.type="button",a.className=up+"-cancel",a.textContent="Cancel",a.addEventListener("click",r);let o=e.appendChild(document.createElement("form"));t.title&&(o.appendChild(document.createElement("h5")).textContent=t.title),i.forEach(h=>{o.appendChild(document.createElement("div")).appendChild(h)});let s=o.appendChild(document.createElement("div"));s.className=up+"-buttons",s.appendChild(l),s.appendChild(document.createTextNode(" ")),s.appendChild(a);let c=e.getBoundingClientRect();e.style.top=(window.innerHeight-c.height)/2+"px",e.style.left=(window.innerWidth-c.width)/2+"px";let d=u(()=>{let h=Fee(t.fields,i);h&&(r(),t.callback(h))},"submit");o.addEventListener("submit",h=>{h.preventDefault(),d()}),o.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),r()):h.keyCode==13&&!(h.ctrlKey||h.metaKey||h.shiftKey)?(h.preventDefault(),d()):h.keyCode==9&&window.setTimeout(()=>{e.contains(document.activeElement)||r()},500)});let f=o.elements[0];f&&f.focus()}u(V9,"openPrompt");function Fee(t,e){let n=Object.create(null),r=0;for(let i in t){let l=t[i],a=e[r++],o=l.read(a),s=l.validate(o);if(s)return Iee(a,s),null;n[i]=l.clean(o)}return n}u(Fee,"getValues");function Iee(t,e){let n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout(()=>n.removeChild(r),1500)}u(Iee,"reportInvalid");const W$=class W${constructor(e){this.options=e}read(e){return e.value}validateType(e){return null}validate(e){return!e&&this.options.required?"Required field":this.validateType(e)||(this.options.validate?this.options.validate(e):null)}clean(e){return this.options.clean?this.options.clean(e):e}};u(W$,"Field");let X1=W$;const Y$=class Y$ extends X1{render(){let e=document.createElement("input");return e.type="text",e.placeholder=this.options.label,e.value=this.options.value||"",e.autocomplete="off",e}};u(Y$,"TextField");let zl=Y$;function N9(t,e){let n=t.selection.$from;for(let r=n.depth;r>=0;r--){let i=n.index(r);if(n.node(r).canReplaceWith(i,i,e))return!0}return!1}u(N9,"canInsert");function Lee(t){return new an({title:"Insert image",label:"Image",enable(e){return N9(e,t)},run(e,n,r){let{from:i,to:l}=e.selection,a=null;e.selection instanceof ae&&e.selection.node.type==t&&(a=e.selection.node.attrs),V9({title:"Insert image",fields:{src:new zl({label:"Location",required:!0,value:a&&a.src}),title:new zl({label:"Title",value:a&&a.title}),alt:new zl({label:"Description",value:a?a.alt:e.doc.textBetween(i,l," ")})},callback(o){r.dispatch(r.state.tr.replaceSelectionWith(t.createAndFill(o))),r.focus()}})}})}u(Lee,"insertImageItem");function F9(t,e){let n={label:e.title,run:t};for(let r in e)n[r]=e[r];return!e.enable&&!e.select&&(n[e.enable?"enable":"select"]=r=>t(r)),new an(n)}u(F9,"cmdItem");function j1(t,e){let{from:n,$from:r,to:i,empty:l}=t.selection;return l?!!e.isInSet(t.storedMarks||r.marks()):t.doc.rangeHasMark(n,i,e)}u(j1,"markActive");function q1(t,e){let n={active(r){return j1(r,t)}};for(let r in e)n[r]=e[r];return F9(Ni(t),n)}u(q1,"markItem");function zee(t){return new an({title:"Add or remove link",icon:kn.link,active(e){return j1(e,t)},enable(e){return!e.selection.empty},run(e,n,r){if(j1(e,t))return Ni(t)(e,n),!0;V9({title:"Create a link",fields:{href:new zl({label:"Link target",required:!0}),title:new zl({label:"Title"})},callback(i){Ni(t,i)(r.state,r.dispatch),r.focus()}})}})}u(zee,"linkItem");function I9(t,e){return F9(C1(t,e.attrs),e)}u(I9,"wrapListItem");function L9(t){let e={},n;(n=t.marks.strong)&&(e.toggleStrong=q1(n,{title:"Toggle strong style",icon:kn.strong})),(n=t.marks.em)&&(e.toggleEm=q1(n,{title:"Toggle emphasis",icon:kn.em})),(n=t.marks.code)&&(e.toggleCode=q1(n,{title:"Toggle code font",icon:kn.code})),(n=t.marks.link)&&(e.toggleLink=zee(n));let r;if((r=t.nodes.image)&&(e.insertImage=Lee(r)),(r=t.nodes.bullet_list)&&(e.wrapBulletList=I9(r,{title:"Wrap in bullet list",icon:kn.bulletList})),(r=t.nodes.ordered_list)&&(e.wrapOrderedList=I9(r,{title:"Wrap in ordered list",icon:kn.orderedList})),(r=t.nodes.blockquote)&&(e.wrapBlockQuote=$ee(r,{title:"Wrap in block quote",icon:kn.blockquote})),(r=t.nodes.paragraph)&&(e.makeParagraph=I1(r,{title:"Change to paragraph",label:"Plain"})),(r=t.nodes.code_block)&&(e.makeCodeBlock=I1(r,{title:"Change to code block",label:"Code"})),r=t.nodes.heading)for(let l=1;l<=10;l++)e["makeHead"+l]=I1(r,{title:"Change to heading "+l,label:"Level "+l,attrs:{level:l}});if(r=t.nodes.horizontal_rule){let l=r;e.insertHorizontalRule=new an({title:"Insert horizontal rule",label:"Horizontal rule",enable(a){return N9(a,l)},run(a,o){o(a.tr.replaceSelectionWith(l.create()))}})}let i=u(l=>l.filter(a=>a),"cut");return e.insertMenu=new op(i([e.insertImage,e.insertHorizontalRule]),{label:"Insert"}),e.typeMenu=new op(i([e.makeParagraph,e.makeCodeBlock,e.makeHead1&&new F1(i([e.makeHead1,e.makeHead2,e.makeHead3,e.makeHead4,e.makeHead5,e.makeHead6]),{label:"Heading"})]),{label:"Type..."}),e.inlineMenu=[i([e.toggleStrong,e.toggleEm,e.toggleCode,e.toggleLink])],e.blockMenu=[i([e.wrapBulletList,e.wrapOrderedList,e.wrapBlockQuote,gee,Oee,bee])],e.fullMenu=e.inlineMenu.concat([[e.insertMenu,e.typeMenu]],[[yee,vee]],e.blockMenu),e}u(L9,"buildMenuItems");const z9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Zee(t,e){let n={},r;function i(l,a){if(e){let o=e[l];if(o===!1)return;o&&(l=o)}n[l]=a}if(u(i,"bind"),i("Mod-z",rp),i("Shift-Mod-z",ju),i("Backspace",Tee),z9||i("Mod-y",ju),i("Alt-ArrowUp",E1),i("Alt-ArrowDown",jJ),i("Mod-BracketLeft",T1),i("Escape",Q1),(r=t.marks.strong)&&(i("Mod-b",Ni(r)),i("Mod-B",Ni(r))),(r=t.marks.em)&&(i("Mod-i",Ni(r)),i("Mod-I",Ni(r))),(r=t.marks.code)&&i("Mod-`",Ni(r)),(r=t.nodes.bullet_list)&&i("Shift-Ctrl-8",C1(r)),(r=t.nodes.ordered_list)&&i("Shift-Ctrl-9",C1(r)),(r=t.nodes.blockquote)&&i("Ctrl->",M1(r)),r=t.nodes.hard_break){let l=r,a=lp(x9,(o,s)=>(s&&s(o.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0));i("Mod-Enter",a),i("Shift-Enter",a),z9&&i("Ctrl-Enter",a)}if((r=t.nodes.list_item)&&(i("Enter",vJ(r)),i("Mod-[",$J(r)),i("Mod-]",SJ(r))),(r=t.nodes.paragraph)&&i("Shift-Ctrl-0",ip(r)),(r=t.nodes.code_block)&&i("Shift-Ctrl-\\",ip(r)),r=t.nodes.heading)for(let l=1;l<=6;l++)i("Shift-Ctrl-"+l,ip(r,{level:l}));if(r=t.nodes.horizontal_rule){let l=r;i("Mod-_",(a,o)=>(o&&o(a.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0))}return n}u(Zee,"buildKeymap");function Xee(t){return Z1(/^\s*>\s$/,t)}u(Xee,"blockQuoteRule");function jee(t){return Z1(/^(\d+)\.\s$/,t,e=>({order:+e[1]}),(e,n)=>n.childCount+n.attrs.order==+e[1])}u(jee,"orderedListRule");function qee(t){return Z1(/^\s*([-+*])\s$/,t)}u(qee,"bulletListRule");function Wee(t){return R9(/^```$/,t)}u(Wee,"codeBlockRule");function Yee(t,e){return R9(new RegExp("^(#{1,"+e+"})\\s$"),t,n=>({level:n[1].length}))}u(Yee,"headingRule");function Kee(t){let e=Nee.concat(Qee,Aee),n;return(n=t.nodes.blockquote)&&e.push(Xee(n)),(n=t.nodes.ordered_list)&&e.push(jee(n)),(n=t.nodes.bullet_list)&&e.push(qee(n)),(n=t.nodes.code_block)&&e.push(Wee(n)),(n=t.nodes.heading)&&e.push(Yee(n,6)),Eee({rules:e})}u(Kee,"buildInputRules");function Uee(t){let e=[Kee(t.schema),p9(Zee(t.schema,t.mapKeys)),p9(nee),ree(),aee()];return t.menuBar!==!1&&e.push(xee({floating:t.floatingMenu!==!1,content:t.menuContent||L9(t.schema).fullMenu})),t.history!==!1&&e.push(NJ()),e.concat(new jr({props:{attributes:{class:"ProseMirror-example-setup-style"}}}))}u(Uee,"exampleSetup");const Gee=wp.element.forwardRef(({rawView:t=!0,...e},n)=>{const[r,i]=wp.element.useState(e.value??""),[l,a]=wp.element.useState("visual"),o=wp.element.useRef(null),s=Hr.get("button-group");return wp.element.useEffect(()=>{e.onChange&&e.onChange(r)},[r]),wp.element.useEffect(()=>{const c=new Qh({nodes:OJ(h9.spec.nodes,"paragraph block*","block"),marks:h9.spec.marks}),d=Uee({schema:c,menuContent:L9(c).fullMenu}),f=document.createElement("div"),h=document.createElement("div");h.innerHTML=r,f.appendChild(h);const p=Cu.fromSchema(c).parse(h,{preserveWhitespace:!0}),m=qy.create({doc:p,plugins:d});return o.current=new ep(n.current,{state:m,dispatchTransaction:g=>{const O=o.current.state.apply(g);o.current.updateState(O);const b=o.current.dom.innerHTML;i(b)}}),()=>o.current.destroy()},[l]),wp.element.createElement("div",{className:"tf-editor-content"},t&&wp.element.createElement("div",{className:"tf-editor-view-toggle"},wp.element.createElement(s,{label:"Switch view",labelVisuallyHidden:!0,value:l,onChange:c=>{a(c),c==="raw"&&(n.current=null)},choices:{visual:"Visual",raw:"Raw"}})),l==="visual"?wp.element.createElement("div",{className:"tf-editor-visual-view",ref:n}):wp.element.createElement(zQ,{value:r,onChange:i}))});var _ee=Object.defineProperty,Hee=u((t,e)=>_ee(t,"name",{value:e,configurable:!0}),"n$6");const Jee=Hee(t=>{const[e,n]=wp.element.useState(t.value),r=wp.element.useRef(null),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",name:t.name,value:e}),wp.element.createElement(Gee,{ref:r,value:e,onChange:n,rawView:t.rawView??!0}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Editor");var ete=Object.defineProperty,tte=u((t,e)=>ete(t,"name",{value:e,configurable:!0}),"l$5");const nte=tte(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si(t,e),[l,a]=wp.element.useState(t.value);return wp.element.useEffect(()=>{a(t.value)},[t.value]),wp.element.useEffect(()=>{setTimeout(()=>{tinyMCE.init({target:e.current,setup:function(o){o.on("input",()=>a(o.getContent()))}})})},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{ref:e,...r},l),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TinyMce");var rte=Object.defineProperty,ite=u((t,e)=>rte(t,"name",{value:e,configurable:!0}),"t$4"),Z9=ite(t=>{const{editor:e}=t;return e==="tinymce"?wp.element.createElement(nte,{...t}):wp.element.createElement(Jee,{...t})},"default"),lte=Object.defineProperty,ate=u((t,e)=>lte(t,"name",{value:e,configurable:!0}),"n$5");const ote=ate(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?$0:hp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...t,...a})},"FieldGroupItem");var ste=Object.defineProperty,W1=u((t,e)=>ste(t,"name",{value:e,configurable:!0}),"s$5");const Y1=W1(t=>{const[e,n]=wp.element.useState([]),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(On(t.value??"")),o=wp.element.useRef();o.current=l;const s=W1((f,h)=>{a({...l,[f]:h}),e.length!==0&&i(()=>()=>{e.map(p=>p(f))})},"setAttribute");wp.element.useEffect(()=>{t.onChange&&t.onChange(l),r&&(r(),i(!1))},[l]);const c=t.fields??[],d=W1(f=>c.map(h=>h.name??!1).includes(f),"hasField");return wp.element.createElement("div",{className:"tf-field-group"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l)}),c.map((f,h)=>wp.element.createElement("div",{key:h,className:"tf-field-group-item"},wp.element.createElement(ote,{values:l,config:f,onChange:p=>s(f.name,p),data:{getValue:p=>d(p)?o.current[p]??"":t.data.getValue(p)??"",watcher:p=>{n(m=>[...m,g=>p(g)])}}}))))},"FieldGroup");var ute=Object.defineProperty,X9=u((t,e)=>ute(t,"name",{value:e,configurable:!0}),"p$1");const cte=X9(t=>{const{api:e}=Zn(),n=new FormData;return n.append("file",t),n.append("title",t.name),n.append("caption",t.caption),qU(e.endpoint.media,n)},"postMedia"),j9=X9(t=>{const{api:e}=Zn();return WQ(e.endpoint.media+t)},"getMedia");var dte=Object.defineProperty,q9=u((t,e)=>dte(t,"name",{value:e,configurable:!0}),"s$4");const fte=q9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);if(wp.element.useEffect(()=>{q9(async()=>{const o=await j9(t.id);i(o),n(!0)},"fetch")()},[]),!e||!r)return wp.element.createElement("li",{className:"tf-file-item"},"Loading...");const l=r.source_url,a=l.split("/").pop().split(".").length===2?l.split("/").pop().split(".")[1]:"";return wp.element.createElement("li",{className:"tf-file-item"},r.media_type==="image"&&wp.element.createElement("img",{loading:"lazy",decoding:"async",src:l,alt:r.alt_text,className:"attachment-medium size-medium"}),wp.element.createElement("span",null,`${r.title.rendered}${a!==""?"."+a:""}`),wp.element.createElement(se,{type:"action",onPress:()=>t.remove()},"Remove"))},"FilePreview");var hte=Object.defineProperty,_r=u((t,e)=>hte(t,"name",{value:e,configurable:!0}),"l$4");const pte=_r(t=>{const{mimetypes:e}=Zn(),n=wp.element.useRef(null),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(!1),[o,s]=wp.element.useState(t.value?Array.isArray(t.value)?t.value:JSON.parse(t.value):[]),[c,d]=wp.element.useState(!1),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(o),[o]);const m=t.placeholder??"No file selected",g=t.maxUpload??!1,O=_r(()=>(g===!1||o.length(g===!1||o.length{a(!0),d(!1),cte(r[0]).then(C=>s([...o,C.id])).catch(C=>d(C.message)).finally(()=>{i(!1),a(!1)})},"upload"),$=_r(C=>{s([...o.slice(0,C),...o.slice(C+1)])},"removeUpload"),v=_r(()=>t.wp_media===!1||t.wp_media==="false","isWpMediaDisabled"),S=_r(()=>{const{mimeTypes:C}=t,Q=Object.values(e),T=_r(B=>B.includes("/")?B:Q.filter(w=>w.startsWith(`${B}/`)),"filterByMimetypePrefix");return(C?Array.isArray(C)?C.flatMap(T):T(C):Q).join(", ")},"getAllowedTypes"),x=_r(()=>{const C=wp.media({title:"Choose File",multiple:!1,library:{type:S()}});C.on("select",()=>{const Q=C.state().get("selection").first().toJSON();s([...o,Q.id])}),C.open()},"open");return wp.element.createElement("div",{className:"tf-file"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement(gn,null,wp.element.createElement("input",{type:"file",ref:n,accept:S(),onChange:C=>i(C.target.files),...h})),wp.element.createElement("div",{className:"tf-file-container"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(o)}),wp.element.createElement("ul",{className:"tf-file-list"},o.map((C,Q)=>wp.element.createElement(fte,{key:C,id:C,remove:()=>$(Q)}))),wp.element.createElement("div",{className:"tf-file-field"},wp.element.createElement(se,{type:"action",onPress:()=>v()?n.current.click():x(),isDisabled:!b(),"aria-hidden":"true"},t.buttonText??"Choose"),wp.element.createElement("div",{className:"tf-file-text","aria-hidden":"true"},r.length>0?r[0].name:m),v()&&wp.element.createElement(se,{type:"action",onPress:y,isDisabled:!O()},t.uploadText??"Upload"))),c&&wp.element.createElement(UP,{message:c,type:"error",onDismiss:()=>d(!1)}),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"FileUpload");var mte=Object.defineProperty,cp=u((t,e)=>mte(t,"name",{value:e,configurable:!0}),"l$3");const gte=cp(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(t.value&&t.value!==""?typeof t.value!="object"?JSON.parse(t.value):t.value:{type:"linear",angle:45,shape:"ellipse",colors:["rgba(0,255,255,1)","rgba(0,255,255,1)"]}),o=wp.element.useRef(),s=wp.element.useRef(),c=wp.element.useRef(),d=wp.element.useRef(),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange({...l,stringValue:m()})},[l]);const m=cp(()=>{switch(l.type){case"linear":return`linear-gradient(${l.angle}deg, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"radial":return`radial-gradient(${l.shape}, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"conic":return`conic-gradient(${l.colors[0]} 0%, ${l.colors[1]} 100%)`}},"generateGradient"),g=cp((b,y)=>{const $=[...l.colors];$[b]=y?.toString("rgba"),O("colors",$)},"updateColor"),O=cp((b,y)=>{a({...l,[b]:y})},"updateValue");return wp.element.createElement("div",{className:"tf-gradient"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement("div",{className:"tf-gradient-container",ref:d},wp.element.createElement("input",{ref:s,type:"text",className:"tf-gradient-input",value:m(),onClick:b=>i(!0),readOnly:!0}),wp.element.createElement("input",{type:"hidden",ref:o,value:JSON.stringify(l),name:t.name??"",...h}),r&&wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:s,placement:"bottom start",style:{width:d?.current?.offsetWidth,minWidth:"fit-content"},className:"tf-gradient-popover"},wp.element.createElement(gs,null,wp.element.createElement(vd,{autoFocus:!0},wp.element.createElement("div",{className:"tf-gradient-popover-content"},wp.element.createElement("div",{className:"tf-gradient-preview",ref:c,style:{background:m()}},wp.element.createElement("div",{className:"tf-gradient-colors"},l.colors?.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-gradient-color tf-color-area-thumb",style:{background:l.colors[y]},onClick:()=>n(y)})))),wp.element.createElement("div",{className:"tf-gradient-settings"},wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Js,{label:"Gradient type",selectedKey:l.type??"linear",onSelectionChange:b=>O("type",b)},wp.element.createElement(Qr,{key:"linear"},"Linear"),wp.element.createElement(Qr,{key:"radial"},"Radial"),wp.element.createElement(Qr,{key:"conic"},"Conical"))),wp.element.createElement("div",null,l.type==="linear"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Bf,{label:"Angle",value:l.angle??45,onChange:b=>O("angle",b)})),l.type==="radial"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Js,{label:"Shape",selectedKey:l.shape??"ellipse",onSelectionChange:b=>O("shape",b)},wp.element.createElement(Qr,{key:"circle"},"Circle"),wp.element.createElement(Qr,{key:"ellipse"},"Ellipse"))))))))),e!==!1&&wp.element.createElement(Rr,{state:{isOpen:e!==!1,close:()=>n(!1)},triggerRef:c,placement:e===0?"bottom start":"bottom end"},wp.element.createElement(XQ,{value:l.colors[e],onChange:b=>g(e,b),hasAlpha:!0,onFocusChange:b=>b===!1?n(!1):!1}))),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"Gradient");var Ote=Object.defineProperty,W9=u((t,e)=>Ote(t,"name",{value:e,configurable:!0}),"a$2");const bte=W9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);return wp.element.useEffect(()=>{W9(async()=>{const l=await j9(t.id);i(l),n(!0)},"fetch")()},[]),!e||!r?wp.element.createElement("div",{className:"tf-gallery-item"},"Loading..."):wp.element.createElement("div",{className:"tf-gallery-item"},wp.element.createElement("img",{src:r.source_url}))},"ImagePreview");var yte=Object.defineProperty,dp=u((t,e)=>yte(t,"name",{value:e,configurable:!0}),"a$1");const vte=dp(t=>{const e=dp(c=>(c!=="[]"?c.split(","):[]).map(d=>d.replaceAll("[","").replaceAll("]","").replaceAll('"',"")),"initValue"),[n,r]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value?e(t.value):[]),{labelProps:i,inputProps:l,descriptionProps:a}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const o=dp(()=>{const c=wp.media({frame:"post",multiple:!0,button:{text:"Use this media"},library:{type:["image"]},state:n.length<1?"gallery":"gallery-edit",selection:s()});c.on({update:d=>{r(d.models.map(f=>f.id))},open:()=>{c.menuView.unset("playlist"),c.menuView.unset("video-playlist")}},void 0),c.open()},"open"),s=dp(()=>{const c=wp.media.query({orderby:"post__in",order:"ASC",type:"image",perPage:-1,post__in:n});return new wp.media.model.Selection(c.models,{props:c.props.toJSON(),multiple:!0})},"getSelection");return wp.element.createElement("div",{className:"tf-gallery"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-gallery__controls"},wp.element.createElement("div",{className:"tf-gallery-preview"},n.map(c=>wp.element.createElement(bte,{key:c,id:c})))),wp.element.createElement("div",{className:"tf-gallery-buttons"},wp.element.createElement(se,{type:"action",onPress:o},n.length<1?"Create gallery":"Edit gallery"),n.length>0&&wp.element.createElement(se,{type:"action",onPress:()=>r([])},"Clear gallery")),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:n.join(","),...l}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Gallery");var $te=Object.defineProperty,wte=u((t,e)=>$te(t,"name",{value:e,configurable:!0}),"a");const xte=wte(t=>wp.element.createElement("input",{type:"hidden",name:t.name,value:t.value,...t.attributes,className:`tf-hidden ${t.class??""} ${t.className??""}`}),"InputHidden");var Ste=Object.defineProperty,Ku=u((t,e)=>Ste(t,"name",{value:e,configurable:!0}),"i$5");const Cte=Ku(t=>{const e={value:"",_canDelete:!0,_enabled:!0},[n,r]=wp.element.useState(On(t.value??"[]",[]));wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const[i,l]=wp.element.useState(""),a=wp.element.useRef(0),{labelProps:o,fieldProps:s,descriptionProps:c}=$t(t),d=Ku(()=>{r([...n,{...e,value:i}]),l(""),a.current=a.current+1},"addSelectedItem"),f=Ku(m=>{r([...n.slice(0,m),...n.slice(m+1)])},"removeItem"),h=Ku((m,g,O)=>{setTimeout(()=>{r([...n.slice(0,m),{...n[m],[g]:O},...n.slice(m+1)])})},"updateItem"),p=Ku(m=>t.isAsync?m.label:t.choices[m]??m,"getItemText");return t.isAsync&&console.warn("Async mode is not supported yet for the list field"),wp.element.createElement("div",{className:"tf-list"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(n),...s}),wp.element.createElement("div",{className:"tf-list-container"},wp.element.createElement("div",{className:"tf-list-items"},wp.element.createElement("div",{className:"tf-list-header"},t.label&&wp.element.createElement(xe,{labelProps:o,parent:t},t.label),wp.element.createElement("div",{className:"tf-list-header-actions"})),wp.element.createElement("div",{className:"tf-list-items"},n.map((m,g)=>wp.element.createElement("div",{key:m.value,className:"tf-list-item"},wp.element.createElement("div",{className:"tf-list-item-text"},p(m.value)),wp.element.createElement("div",{key:m,className:"tf-list-item-actions"},m._canDelete&&wp.element.createElement(se,{type:"icon-trash",onPress:()=>f(g)}),t.useVisibility&&wp.element.createElement(se,{type:"icon-eye",onPress:()=>h(g,"_enabled",!m._enabled),style:m._enabled?{}:{opacity:.5,filter:"grayscale(60%)"}})))))),wp.element.createElement("div",{className:"tf-list-search"},wp.element.createElement(xh,{...t,name:null,key:a.current,value:i,description:!1,labelVisuallyHidden:!0,disabledKeys:n.map(m=>m.value),multiple:!1,onChange:m=>{m&&l(m)}}),wp.element.createElement(se,{type:"action",onPress:d,isDisabled:i===""},"Add"))),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"List");var kte=Object.defineProperty,Dte=u((t,e)=>kte(t,"name",{value:e,configurable:!0}),"t$3"),Pte=Dte(t=>{const[e,n]=wp.element.useState(t.value??""),r=il(t.choices??{});return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement(OE,{...t,onChange:n},r.map(i=>wp.element.createElement(bE,{key:i.value??"",...i},i.label??"")))},"default"),Ete=Object.defineProperty,Tte=u((t,e)=>Ete(t,"name",{value:e,configurable:!0}),"m$4");const Ate=Tte(t=>{const[e,n]=wp.element.useState(t.value?W2(t.value):new Set),[r,i]=wp.element.useState(!1),l=y0({...t,selectionMode:"multiple",onSelectionChange:n,selectedKeys:e}),a=wp.element.useRef(),o=wp.element.useRef(),s=wp.element.useRef(),{listBoxProps:c,labelProps:d,descriptionProps:f}=lD(t,l,a);wp.element.useEffect(()=>{t.onChange&&t.onChange([...e])},[e]);const h=wp.element.createElement(Vd,{listBoxRef:a,state:l,items:t.items,...c});return wp.element.createElement("div",{className:"tf-multiple-select",ref:s},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:[...e].join(",")}),t.label&&wp.element.createElement(xe,{labelProps:d,parent:t},t.label),wp.element.createElement(se,{type:"select",ref:o,onPress:()=>i(!r)},wp.element.createElement("span",{className:"tf-multiple-select__value"},e.size>0?e.size===1?e.size+" item selected":e.size+" items selected":t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),r?wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:o,placement:"bottom start",style:{width:s?.current?.offsetWidth}},h):wp.element.createElement(gn,null,h),t.description&&wp.element.createElement(we,{descriptionProps:f,parent:t},t.description))},"MultipleSelect");var Qte=Object.defineProperty,Mte=u((t,e)=>Qte(t,"name",{value:e,configurable:!0}),"t$2"),Y9=Mte(t=>t.multiple?wp.element.createElement(Ate,{items:il(t.choices??{}),...t,onChange:t.onChange},Ld):wp.element.createElement(Js,{selectedKey:t.value,onSelectionChange:t.onChange,items:il(t.choices??{}),...t},Ld),"default"),Bte=Object.defineProperty,K9=u((t,e)=>Bte(t,"name",{value:e,configurable:!0}),"l$2");const Rte=K9(t=>{const e=t.units??["px"],{labelProps:n,fieldProps:r,descriptionProps:i}=$t(t),[l,a]=wp.element.useState(On(t.value??"",{value:0,unit:e[0]}));wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]);const o=K9((s,c)=>{a({...l,[c]:s})},"setAttribute");return wp.element.createElement("div",{className:"tf-simple-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l),...r}),wp.element.createElement("div",{className:"tf-simple-dimensions-container"},wp.element.createElement("div",null,wp.element.createElement(Bf,{value:l.value??0,name:"value",label:"Dimension number",labelVisuallyHidden:!0,description:!1,onChange:s=>o(s,"value")})),wp.element.createElement(Js,{label:"Dimension unit",labelVisuallyHidden:!0,description:!1,selectedKey:l.unit??"px",onSelectionChange:s=>o(s,"unit"),placeholder:"unit"},e.map(s=>wp.element.createElement(Qr,{key:s},s)))),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"Dimensions");var Vte=Object.defineProperty,Nte=u((t,e)=>Vte(t,"name",{value:e,configurable:!0}),"l$1");const Fte=Nte(t=>{const e=kx(t),n=wp.element.useRef(),{inputProps:r}=HF({...t,children:t.label??""},e,n),{focusProps:i}=rs(),{labelProps:l,fieldProps:a,descriptionProps:o}=$t(t);return wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]),wp.element.createElement("div",{className:"tf-switch"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement("label",{className:"tf-switch-label"},wp.element.createElement(gn,null,wp.element.createElement("input",{...a,...r,...i,ref:n,name:""})),wp.element.createElement("div",{className:`tf-switch-element${e.isSelected?"-selected":""}`,"aria-hidden":"true"},wp.element.createElement("span",null))),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Switch");var Ite=Object.defineProperty,Lte=u((t,e)=>Ite(t,"name",{value:e,configurable:!0}),"t$1"),K1=Lte(t=>{const e=t.valueOn??"on",n=t.valueOff??"off",[r,i]=wp.element.useState(t.value??n);return wp.element.useEffect(()=>t.onChange&&t.onChange(r),[r]),wp.element.useEffect(()=>{[e,n].includes(t.value)&&t.value!==r&&i(t.value)},[t.value]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(Fte,{label:t.label??"",labelVisuallyHidden:t.labelVisuallyHidden??!1,description:t.description??"",value:r===e,onChange:l=>i(l?e:n)}))},"default"),zte=Object.defineProperty,Zte=u((t,e)=>zte(t,"name",{value:e,configurable:!0}),"o$2");const Xte=Zte(t=>{const{Header:e,Container:n,Content:r,Title:i}=GP,l=Object.keys(t.tabs??{}).map(d=>({...t.tabs[d],name:d})),[a,o]=wp.element.useState(l[0]?.name??!1),[s,c]=wp.element.useState(On(t.value));return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(s)}),wp.element.createElement(n,null,wp.element.createElement(e,null,l.map(d=>wp.element.createElement(i,{key:d.name,isOpen:d.name===a,onPress:()=>o(d.name)},d.title))),l&&l.map((d,f)=>wp.element.createElement(r,{key:d.name,isActive:d.name===a},wp.element.createElement(Y1,{...t,name:null,fields:d.fields,value:s[d.name]??{},onChange:h=>c({...s,[d.name]:h})})))))},"Tab");var jte=Object.defineProperty,qte=u((t,e)=>jte(t,"name",{value:e,configurable:!0}),"n$3");const U9=qte(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-text"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement(IX,{...t,inputProps:l,onChange:n,ref:r,dynamic:t.dynamic??!1}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"TextField");var Wte=Object.defineProperty,Yte=u((t,e)=>Wte(t,"name",{value:e,configurable:!0}),"i$4");const Kte=Yte(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si({...t,inputElementType:"textarea"},e);return wp.element.createElement("div",{className:"tf-text-area"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{...r,maxLength:t.maxlength,minLength:t.minlength,required:t.required,rows:t.rows,ref:e,"data-identifier":t.identifier??""}),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TextArea");var Ute=Object.defineProperty,Gte=u((t,e)=>Ute(t,"name",{value:e,configurable:!0}),"m$3");const _te=Gte(t=>{const{locale:e}=Re(),n=jI({...t,value:t.value,onChange:s=>{const{hour:c,minute:d,second:f}=s;t.onChange?.(new Tr(c,d,f))},locale:e,minValue:t.minValue,maxValue:t.maxValue}),r=wp.element.useRef(),{labelProps:i,descriptionProps:l,fieldProps:a,inputProps:o}=fF(t,n,r);return wp.element.createElement("div",{className:"tf-time-wrapper"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{...a,className:"tf-time-field"},n.segments.map((s,c)=>wp.element.createElement(l8,{key:c,segment:s,state:n})),n.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"TimeField");var Hte=Object.defineProperty,G9=u((t,e)=>Hte(t,"name",{value:e,configurable:!0}),"t");const Jte=G9(t=>{const e=G9(o=>{if(!o||typeof o!="string")return new Tr(0,0);if(o instanceof Tr)return o;const[s,c]=o.split(":").map(d=>parseInt(d));return new Tr(s,c)},"convertTime"),n=parseInt(t.hourCycle)??12,[r,i]=wp.element.useState(e(t.value)),l=e(t.minValue??"00:00"),a=e(t.maxValue??"23:59");return wp.element.useEffect(()=>{e(t.value).toString()!==r.toString()&&i(t.value)},[t.value]),wp.element.useEffect(()=>{r.toString()!==t.value.toString()&&t.onChange?.(r.toString())},[r]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-time-picker"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(_te,{label:t.label??"",description:t.description??"",labelVisuallyHidden:t.labelVisuallyHidden,descriptionVisuallyHidden:t.descriptionVisuallyHidden,value:r,onChange:i,name:t.name??"",hourCycle:n,minValue:l,maxValue:a})))},"TimePicker");var ene=Object.defineProperty,_9=u((t,e)=>ene(t,"name",{value:e,configurable:!0}),"c$3");const U1=_9(t=>{const[e,n]=wp.element.useState(""),[r,i]=wp.element.useState(!1);wp.element.useEffect(()=>{r?t.dispatch({type:"bulkCheck"}):t.dispatch({type:"bulkUncheck"})},[r]);const l=_9(()=>{switch(e){case"enabled":case"disabled":t.dispatch({type:"bulkUpdate",control:"enabled",value:e==="enabled"?"on":"off",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break;case"deletion":t.dispatch({type:"bulkRemove",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break}},"applyAction");return wp.element.createElement("div",{className:"tf-repeater-bulk-actions"},wp.element.createElement(tu,{label:"Select or unselect all items",labelVisuallyHidden:!0,value:r,onChange:i}),wp.element.createElement(Y9,{label:"Select bulk action",labelVisuallyHidden:!0,placeholder:"Bulk actions",choices:t.actions,value:e,onChange:n}),e==="deletion"?wp.element.createElement($s,{title:"Confirmation",label:"Apply",onValidate:l},"Are you sure you want to remove the selected items?"):wp.element.createElement(se,{type:"action",onPress:l},"Apply"))},"BulkActions");var tne=Object.defineProperty,Uu=u((t,e)=>tne(t,"name",{value:e,configurable:!0}),"n$2");const nne=Uu((t,e=!1)=>e?e.map(n=>typeof n=="object"?n.name??!1:n):t.map(n=>n.name??""),"getHeaderFieldsName"),rne=Uu((t,e=!1)=>{const n=nne(t,e);return t.filter(r=>n.includes(r.name)||n.includes(r.name+".label")).map(r=>ine(r,e))},"getHeaderConfig"),ine=Uu((t,e)=>{const n=e?e.find(r=>typeof r=="object"&&r.callback&&r.name===t.name):!1;return{...t,callback:n?lne(n):!1}},"formatConfig"),lne=Uu(t=>typeof t.callback=="function"?t.callback:typeof t.callback=="string"?G1.repeater.__callbacks[t.callback]??!1:!1,"getCallback"),ane=Uu((t,e)=>!e[t.name]||e[t.name]===""?wp.element.createElement("i",null,"Empty"):t.callback?t.callback({column:t,value:e[t.name]}):typeof e[t.name]=="object"?e[t.name].label===""?JSON.stringify(e[t.name]):e[t.name].label:e[t.name],"renderHeaderValue");var one=Object.defineProperty,sne=u((t,e)=>one(t,"name",{value:e,configurable:!0}),"f$2");const une=sne(({items:t,fields:e,rowFields:n,renderItem:r,maxLength:i,dispatch:l,headerFields:a=!1,beforeRow:o=!1,afterRow:s=!1,renderAction:c,renderFooterActions:d,useBulk:f})=>{const[h,p]=wp.element.useState(!1),m=rne(e,a);return wp.element.createElement(wp.element.Fragment,null,f&&wp.element.createElement(U1,{actions:{deletion:"Delete"},dispatch:l}),wp.element.createElement("div",{className:"tf-repeater-advanced"},wp.element.createElement("div",{className:"tf-repeater-advanced-header tf-repeater-advanced-label-row"},wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"}),m.map((g,O)=>wp.element.createElement("div",{key:O,className:"tf-repeater-advanced-header-item tf-repeater-advanced-label-row-item"},g.label??"")),wp.element.createElement("div",{key:"arrow",className:"tf-repeater-advanced-label-row-arrow"})),wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-advanced-items"},t&&t.slice(0,i).map((g,O)=>wp.element.createElement("div",{key:g.key??O,className:"tf-repeater-advanced-item","data-open":h===O?"true":"false"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview tf-repeater-advanced-label-row"},f&&wp.element.createElement("div",{className:"tf-repeater-advanced-item-checkbox",onClick:b=>b.stopPropagation()},wp.element.createElement(tu,{label:`Select item ${O+1}`,labelVisuallyHidden:!0,value:g._bulkCheckbox,onChange:b=>l({type:"update",item:O,control:"_bulkCheckbox",value:b})})),wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"},O+1),wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-container"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-fields"},m.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-repeater-advanced-overview-item tf-repeater-advanced-label-row-item"},ane(b,g)))),i!==void 0&&wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-actions"},wp.element.createElement(se,{type:"text-primary",onPress:()=>p(h===O?!1:O)},h===O?"Close":"Edit"),c("clone",O,{type:"text-primary"}),c("delete",O,{buttonProps:{type:"text-danger"}}))),wp.element.createElement(se,{key:"arrow",type:"repeater-overview-open",onPress:()=>p(h===O?!1:O),changeTag:"span",className:"tf-repeater-advanced-label-row-arrow"},wp.element.createElement("div",null))),h===O&&wp.element.createElement("div",{className:"tf-repeater-advanced-row"},o&&o(g,O,l),n.map(b=>wp.element.createElement("div",{key:b.name??O,className:"tf-repeater-advanced-item-field"},r(b,g,O))),s&&s(g,O,l)))))),d())},"Advanced");var cne=Object.defineProperty,dne=u((t,e)=>cne(t,"name",{value:e,configurable:!0}),"f$1");const fne=dne(({items:t,rowFields:e,renderItem:n,maxLength:r,dispatch:i,beforeRow:l=!1,afterRow:a=!1,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-bare-items"},t&&t.slice(0,r).map((c,d)=>wp.element.createElement("div",{key:c.key??d,className:"tf-repeater-bare-row"},l&&l(c,d,i),e.map(f=>wp.element.createElement("div",{key:f.name??d,className:"tf-repeater-bare-item-field"},n(f,c,d))),o("delete",d),a&&a(c,d,i)))),s()),"Bare");var hne=Object.defineProperty,pne=u((t,e)=>hne(t,"name",{value:e,configurable:!0}),"d$1");const H9=pne((t,e,n,r,i,l)=>{const a=n||"Item "+(e+1);if(!JP(a))return a;const o={type:"wrapper",name:`_repeater-title-${r}-${t.key}`,content:n,dependent:{callbackData:{repeater:{props:l,item:t,index:e}},...l.dependent?l.dependent:{}}};return i(o,t,e)},"renderTitle");var mne=Object.defineProperty,fp=u((t,e)=>mne(t,"name",{value:e,configurable:!0}),"n$1");const gne=fp(({items:t,dispatch:e,rowFields:n,renderItem:r,maxLength:i,title:l=!1,useSwitch:a,useBulk:o,name:s,renderFooterActions:c,renderAction:d,parent:f})=>{const[h,p]=wp.element.useState(0),m=fp(y=>p(y!==h?y:!1),"toggleItem"),g={deletion:"Delete"};a&&(g.enabled="Enabled",g.disabled="Disabled");const O=fp((y,$)=>wp.element.createElement(wp.element.Fragment,null,o?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(tu,{label:`Select item ${$+1}`,labelVisuallyHidden:!0,value:y._bulkCheckbox,onChange:v=>e({type:"update",item:$,control:"_bulkCheckbox",value:v})})):null,a?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(K1,{label:`Enable item ${$+1}`,labelVisuallyHidden:!0,value:y.enabled,onChange:v=>e({type:"update",item:$,control:"enabled",value:v})})):null),"getHeaderLeft"),b=fp((y,$)=>wp.element.createElement(wp.element.Fragment,null,d("clone",y),wp.element.createElement(se,{type:"action",onPress:()=>m(y)},h!==y?"Edit":"Close"),d("delete",y)),"actions");return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-block-items"},o&&wp.element.createElement(U1,{actions:g,dispatch:e}),t&&t.slice(0,i).map((y,$)=>wp.element.createElement(_2,{key:y.key??$,title:H9(y,$,l,s,r,f),footer:b($,y),isOpen:h===$,className:"tf-repeater-block-item",onChange:v=>v?h!==$?p($):null:h===$?p(!1):null,headerLeft:O(y,$)},n.map(v=>wp.element.createElement("div",{key:v.name??$,className:"tf-repeater-block-item-field"},r(v,y,$)))))),c())},"Block");var One=Object.defineProperty,bne=u((t,e)=>One(t,"name",{value:e,configurable:!0}),"c$1");const yne={deletion:"Delete"},vne=bne(({items:t,fields:e,dispatch:n,rowFields:r,renderItem:i,maxLength:l,useBulk:a,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",null,a&&wp.element.createElement(U1,{actions:yne,dispatch:n}),wp.element.createElement("table",null,wp.element.createElement("thead",null,wp.element.createElement("tr",null,a&&wp.element.createElement("th",null),e.map((c,d)=>wp.element.createElement("th",{key:d},c.label??"")),l>1&&wp.element.createElement("th",{align:"end"}))),wp.element.createElement("tbody",{className:"tf-repeater-items tf-repeater-table-items"},t&&t.slice(0,l).map((c,d)=>wp.element.createElement("tr",{key:c.key??d},a&&wp.element.createElement("td",{key:`${c.key}-enable`},wp.element.createElement("div",{onClick:f=>f.stopPropagation()},wp.element.createElement(tu,{value:c._bulkCheckbox,onChange:f=>n({type:"update",item:d,control:"_bulkCheckbox",value:f})}))),r.map((f,h)=>wp.element.createElement("td",{key:`${c.key}-${h}`},i(f,c,d))),wp.element.createElement("td",{className:"tf-repeater-row-actions"},wp.element.createElement("div",null,o("clone",d),o("delete",d)))))))),s()),"Table");var $ne=Object.defineProperty,wne=u((t,e)=>$ne(t,"name",{value:e,configurable:!0}),"m");const xne=wne(({items:t,rowFields:e,renderItem:n,renderAction:r,maxLength:i,dispatch:l,name:a,title:o=!1,beforeRow:s=!1,afterRow:c=!1,parent:d,string:f})=>{const{Header:h,Container:p,Content:m,Row:g,RowField:O,RowLabel:b,RowTitle:y,Title:$}=GP,[v,S]=wp.element.useState(0),x=wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-tab-add-item tf-tab-item"},i!==void 0&&wp.element.createElement(se,{type:"text-primary",onPress:()=>l({type:"add"}),isDisabled:i<=t.length},f("add"))),wp.element.createElement("div",{className:"tf-repeater-tab-icon-actions"},r("clone",v,{type:"icon-clone",className:"tf-tab-item",contentVisuallyHidden:!0}),r("delete",v,{label:"Remove",title:"Confirmation",onValidate:()=>{l({type:"remove",item:v}),S(v==0?0:v-1)},buttonProps:{type:"icon-trash",contentVisuallyHidden:!0,className:"tf-tab-item"}})));return wp.element.createElement(p,{className:"tf-repeater-tab-container"},wp.element.createElement(h,{className:"tf-repeater-items tf-repeater-tab-items",actionsClassName:"tf-repeater-tab-actions",actions:x},t&&t.slice(0,i).map((C,Q)=>wp.element.createElement($,{key:C.key??Q,isOpen:v==Q,className:"tf-repeater-tab-item",onPress:()=>S(Q)},H9(C,Q,o,a,n,d)))),t&&t.map((C,Q)=>wp.element.createElement(m,{key:C.key??Q,isActive:v===Q,className:"tf-repeater-tab-content"},e.map((T,B)=>wp.element.createElement(g,{key:T.name??B,className:"tf-repeater-tab-row"},s&&s(C,Q,l),T.type==="title"?wp.element.createElement(y,{className:"tf-repeater-tab-row-title tf-repeater-tab-row-title-section"},n(T,C,Q)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(b,{className:"tf-repeater-tab-row-title"},T.label??""),wp.element.createElement(O,{className:"tf-repeater-tab-item-field"},n(T,C,Q))),c&&c(C,Q,l))))))},"Tab");var Hr={_types:{control:{accordion:_L,"alignment-matrix":iz,border:WX,"button-group":HX,checkbox:tu,code:AU,"color-picker":jQ,"conditional-panel":UL,"combo-box":xh,"date-picker":VG,dimensions:LT,"field-group":Y1,file:pte,gradient:gte,gallery:vte,list:Cte,hidden:xte,number:Bf,repeater:dE,radio:Pte,select:Y9,"simple-dimension":Rte,switch:K1,tab:Xte,text:U9,"text-suggestion":FG,wysiwyg:Z9,editor:Z9,textarea:Kte,"time-picker":Jte},element:{button:se,description:we,label:xe,"list-box":Vd,modal:$s,wrapper:SL,tooltip:$L,title:zd},repeater:{advanced:une,bare:fne,block:gne,table:vne,tab:xne}},get(t,e="control"){return this._types[e]?.[t]??(e==="repeater"?"table":!1)},add(t,e,n="control"){this._types[n][t]=e}},Sne=Object.defineProperty,J9=u((t,e)=>Sne(t,"name",{value:e,configurable:!0}),"i$2");const hp=J9(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Zl),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class;const[a,o]=wp.element.useState(r.value??"");wp.element.useEffect(()=>{r.onChange&&r.onChange(a)},[a]);const s=Hr.get(r.type??"text");if(wp.element.useEffect(()=>{n&&n()},[]),!s)return wp.element.createElement(wp.element.Fragment,null);const c=J9(d=>{o(d),setTimeout(()=>{Xi("valueChange",{name:r.name??!1,props:r,value:d,previousValue:a})})},"onChange");return wp.element.createElement(pk,{...l},wp.element.createElement(sE,{visibility:t,data:e},wp.element.createElement(uE,{itemType:r.itemType??"field",name:r.name??!1,setValue:o},d=>wp.element.createElement(rE,{refresh:d,data:e,itemProps:r},f=>wp.element.createElement(s,{...f,value:a,onChange:c,data:e,dynamic:r.dynamic?iI(a,o,r):!1})))))},"Control");var Cne=Object.defineProperty,kne=u((t,e)=>Cne(t,"name",{value:e,configurable:!0}),"o");const Dne=kne((t,e)=>({getRow(n){const r=e.getValue(t);return Array.isArray(r)&&r[n]?r[n]:!1},setRow(n,r){const i=e.getValue(t);if(!Array.isArray(i)||!i[n])return!1;i[n]=r,e.setValue(t,i)},getRowValue(n,r){const i=this.getRow(n);return i?i[r]:!1},setRowValue(n,r,i){const l=this.getRow(n);if(!l)return!1;l[r]=i,this.setRow(n,l)}}),"getRepeaterStore");var In={_values:{},_setValueFromControl(t,e){this._values[t]=e},getAllValues(){return this._values},getValue(t){return this._values[t]??""},setValue(t,e){Xi("_refreshFieldValue",{name:t,value:e})},getRepeater(t){return Dne(t,this)}},G1={rerender:t=>Xi("_fieldRerender",t),dependent:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}},repeater:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}}},Pne=Object.defineProperty,bo=u((t,e)=>Pne(t,"name",{value:e,configurable:!0}),"i");const Zl=wp.element.createContext(null),Ene=bo((t,e="field")=>e==="element"?tB(t):eB(t),"renderComponent"),eB=bo(t=>wp.element.createElement(Zl.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:In.getValue.bind(In),portalContainer:t.portalContainer??document.body}},wp.element.createElement(hp,{...t,onChange:e=>{In._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:In.getValue.bind(In)}})),"renderField"),tB=bo(t=>wp.element.createElement(Zl.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:In.getValue.bind(In),portalContainer:t.portalContainer??document.body}},wp.element.createElement($0,{...t,onChange:e=>{In._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:In.getValue.bind(In)}})),"renderElement"),nB=bo(()=>{const{fields:t,elements:e}=Zn(),n=[];for(const r in t)n.push(rB(r,t[r],"fields"));for(const r in e)e[r].forEach(i=>{n.push(rB(r,i,"elements"))});Promise.all(n).then(()=>Xi("ready",{}))},"init"),rB=bo((t,e,n)=>new Promise(r=>{const i=document.getElementById(e.element);if(!i)return r();const l=bo(()=>{r(),Xi(n==="fields"?"initField":"initElement",{name:t,props:e})},"afterInitialization"),a=n==="fields"?eB({name:t,afterInitialization:l,...e}):tB({name:t,afterInitialization:l,...e});wp.element.createRoot?wp.element.createRoot(i).render(a):wp.element.render(a,i)}),"initItem");var Tne=Object.freeze({__proto__:null,ControlContext:Zl,config:om,event:sa,fields:G1,getConfig:Zn,init:nB,render:Ene,setConfig:sm,store:In,trigger:Xi,types:Hr,utils:sI});window.tangibleFields=Tne,window.addEventListener("load",()=>{window.TangibleFieldsConfig&&sm(window.TangibleFieldsConfig),nB()})})(); +`);return{dom:s,text:h,slice:e}}u(u1,"serializeForClipboard");function I8(t,e,n,r,i){let l=i.parent.type.spec.code,a,o;if(!n&&!e)return null;let s=!!e&&(r||l||!n);if(s){if(t.someProp("transformPastedText",h=>{e=h(e,l||r,t)}),l)return o=new H(j.from(t.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0),t.someProp("transformPasted",h=>{o=h(o,t,!0)}),o;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)o=f;else{let h=i.marks(),{schema:p}=t.state,m=ro.fromSchema(p);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let O=a.appendChild(document.createElement("p"));g&&O.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),a=OH(n),Nu&&bH(a);let c=a&&a.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let h=a.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;a=h}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||Cu.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||d),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!pH.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)o=yH(X8(o,+d[1],+d[2]),d[4]);else if(o=H.maxOpen(mH(o.content,i),!0),o.openStart||o.openEnd){let f=0,h=0;for(let p=o.content.firstChild;f{o=f(o,t,s)}),o}u(I8,"parseFromClipboard");const pH=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function mH(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),l,a=[];if(t.forEach(o=>{if(!a)return;let s=i.findWrapping(o.type),c;if(!s)return a=null;if(c=a.length&&l.length&&z8(s,l,o,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=Z8(a[a.length-1],l.length));let d=L8(o,s);a.push(d),i=i.matchType(d.type),l=s}}),a)return j.from(a)}return t}u(mH,"normalizeSiblings");function L8(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,j.from(t));return t}u(L8,"withWrappers");function z8(t,e,n,r,i){if(i1&&(l=0),i=n&&(o=e<0?a.contentMatchAt(0).fillBefore(o,l<=i).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore(j.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(o))}u(c1,"closeRange");function X8(t,e,n){return en})),d1.createHTML(t)):t}u(gH,"maybeWrapTrusted");function OH(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=W8().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&j8[r[1].toLowerCase()])&&(t=i.map(l=>"<"+l+">").join("")+t+i.map(l=>"").reverse().join("")),n.innerHTML=gH(t),i)for(let l=0;l=0;o-=2){let s=n.nodes[r[o]];if(!s||s.hasRequiredAttrs())break;i=j.from(s.create(r[o+1],i)),l++,a++}return new H(i,l,a)}u(yH,"addContext");const Tt={},At={},vH={touchstart:!0,touchmove:!0},M$=class M${constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};u(M$,"InputState");let f1=M$;function $H(t){for(let e in Tt){let n=Tt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{xH(t,r)&&!p1(t,r)&&(t.editable||!(r.type in At))&&n(t,r)},vH[e]?{passive:!0}:void 0)}Et&&t.dom.addEventListener("input",()=>null),h1(t)}u($H,"initInput");function Vi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}u(Vi,"setSelectionOrigin");function wH(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}u(wH,"destroyInput");function h1(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>p1(t,r))})}u(h1,"ensureListeners");function p1(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}u(p1,"runCustomHandler");function xH(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}u(xH,"eventBelongsToView");function SH(t,e){!p1(t,e)&&Tt[e.type]&&(t.editable||!(e.type in At))&&Tt[e.type](t,e)}u(SH,"dispatchEvent"),At.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!K8(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Wr&&pt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),co&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Ql(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||hH(t,n)?n.preventDefault():Vi(t,"key")},At.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},At.keypress=(t,e)=>{let n=e;if(K8(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Sn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),l=u(()=>t.state.tr.insertText(i).scrollIntoView(),"deflt");!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,i,l))&&t.dispatch(l()),n.preventDefault()}};function Kh(t){return{left:t.clientX,top:t.clientY}}u(Kh,"eventCoords");function CH(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}u(CH,"isNear");function m1(t,e,n,r,i){if(r==-1)return!1;let l=t.state.doc.resolve(r);for(let a=l.depth+1;a>0;a--)if(t.someProp(e,o=>a>l.depth?o(t,n,l.nodeAfter,l.before(a),i,!0):o(t,n,l.node(a),l.before(a),i,!1)))return!0;return!1}u(m1,"runHandlerOnContext");function mo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}u(mo,"updateSelection");function kH(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ae.isSelectable(r)?(mo(t,new ae(n),"pointer"),!0):!1}u(kH,"selectClickedLeaf");function DH(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ae&&(r=n.node);let l=t.state.doc.resolve(e);for(let a=l.depth+1;a>0;a--){let o=a>l.depth?l.nodeAfter:l.node(a);if(ae.isSelectable(o)){r&&n.$from.depth>0&&a>=n.$from.depth&&l.before(n.$from.depth+1)==n.$from.pos?i=l.before(n.$from.depth):i=l.before(a);break}}return i!=null?(mo(t,ae.create(t.state.doc,i),"pointer"),!0):!1}u(DH,"selectClickedNode");function PH(t,e,n,r,i){return m1(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(i?DH(t,n):kH(t,n))}u(PH,"handleSingleClick");function EH(t,e,n,r){return m1(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}u(EH,"handleDoubleClick");function TH(t,e,n,r){return m1(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||AH(t,n,r)}u(TH,"handleTripleClick");function AH(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(mo(t,ke.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let l=i.depth+1;l>0;l--){let a=l>i.depth?i.nodeAfter:i.node(l),o=i.before(l);if(a.inlineContent)mo(t,ke.create(r,o+1,o+1+a.content.size),"pointer");else if(ae.isSelectable(a))mo(t,ae.create(r,o),"pointer");else continue;return!0}}u(AH,"defaultTripleClick");function g1(t){return Uh(t)}u(g1,"forceDOMFlush");const Y8=Sn?"metaKey":"ctrlKey";Tt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=g1(t),i=Date.now(),l="singleClick";i-t.input.lastClick.time<500&&CH(n,t.input.lastClick)&&!n[Y8]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?l="doubleClick":t.input.lastClick.type=="doubleClick"&&(l="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:l,button:n.button};let a=t.posAtCoords(Kh(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new O1(t,a,n,!!r)):(l=="doubleClick"?EH:TH)(t,a.pos,a.inside,n)?n.preventDefault():Vi(t,"pointer"))};const B$=class B${constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Y8],this.allowDefault=r.shiftKey;let l,a;if(n.inside>-1)l=e.state.doc.nodeAt(n.inside),a=n.inside;else{let d=e.state.doc.resolve(n.pos);l=d.parent,a=d.depth?d.before():0}const o=i?null:r.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||c instanceof ae&&c.from<=a&&c.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Vi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Kr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Kh(e))),this.updateAllowDefault(e),this.allowDefault||!n?Vi(this.view,"pointer"):PH(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Et&&this.mightDrag&&!this.mightDrag.node.isAtom||pt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(mo(this.view,de.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Vi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Vi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};u(B$,"MouseDown");let O1=B$;Tt.touchstart=t=>{t.input.lastTouch=Date.now(),g1(t),Vi(t,"pointer")},Tt.touchmove=t=>{t.input.lastTouch=Date.now(),Vi(t,"pointer")},Tt.contextmenu=t=>g1(t);function K8(t,e){return t.composing?!0:Et&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}u(K8,"inOrNearComposition");const QH=Wr?5e3:-1;At.compositionstart=At.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Uh(t,!0),t.markCursor=null;else if(Uh(t,!e.selection.empty),xn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,l=r.focusOffset;i&&i.nodeType==1&&l!=0;){let a=l<0?i.lastChild:i.childNodes[l-1];if(!a)break;if(a.nodeType==3){let o=t.domSelection();o&&o.collapse(a,a.nodeValue.length);break}else i=a,l=-1}}t.input.composing=!0}U8(t,QH)},At.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,U8(t,20))};function U8(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Uh(t),e))}u(U8,"scheduleComposeEnd");function G8(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=BH());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}u(G8,"clearComposition");function MH(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=T_(e.focusNode,e.focusOffset),r=A_(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,l=t.domObserver.lastChangedTextNode;if(n==l||r==l)return l;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}u(MH,"findCompositionNode");function BH(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}u(BH,"timestampFromCustomEvent");function Uh(t,e=!1){if(!(Wr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),G8(t),e||t.docView&&t.docView.dirty){let n=i1(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}u(Uh,"endComposition");function RH(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}u(RH,"captureCopy");const zu=Xt&&Qi<15||co&&V_<604;Tt.copy=At.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let l=zu?null:n.clipboardData,a=r.content(),{dom:o,text:s}=u1(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",o.innerHTML),l.setData("text/plain",s)):RH(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function VH(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}u(VH,"sliceSingleNode");function NH(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Zu(t,r.value,null,i,e):Zu(t,r.textContent,r.innerHTML,i,e)},50)}u(NH,"capturePaste");function Zu(t,e,n,r,i){let l=I8(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",s=>s(t,i,l||H.empty)))return!0;if(!l)return!1;let a=VH(l),o=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(l);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}u(Zu,"doPaste");function _8(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}u(_8,"getText"),At.paste=(t,e)=>{let n=e;if(t.composing&&!Wr)return;let r=zu?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Zu(t,_8(r),r.getData("text/html"),i,n)?n.preventDefault():NH(t,n)};const R$=class R${constructor(e,n,r){this.slice=e,this.move=n,this.node=r}};u(R$,"Dragging");let Gh=R$;const FH=Sn?"altKey":"ctrlKey";function H8(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[FH]}u(H8,"dragMoves"),Tt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,l=i.empty?null:t.posAtCoords(Kh(n)),a;if(!(l&&l.pos>=i.from&&l.pos<=(i instanceof ae?i.to-1:i.to))){if(r&&r.mightDrag)a=ae.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(a=ae.create(t.state.doc,f.posBefore))}}let o=(a||t.state.selection).content(),{dom:s,text:c,slice:d}=u1(t,o);(!n.dataTransfer.files.length||!pt||o8>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(zu?"Text":"text/html",s.innerHTML),n.dataTransfer.effectAllowed="copyMove",zu||n.dataTransfer.setData("text/plain",c),t.dragging=new Gh(d,H8(t,n),a)},Tt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},At.dragover=At.dragenter=(t,e)=>e.preventDefault(),At.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Kh(n));if(!i)return;let l=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",m=>{a=m(a,t,!1)}):a=I8(t,_8(n.dataTransfer),zu?null:n.dataTransfer.getData("text/html"),!1,l);let o=!!(r&&H8(t,n));if(t.someProp("handleDrop",m=>m(t,n,a||H.empty,o))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?qM(t.state.doc,l.pos,a):l.pos;s==null&&(s=l.pos);let c=t.state.tr;if(o){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let d=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,h=c.doc;if(f?c.replaceRangeWith(d,d,a.content.firstChild):c.replaceRange(d,d,a),c.doc.eq(h))return;let p=c.doc.resolve(d);if(f&&ae.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ae(p));else{let m=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((g,O,b,y)=>m=y),c.setSelection(a1(t,p,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Tt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Kr(t)},20))},Tt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Tt.beforeinput=(t,e)=>{if(pt&&Wr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",l=>l(t,Ql(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in At)Tt[t]=At[t];function Xu(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}u(Xu,"compareObjs");const em=class em{constructor(e,n){this.toDOM=e,this.spec=n||Nl,this.side=this.spec.side||0}map(e,n,r,i){let{pos:l,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Ur(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof em&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Xu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};u(em,"WidgetType");let _h=em;const Bc=class Bc{constructor(e,n){this.attrs=e,this.spec=n||Nl}map(e,n,r,i){let l=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return l>=a?null:new Ur(l,a,this)}valid(e,n){return n.from=e&&(!l||l(o.spec))&&r.push(o.copy(o.from+i,o.to+i))}for(let a=0;ae){let o=this.children[a]+1;this.children[a+2].findInner(e-o,n-o,r,i+o,l)}}map(e,n,r){return this==mt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Nl)}mapInner(e,n,r,i,l){let a;for(let o=0;o{let c=s+r,d;if(d=e9(n,o,c)){for(i||(i=this.children.slice());lo&&f.to=e){this.children[o]==e&&(r=this.children[o+2]);break}let l=e+1,a=l+n.content.size;for(let o=0;ol&&s.type instanceof Vl){let c=Math.max(l,s.from)-l,d=Math.min(a,s.to)-l;ci.map(e,n,Nl));return Li.from(r)}forChild(e,n){if(n.isLeaf)return ln.empty;let r=[];for(let i=0;in instanceof ln)?e:e.reduce((n,r)=>n.concat(r instanceof ln?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let O=g-m-(p-h);for(let b=0;by+d-f)continue;let $=o[b]+d-f;p>=$?o[b+1]=h<=$?-2:-1:h>=d&&O&&(o[b]+=O,o[b+1]+=O)}f+=O}),d=n.maps[c].map(d,-1)}let s=!1;for(let c=0;c=r.content.size){s=!0;continue}let h=n.map(t[c+1]+l,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),O=r.maybeChild(m);if(O&&g==f&&g+O.nodeSize==p){let b=o[c+2].mapInner(n,O,d+1,t[c]+l+1,a);b!=mt?(o[c]=f,o[c+1]=p,o[c+2]=b):(o[c+1]=-2,s=!0)}else s=!0}if(s){let c=LH(o,t,e,n,i,l,a),d=Jh(c,r,0,a);e=d.local;for(let f=0;fn&&a.to{let c=e9(t,o,s+n);if(c){l=!0;let d=Jh(c,o,n+s+1,r);d!=mt&&i.push(s,s+o.nodeSize,d)}});let a=J8(l?t9(t):t,-n).sort(Fl);for(let o=0;o0;)e++;t.splice(e,0,n)}u(n9,"insertAhead");function v1(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=mt&&e.push(r)}),t.cursorWrapper&&e.push(ln.create(t.state.doc,[t.cursorWrapper.deco])),Hh.from(e)}u(v1,"viewDecorations");const zH={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ZH=Xt&&Qi<=11,V$=class V${constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}};u(V$,"SelectionState");let $1=V$;const N$=class N${constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new $1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ZH&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,zH)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(A8(this.view)){if(this.suppressingSelectionUpdates)return Kr(this.view);if(Xt&&Qi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Al(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let l=e.focusNode;l;l=uo(l))n.add(l);for(let l=e.anchorNode;l;l=uo(l))if(n.has(l)){r=l;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&A8(e)&&!this.ignoreSelectionChange(r),l=-1,a=-1,o=!1,s=[];if(e.editable)for(let d=0;df.nodeName=="BR");if(d.length==2){let[f,h]=d;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of d){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||qH(e,f)!=p)&&h.remove()}}}let c=null;l<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(l>-1&&(e.docView.markDirty(l,a),XH(e)),this.handleDOMChange(l,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Kr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;O--){let b=r.childNodes[O-1],y=b.pmViewDesc;if(b.nodeName=="BR"&&!y){l=O;break}if(!y||y.size)break}let f=t.state.doc,h=t.someProp("domParser")||Cu.fromSchema(t.state.schema),p=f.resolve(a),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:l,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:YH,context:p});if(c&&c[0].pos!=null){let O=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=O),m={anchor:O+a,head:b+a}}return{doc:g,sel:m,from:a,to:o}}u(WH,"parseBetween");function YH(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Et&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Et&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}u(YH,"ruleFromNode");const KH=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function UH(t,e,n,r,i){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=i1(t,C);if(Q&&!t.state.selection.eq(Q)){if(pt&&Wr&&t.input.lastKeyCode===13&&Date.now()-100B(t,Ql(13,"Enter"))))return;let T=t.state.tr.setSelection(Q);C=="pointer"?T.setMeta("pointer",!0):C=="key"&&T.scrollIntoView(),l&&T.setMeta("composition",l),t.dispatch(T)}return}let a=t.state.doc.resolve(e),o=a.sharedDepth(n);e=a.before(o+1),n=t.state.doc.resolve(n).after(o+1);let s=t.state.selection,c=WH(t,e,n),d=t.state.doc,f=d.slice(c.from,c.to),h,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Wr)&&i.some(C=>C.nodeType==1&&!KH.test(C.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",C=>C(t,Ql(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&s instanceof ke&&!s.empty&&s.$head.sameParent(s.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:s.from,endA:s.to,endB:s.to};else{if(c.sel){let C=a9(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let Q=t.state.tr.setSelection(C);l&&Q.setMeta("composition",l),t.dispatch(Q)}}return}t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Xt&&Qi<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" \xA0"&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),O=c.doc.resolveNoCache(m.endB-c.from),b=d.resolve(m.start),y=g.sameParent(O)&&g.parent.inlineContent&&b.end()>=m.endA;if((co&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!y&&g.posC(t,Ql(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&_H(d,m.start,m.endA,g,O)&&t.someProp("handleKeyDown",C=>C(t,Ql(8,"Backspace")))){Wr&&pt&&t.domObserver.suppressSelectionUpdates();return}pt&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),Wr&&!y&&g.start()!=O.start()&&O.parentOffset==0&&g.depth==O.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,O=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,Ql(13,"Enter"))})},20));let $=m.start,v=m.endA,S=u(C=>{let Q=C||t.state.tr.replace($,v,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let T=a9(t,Q.doc,c.sel);T&&!(pt&&t.composing&&T.empty&&(m.start!=m.endB||t.input.lastChromeDeleteKr(t),20));let C=S(t.state.tr.delete($,v)),Q=d.resolve(m.start).marksAcross(d.resolve(m.endA));Q&&C.ensureMarks(Q),t.dispatch(C)}else if(m.endA==m.endB&&(x=GH(g.parent.content.cut(g.parentOffset,O.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let C=S(t.state.tr);x.type=="add"?C.addMark($,v,x.mark):C.removeMark($,v,x.mark),t.dispatch(C)}else if(g.parent.child(g.index()).isText&&g.index()==O.index()-(O.textOffset?0:1)){let C=g.parent.textBetween(g.parentOffset,O.parentOffset),Q=u(()=>S(t.state.tr.insertText(C,$,v)),"deflt");t.someProp("handleTextInput",T=>T(t,$,v,C,Q))||t.dispatch(Q())}else t.dispatch(S());else t.dispatch(S())}u(UH,"readDOMChange");function a9(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:a1(t,e.resolve(n.anchor),e.resolve(n.head))}u(a9,"resolveSelection");function GH(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,l=r,a,o,s;for(let d=0;dd.mark(o.addToSet(d.marks)),"update");else if(i.length==0&&l.length==1)o=l[0],a="remove",s=u(d=>d.mark(o.removeFromSet(d.marks)),"update");else return null;let c=[];for(let d=0;dn||x1(a,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let l=t.node(r).maybeChild(t.indexAfter(r));for(;l&&!l.isLeaf;)l=l.firstChild,i++}return i}u(x1,"skipClosingAndOpening");function HH(t,e,n,r,i){let l=t.findDiffStart(e,n);if(l==null)return null;let{a,b:o}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let s=Math.max(0,l-Math.min(a,o));r-=a+s-l}if(a=a?l-r:0;l-=s,l&&l=o?l-r:0;l-=s,l&&l=56320&&e<=57343&&n>=55296&&n<=56319}u(o9,"isSurrogatePair");const F$=class F${constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new f1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(f9),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=c9(this),u9(this),this.nodeViews=d9(this),this.docView=v8(this.state.doc,s9(this),v1(this),this.dom,this),this.domObserver=new w1(this,(r,i,l,a)=>UH(this,r,i,l,a)),this.domObserver.start(),$H(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&h1(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(f9),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(G8(this),a=!0),this.state=e;let o=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(o||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=d9(this);eJ(p,this.nodeViews)&&(this.nodeViews=p,l=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&h1(this),this.editable=c9(this),u9(this);let s=v1(this),c=s9(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=l||!this.docView.matchesNode(e.doc,c,s);(f||!e.selection.eq(i.selection))&&(a=!0);let h=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&I_(this);if(a){this.domObserver.stop();let p=f&&(Xt||pt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&JH(i.selection,e.selection);if(f){let m=pt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=MH(this)),(l||!this.docView.update(e.doc,c,s,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=v8(e.doc,c,s,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&aH(this))?Kr(this,p):(E8(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&L_(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ae){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&s8(this,n.getBoundingClientRect(),e)}else s8(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(l))==r.node&&(i=l)}this.dragging=new Gh(e.slice,e.move,i<0?void 0:ae.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;an.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return W_(this,e)}coordsAtPos(e,n=1){return p8(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return __(this,n||this.state,e)}pasteHTML(e,n){return Zu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Zu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return u1(this,e)}destroy(){this.docView&&(wH(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],v1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,P_())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return SH(this,e)}domSelectionRange(){let e=this.domSelection();return e?Et&&this.root.nodeType===11&&M_(this.dom.ownerDocument)==this.dom&&jH(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};u(F$,"EditorView");let ep=F$;ep.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function s9(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ur.node(0,t.state.doc.content.size,e)]}u(s9,"computeDocDeco");function u9(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ur.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}u(u9,"updateCursorWrapper");function c9(t){return!t.someProp("editable",e=>e(t.state)===!1)}u(c9,"getEditable");function JH(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}u(JH,"selectionContextChanged");function d9(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return u(n,"add"),t.someProp("nodeViews",n),t.someProp("markViews",n),e}u(d9,"buildNodeViews");function eJ(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}u(eJ,"changedNodeViews");function f9(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}u(f9,"checkStateComponent");const tJ=["p",0],nJ=["blockquote",0],rJ=["hr"],iJ=["pre",["code",0]],lJ=["br"],aJ={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return tJ}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM(){return nJ}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return rJ}},heading:{attrs:{level:{default:1,validate:"number"}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM(){return iJ}},text:{group:"inline"},image:{inline:!0,attrs:{src:{validate:"string"},alt:{default:null,validate:"string|null"},title:{default:null,validate:"string|null"}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){let{src:e,alt:n,title:r}=t.attrs;return["img",{src:e,alt:n,title:r}]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return lJ}}},oJ=["em",0],sJ=["strong",0],uJ=["code",0],cJ={link:{attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){let{href:e,title:n}=t.attrs;return["a",{href:e,title:n},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return oJ}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return sJ}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return uJ}}},h9=new Qh({nodes:aJ,marks:cJ}),dJ=["ol",0],fJ=["ul",0],hJ=["li",0],pJ={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM(t){return t.attrs.order==1?dJ:["ol",{start:t.attrs.order},0]}},mJ={parseDOM:[{tag:"ul"}],toDOM(){return fJ}},gJ={parseDOM:[{tag:"li"}],toDOM(){return hJ},defining:!0};function S1(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}u(S1,"add");function OJ(t,e,n){return t.append({ordered_list:S1(pJ,{content:"list_item+",group:n}),bullet_list:S1(mJ,{content:"list_item+",group:n}),list_item:S1(gJ,{content:e})})}u(OJ,"addListNodes");function C1(t,e=null){return function(n,r){let{$from:i,$to:l}=n.selection,a=i.blockRange(l);if(!a)return!1;let o=r?n.tr:null;return bJ(o,a,t,e)?(r&&r(o.scrollIntoView()),!0):!1}}u(C1,"wrapInList");function bJ(t,e,n,r=null){let i=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let s=a.resolve(e.start-2);l=new to(s,s,e.depth),e.endIndex=0;d--)l=j.from(n[d].type.create(n[d].attrs,l));t.step(new Pt(e.start-(r?2:0),e.end,e.start,e.end,new H(l,0,0),n.length,!0));let a=0;for(let d=0;d=i.depth-3;b--)f=j.from(i.node(b).copy(f));let p=i.indexAfter(-1){if(O>-1)return!1;b.isTextblock&&b.content.size==0&&(O=y+1)}),O>-1&&g.setSelection(de.near(g.doc.resolve(O))),r(g.scrollIntoView())}return!0}let s=l.pos==i.end()?o.contentMatchAt(0).defaultType:null,c=n.tr.delete(i.pos,l.pos),d=s?[e?{type:t,attrs:e}:null,{type:s}]:void 0;return lo(c.doc,i.pos,2,d)?(r&&r(c.split(i.pos,2,d).scrollIntoView()),!0):!1}}u(vJ,"splitListItem");function $J(t){return function(e,n){let{$from:r,$to:i}=e.selection,l=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==t);return l?n?r.node(l.depth-1).type==t?wJ(e,n,t,l):xJ(e,n,l):!0:!1}}u($J,"liftListItem");function wJ(t,e,n,r){let i=t.tr,l=r.end,a=r.$to.end(r.depth);lg;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let o=n.startIndex==0,s=n.endIndex==i.childCount,c=l.node(-1),d=l.index(-1);if(!c.canReplace(d+(o?0:1),d+1,a.content.append(s?j.empty:j.from(i))))return!1;let f=l.pos,h=f+a.nodeSize;return r.step(new Pt(f-(o?1:0),h+(s?1:0),f+1,h-1,new H((o?j.empty:j.from(i.copy(j.empty))).append(s?j.empty:j.from(i.copy(j.empty))),o?0:1,s?0:1),o?0:1)),e(r.scrollIntoView()),!0}u(xJ,"liftOutOfList");function SJ(t){return function(e,n){let{$from:r,$to:i}=e.selection,l=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(a==0)return!1;let o=l.parent,s=o.child(a-1);if(s.type!=t)return!1;if(n){let c=s.lastChild&&s.lastChild.type==o.type,d=j.from(c?t.create():null),f=new H(j.from(t.create(null,j.from(o.type.create(null,d)))),c?3:1,0),h=l.start,p=l.end;n(e.tr.step(new Pt(h-(c?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}u(SJ,"sinkListItem");const CJ=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),kJ=typeof navigator<"u"&&/Win/.test(navigator.platform);function DJ(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,l,a;for(let o=0;o=n?et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},"slice"),et.prototype.get=u(function(e){if(!(e<0||e>=this.length))return this.getInner(e)},"get"),et.prototype.forEach=u(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},"forEach"),et.prototype.map=u(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(l,a){return i.push(e(l,a))},n,r),i},"map"),et.from=u(function(e){return e instanceof et?e:e&&e.length?new g9(e):et.empty},"from");var g9=function(t){function e(r){t.call(this),this.values=r}u(e,"Leaf"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=u(function(){return this.values},"flatten"),e.prototype.sliceInner=u(function(i,l){return i==0&&l==this.length?this:new e(this.values.slice(i,l))},"sliceInner"),e.prototype.getInner=u(function(i){return this.values[i]},"getInner"),e.prototype.forEachInner=u(function(i,l,a,o){for(var s=l;s=a;s--)if(i(this.values[s],o+s)===!1)return!1},"forEachInvertedInner"),e.prototype.leafAppend=u(function(i){if(this.length+i.length<=tp)return new e(this.values.concat(i.flatten()))},"leafAppend"),e.prototype.leafPrepend=u(function(i){if(this.length+i.length<=tp)return new e(i.flatten().concat(this.values))},"leafPrepend"),n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(et);et.empty=new g9([]);var EJ=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return u(e,"Append"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=u(function(){return this.left.flatten().concat(this.right.flatten())},"flatten"),e.prototype.getInner=u(function(r){return ro&&this.right.forEachInner(r,Math.max(i-o,0),Math.min(this.length,l)-o,a+o)===!1)return!1},"forEachInner"),e.prototype.forEachInvertedInner=u(function(r,i,l,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(r,i-o,Math.max(l,o)-o,a+o)===!1||l=l?this.right.slice(r-l,i-l):this.left.slice(r,l).append(this.right.slice(0,i-l))},"sliceInner"),e.prototype.leafAppend=u(function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},"leafAppend"),e.prototype.leafPrepend=u(function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},"leafPrepend"),e.prototype.appendInner=u(function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},"appendInner"),e}(et);const TJ=500,zi=class zi{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,l;n&&(i=this.remapping(r,this.items.length),l=i.maps.length);let a=e.tr,o,s,c=[],d=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),l=i.maps.length),l--,d.push(f);return}if(i){d.push(new fr(f.map));let p=f.step.map(i.slice(l)),m;p&&a.maybeStep(p).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],c.push(new fr(m,void 0,void 0,c.length+d.length))),l--,m&&i.appendMap(m,l)}else a.maybeStep(f.step);if(f.selection)return o=i?f.selection.map(i.slice(l)):f.selection,s=new zi(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,n,r,i){let l=[],a=this.eventCount,o=this.items,s=!i&&o.length?o.get(o.length-1):null;for(let d=0;dQJ&&(o=AJ(o,c),a-=c),new zi(o.append(l),a)}remapping(e,n){let r=new Vh;return this.items.forEach((i,l)=>{let a=i.mirrorOffset!=null&&l-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new zi(this.items.append(e.map(n=>new fr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),l=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach(h=>{h.selection&&o--},i);let s=n;this.items.forEach(h=>{let p=l.getMirror(--s);if(p==null)return;a=Math.min(a,p);let m=l.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),O=h.selection&&h.selection.map(l.slice(s+1,p));O&&o++,r.push(new fr(m,g,O))}else r.push(new fr(m))},i);let c=[];for(let h=n;hTJ&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],l=0;return this.items.forEach((a,o)=>{if(o>=e)i.push(a),a.selection&&l++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let d=a.selection&&a.selection.map(n.slice(r));d&&l++;let f=new fr(c.invert(),s,d),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else a.map&&r--},this.items.length,0),new zi(et.from(i.reverse()),l)}};u(zi,"Branch");let Il=zi;Il.empty=new Il(et.empty,0);function AJ(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}u(AJ,"cutOffEvents");const nm=class nm{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new nm(n.getMap().invert(),n,this.selection)}}};u(nm,"Item");let fr=nm;const I$=class I${constructor(e,n,r,i,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=l}};u(I$,"HistoryState");let hr=I$;const QJ=20;function MJ(t,e,n,r){let i=n.getMeta(Ll),l;if(i)return i.historyState;n.getMeta(VJ)&&(t=new hr(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Ll))return a.getMeta(Ll).redo?new hr(t.done.addTransform(n,void 0,r,np(e)),t.undone,O9(n.mapping.maps),t.prevTime,t.prevComposition):new hr(t.done,t.undone.addTransform(n,void 0,r,np(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),s=t.prevTime==0||!a&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!BJ(n,t.prevRanges)),c=a?D1(t.prevRanges,n.mapping):O9(n.mapping.maps);return new hr(t.done.addTransform(n,s?e.selection.getBookmark():void 0,r,np(e)),Il.empty,c,n.time,o??t.prevComposition)}else return(l=n.getMeta("rebased"))?new hr(t.done.rebased(n,l),t.undone.rebased(n,l),D1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new hr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),D1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}u(MJ,"applyTransaction");function BJ(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let l=0;l=e[l]&&(n=!0)}),n}u(BJ,"isAdjacentTo");function O9(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,l,a)=>e.push(l,a));return e}u(O9,"rangesFor");function D1(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=Ll.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let l=RJ(i,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}u(y9,"buildCommand");const rp=y9(!1,!0),ju=y9(!0,!0),v9=u((t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),"deleteSelection");function FJ(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}u(FJ,"atBlockStart");const IJ=u((t,e,n)=>{let r=FJ(t,n);if(!r)return!1;let i=$9(r);if(!i){let a=r.blockRange(),o=a&&Au(a);return o==null?!1:(e&&e(t.tr.lift(a,o).scrollIntoView()),!0)}let l=i.nodeBefore;if(S9(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Oo(l,"end")||ae.isSelectable(l)))for(let a=r.depth;;a--){let o=Ny(t.doc,r.before(a),r.after(a),H.empty);if(o&&o.slice.size1)break}return l.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-l.nodeSize,i.pos).scrollIntoView()),!0):!1},"joinBackward");function Oo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}u(Oo,"textblockAt");const LJ=u((t,e,n)=>{let{$head:r,empty:i}=t.selection,l=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;l=$9(r)}let a=l&&l.nodeBefore;return!a||!ae.isSelectable(a)?!1:(e&&e(t.tr.setSelection(ae.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)},"selectNodeBackward");function $9(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}u($9,"findCutBefore");function zJ(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=zJ(t,n);if(!r)return!1;let i=w9(r);if(!i)return!1;let l=i.nodeAfter;if(S9(t,i,e,1))return!0;if(r.parent.content.size==0&&(Oo(l,"start")||ae.isSelectable(l))){let a=Ny(t.doc,r.before(),r.after(),H.empty);if(a&&a.slice.size{let{$head:r,empty:i}=t.selection,l=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof ae,i;if(r){if(n.node.isTextblock||!ao(t.doc,n.from))return!1;i=n.from}else if(i=jM(t.doc,n.from,-1),i==null)return!1;if(e){let l=t.tr.join(i);r&&l.setSelection(ae.create(l.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},"joinUp"),jJ=u((t,e)=>{let n=t.selection,r;if(n instanceof ae){if(n.node.isTextblock||!ao(t.doc,n.to))return!1;r=n.to}else if(r=jM(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},"joinDown"),T1=u((t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),l=i&&Au(i);return l==null?!1:(e&&e(t.tr.lift(i,l).scrollIntoView()),!0)},"lift"),qJ=u((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)},"newlineInCode");function A1(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),l=n.indexAfter(-1),a=A1(i.contentMatchAt(l));if(!a||!i.canReplaceWith(l,l,a))return!1;if(e){let o=n.after(),s=t.tr.replaceWith(o,o,a.createAndFill());s.setSelection(de.near(s.doc.resolve(o),1)),e(s.scrollIntoView())}return!0},"exitCode"),WJ=u((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let l=A1(i.parent.contentMatchAt(i.indexAfter()));if(!l||!l.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let l=n.before();if(lo(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Au(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},"liftEmptyBlock");function KJ(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ae&&e.selection.node.isBlock)return!r.parentOffset||!lo(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,o,s=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){s=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),o=A1(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let g=t&&t(i.parent,s,r);l.unshift(g||(s&&o?{type:o}:null)),a=p;break}else{if(p==1)return!1;l.unshift(null)}let d=e.tr;(e.selection instanceof ke||e.selection instanceof Fn)&&d.deleteSelection();let f=d.mapping.map(r.pos),h=lo(d.doc,f,l.length,l);if(h||(l[0]=o?{type:o}:null,h=lo(d.doc,f,l.length,l)),!h)return!1;if(d.split(f,l.length,l),!s&&c&&r.node(a).type!=o){let p=d.mapping.map(r.before(a)),m=d.doc.resolve(p);o&&r.node(a-1).canReplaceWith(m.index(),m.index()+1,o)&&d.setNodeMarkup(d.mapping.map(r.before(a)),o)}return n&&n(d.scrollIntoView()),!0}}u(KJ,"splitBlockAs");const UJ=KJ(),Q1=u((t,e)=>{let{$from:n,to:r}=t.selection,i,l=n.sharedDepth(r);return l==0?!1:(i=n.before(l),e&&e(t.tr.setSelection(ae.create(t.doc,i))),!0)},"selectParentNode"),GJ=u((t,e)=>(e&&e(t.tr.setSelection(new Fn(t.doc))),!0),"selectAll");function _J(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,l=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(l,l+1)||!(i.isTextblock||ao(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}u(_J,"joinMaybeClear");function S9(t,e,n,r){let i=e.nodeBefore,l=e.nodeAfter,a,o,s=i.type.spec.isolating||l.type.spec.isolating;if(!s&&_J(t,e,n))return!0;let c=!s&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(l.type))&&o.matchType(a[0]||l.type).validEnd){if(n){let p=e.pos+l.nodeSize,m=j.empty;for(let b=a.length-1;b>=0;b--)m=j.from(a[b].create(null,m));m=j.from(i.copy(m));let g=t.tr.step(new Pt(e.pos-1,p,e.pos,p,new H(m,1,0),a.length,!0)),O=g.doc.resolve(p+2*a.length);O.nodeAfter&&O.nodeAfter.type==i.type&&ao(g.doc,O.pos)&&g.join(O.pos),n(g.scrollIntoView())}return!0}let d=l.type.spec.isolating||r>0&&s?null:de.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),h=f&&Au(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(c&&Oo(l,"start",!0)&&Oo(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=l,O=1;for(;!g.isTextblock;g=g.firstChild)O++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=j.empty;for(let $=m.length-1;$>=0;$--)b=j.from(m[$].copy(b));let y=t.tr.step(new Pt(e.pos-m.length,e.pos+l.nodeSize,e.pos+O,e.pos+l.nodeSize-O,new H(b,m.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}u(S9,"deleteBarrier");function C9(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,l=i.depth;for(;i.node(l).isInline;){if(!l)return!1;l--}return i.node(l).isTextblock?(n&&n(e.tr.setSelection(ke.create(e.doc,t<0?i.start(l):i.end(l)))),!0):!1}}u(C9,"selectTextblockSide");const HJ=C9(-1),JJ=C9(1);function M1(t,e=null){return function(n,r){let{$from:i,$to:l}=n.selection,a=i.blockRange(l),o=a&&Vy(a,t,e);return o?(r&&r(n.tr.wrap(a,o).scrollIntoView()),!0):!1}}u(M1,"wrapIn");function ip(t,e=null){return function(n,r){let i=!1;for(let l=0;l{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(t,e)))if(s.type==t)i=!0;else{let d=n.doc.resolve(c),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let l=n.tr;for(let a=0;a{if(o||!r&&s.isAtom&&s.isInline&&c>=l.pos&&c+s.nodeSize<=a.pos)return!1;o=s.inlineContent&&s.type.allowsMarkType(n)}),o)return!0}return!1}u(eee,"markApplies");function tee(t){let e=[];for(let n=0;n{if(l.isAtom&&l.content.size&&l.isInline&&a>=r.pos&&a+l.nodeSize<=i.pos)return a+1>r.pos&&e.push(new Bu(r,r.doc.resolve(a+1))),r=r.doc.resolve(a+1+l.content.size),!1}),r.posa.doc.rangeHasMark(p.$from.pos,p.$to.pos,t)):f=!d.every(p=>{let m=!1;return h.doc.nodesBetween(p.$from.pos,p.$to.pos,(g,O,b)=>{if(m)return!1;m=!t.isInSet(g.marks)&&!!b&&b.type.allowsMarkType(t)&&!(g.isText&&/^\s*$/.test(g.textBetween(Math.max(0,p.$from.pos-O),Math.min(g.nodeSize,p.$to.pos-O))))}),!m});for(let p=0;p{let l=u(a=>{this[i](a)},"handler");return e.dom.addEventListener(i,l),{name:i,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,l=i.getBoundingClientRect(),a=l.width/i.offsetWidth,o=l.height/i.offsetHeight;if(n){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let O=this.width/2*o;r={left:m.left,right:m.right,top:g-O,bottom:g+O}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!s||s==document.body&&getComputedStyle(s).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=s.getBoundingClientRect(),h=f.width/s.offsetWidth,p=f.height/s.offsetHeight;c=f.left-s.scrollLeft*h,d=f.top-s.scrollTop*p}this.element.style.left=(r.left-c)/a+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,l=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!l){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=qM(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};u(L$,"DropCursorView");let R1=L$;const br=class br extends de{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return br.valid(r)?new br(r):de.near(r)}content(){return H.empty}eq(e){return e instanceof br&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new br(e.resolve(n.pos))}getBookmark(){return new V1(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!iee(e)||!lee(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&br.valid(e))return e;let i=e.pos,l=null;for(let a=e.depth;;a--){let o=e.node(a);if(n>0?e.indexAfter(a)0){l=o.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let s=e.doc.resolve(i);if(br.valid(s))return s}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!ae.isSelectable(l)){e=e.doc.resolve(i+l.nodeSize*n),r=!1;continue e}break}l=a,i+=n;let o=e.doc.resolve(i);if(br.valid(o))return o}return null}}};u(br,"GapCursor");let gt=br;gt.prototype.visible=!1,gt.findFrom=gt.findGapCursorFrom,de.jsonID("gapcursor",gt);const rm=class rm{constructor(e){this.pos=e}map(e){return new rm(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return gt.valid(n)?new gt(n):de.near(n)}};u(rm,"GapBookmark");let V1=rm;function P9(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}u(P9,"needsGap");function iee(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||P9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(iee,"closedBefore");function lee(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||P9(i.type))return!0;if(i.inlineContent)return!1}}return!0}u(lee,"closedAfter");function aee(){return new jr({props:{decorations:cee,createSelectionBetween(t,e,n){return e.pos==n.pos&>.valid(n)?new gt(n):null},handleClick:see,handleKeyDown:oee,handleDOMEvents:{beforeinput:uee}}})}u(aee,"gapCursor");const oee=m9({ArrowLeft:ap("horiz",-1),ArrowRight:ap("horiz",1),ArrowUp:ap("vert",-1),ArrowDown:ap("vert",1)});function ap(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,l){let a=r.selection,o=e>0?a.$to:a.$from,s=a.empty;if(a instanceof ke){if(!l.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=r.doc.resolve(e>0?o.after():o.before())}let c=gt.findGapCursorFrom(o,e,s);return c?(i&&i(r.tr.setSelection(new gt(c))),!0):!1}}u(ap,"arrow");function see(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!gt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ae.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new gt(r))),!0)}u(see,"handleClick");function uee(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof gt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=j.empty;for(let a=r.length-1;a>=0;a--)i=j.from(r[a].createAndFill(null,i));let l=t.state.tr.replace(n.pos,n.pos,new H(i,0,0));return l.setSelection(ke.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}u(uee,"beforeinput");function cee(t){if(!(t.selection instanceof gt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ln.create(t.doc,[Ur.widget(t.selection.head,e,{key:"gapcursor"})])}u(cee,"drawGapCursor");const qu="http://www.w3.org/2000/svg",dee="http://www.w3.org/1999/xlink",N1="ProseMirror-icon";function fee(t){let e=0;for(let n=0;n{l.preventDefault(),r.classList.contains(jt+"-disabled")||n.run(e.state,e.dispatch,e,l)});function i(l){if(n.select){let o=n.select(l);if(r.style.display=o?"":"none",!o)return!1}let a=!0;if(n.enable&&(a=n.enable(l)||!1,L1(r,jt+"-disabled",!a)),n.active){let o=a&&n.active(l)||!1;L1(r,jt+"-active",o)}return!0}return u(i,"update"),{dom:r,update:i}}};u(z$,"MenuItem");let an=z$;function Wu(t,e){return t._props.translate?t._props.translate(e):e}u(Wu,"translate");let Yu={time:0,node:null};function E9(t){Yu.time=Date.now(),Yu.node=t.target}u(E9,"markMenuEvent");function T9(t){return Date.now()-100{a&&a.close()&&(a=null,r.removeEventListener("mousedown",o))},"close");i.addEventListener("mousedown",d=>{d.preventDefault(),E9(d),a?s():(a=this.expand(l,n.dom),r.addEventListener("mousedown",o=u(()=>{T9(l)||s()},"listeningOnClose")))});function c(d){let f=n.update(d);return l.style.display=f?"":"none",f}return u(c,"update"),{dom:l,update:c}}expand(e,n){let r=_t("div",{class:jt+"-dropdown-menu "+(this.options.class||"")},n),i=!1;function l(){return i?!1:(i=!0,e.removeChild(r),!0)}return u(l,"close"),e.appendChild(r),{close:l,node:r}}};u(Z$,"Dropdown");let op=Z$;function A9(t,e){let n=[],r=[];for(let i=0;i{let r=!1;for(let i=0;i{s.preventDefault(),E9(s),L1(l,jt+"-submenu-wrap-active",!1),a||r.addEventListener("mousedown",a=u(()=>{T9(l)||(l.classList.remove(jt+"-submenu-wrap-active"),r.removeEventListener("mousedown",a),a=null)},"listeningOnClose"))});function o(s){let c=n.update(s);return l.style.display=c?"":"none",c}return u(o,"update"),{dom:l,update:o}}};u(X$,"DropdownSubmenu");let F1=X$;function M9(t,e){let n=document.createDocumentFragment(),r=[],i=[];for(let a=0;aE1(t),icon:kn.join}),Oee=new an({title:"Lift out of enclosing block",run:T1,select:t=>T1(t),icon:kn.lift}),bee=new an({title:"Select parent node",run:Q1,select:t=>Q1(t),icon:kn.selectParentNode});let yee=new an({title:"Undo last change",run:rp,enable:t=>rp(t),icon:kn.undo}),vee=new an({title:"Redo last undone change",run:ju,enable:t=>ju(t),icon:kn.redo});function $ee(t,e){let n={run(r,i){return M1(t,e.attrs)(r,i)},select(r){return M1(t,e.attrs)(r)}};for(let r in e)n[r]=e[r];return new an(n)}u($ee,"wrapItem");function I1(t,e){let n=ip(t,e.attrs),r={run:n,enable(i){return n(i)},active(i){let{$from:l,to:a,node:o}=i.selection;return o?o.hasMarkup(t,e.attrs):a<=l.end()&&l.parent.hasMarkup(t,e.attrs)}};for(let i in e)r[i]=e[i];return new an(r)}u(I1,"blockTypeItem");function L1(t,e,n){n?t.classList.add(e):t.classList.remove(e)}u(L1,"setClass");const sp="ProseMirror-menubar";function wee(){if(typeof navigator>"u")return!1;let t=navigator.userAgent;return!/Edge\/\d/.test(t)&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t)}u(wee,"isIOS");function xee(t){return new jr({view(e){return new z1(e,t)}})}u(xee,"menuBar");const j$=class j${constructor(e,n){this.editorView=e,this.options=n,this.spacer=null,this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1,this.scrollHandler=null,this.root=e.root,this.wrapper=_t("div",{class:sp+"-wrapper"}),this.menu=this.wrapper.appendChild(_t("div",{class:sp})),this.menu.className=sp,e.dom.parentNode&&e.dom.parentNode.replaceChild(this.wrapper,e.dom),this.wrapper.appendChild(e.dom);let{dom:r,update:i}=M9(this.editorView,this.options.content);if(this.contentUpdate=i,this.menu.appendChild(r),this.update(),n.floating&&!wee()){this.updateFloat();let l=kee(this.wrapper);this.scrollHandler=a=>{let o=this.editorView.root;(o.body||o).contains(this.wrapper)?this.updateFloat(a.target.getBoundingClientRect?a.target:void 0):l.forEach(s=>s.removeEventListener("scroll",this.scrollHandler))},l.forEach(a=>a.addEventListener("scroll",this.scrollHandler))}}update(){if(this.editorView.root!=this.root){let{dom:e,update:n}=M9(this.editorView,this.options.content);this.contentUpdate=n,this.menu.replaceChild(e,this.menu.firstChild),this.root=this.editorView.root}this.contentUpdate(this.editorView.state),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))}updateScrollCursor(){let e=this.editorView.root.getSelection();if(!e.focusNode)return;let n=e.getRangeAt(0).getClientRects(),r=n[See(e)?0:n.length-1];if(!r)return;let i=this.menu.getBoundingClientRect();if(r.topi.top){let l=Cee(this.wrapper);l&&(l.scrollTop-=i.bottom-r.top)}}updateFloat(e){let n=this.wrapper,r=n.getBoundingClientRect(),i=e?Math.max(0,e.getBoundingClientRect().top):0;if(this.floating)if(r.top>=i||r.bottom(this.editorView.dom.ownerDocument.defaultView||window).innerHeight?"none":"",e&&(this.menu.style.top=i+"px")}else if(r.top=this.menu.offsetHeight+10){this.floating=!0;let l=this.menu.getBoundingClientRect();this.menu.style.left=l.left+"px",this.menu.style.width=l.width+"px",e&&(this.menu.style.top=i+"px"),this.menu.style.position="fixed",this.spacer=_t("div",{class:sp+"-spacer",style:`height: ${l.height}px`}),n.insertBefore(this.spacer,this.menu)}}destroy(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)}};u(j$,"MenuBarView");let z1=j$;function See(t){return t.anchorNode==t.focusNode?t.anchorOffset>t.focusOffset:t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}u(See,"selectionIsInverted");function Cee(t){for(let e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}u(Cee,"findWrappingScrollable");function kee(t){let e=[t.ownerDocument.defaultView||window];for(let n=t.parentNode;n;n=n.parentNode)e.push(n);return e}u(kee,"getAllWrapping");const q$=class q${constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?Dee(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}};u(q$,"InputRule");let pr=q$;function Dee(t){return function(e,n,r,i){let l=t;if(n[1]){let a=n[0].lastIndexOf(n[1]);l+=n[0].slice(a+n[1].length),r+=a;let o=r-i;o>0&&(l=n[0].slice(a-o,a)+l,r=i)}return e.tr.insertText(l,r,i)}}u(Dee,"stringHandler");const Pee=500;function Eee({rules:t}){let e=new jr({state:{init(){return null},apply(n,r){let i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,l){return B9(n,r,i,l,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&B9(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}u(Eee,"inputRules");function B9(t,e,n,r,i,l){if(t.composing)return!1;let a=t.state,o=a.doc.resolve(e),s=o.parent.textBetween(Math.max(0,o.parentOffset-Pee),o.parentOffset,null,"\uFFFC")+r;for(let c=0;cm.type.spec.code))continue;if(o.parent.type.spec.code){if(!d.inCode)continue}else if(d.inCode==="only")continue;let f=d.match.exec(s);if(!f||f[0].length{g.isInline&&g.marks.some(O=>O.type.spec.code)&&(m=!0)}),m)continue}let p=d.handler(a,f,h,n);if(p)return d.undoable&&p.setMeta(l,{transform:p,from:e,to:n,text:r}),t.dispatch(p),!0}return!1}u(B9,"run");const Tee=u((t,e)=>{let n=t.plugins;for(let r=0;r=0;s--)a.step(o.steps[s].invert(o.docs[s]));if(l.text){let s=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,s))}else a.delete(l.from,l.to);e(a)}return!0}}return!1},"undoInputRule"),Aee=new pr(/--$/,"\u2014",{inCodeMark:!1}),Qee=new pr(/\.\.\.$/,"\u2026",{inCodeMark:!1}),Mee=new pr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C",{inCodeMark:!1}),Bee=new pr(/"$/,"\u201D",{inCodeMark:!1}),Ree=new pr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),Vee=new pr(/'$/,"\u2019",{inCodeMark:!1}),Nee=[Mee,Bee,Ree,Vee];function Z1(t,e,n=null,r){return new pr(t,(i,l,a,o)=>{let s=n instanceof Function?n(l):n,c=i.tr.delete(a,o),d=c.doc.resolve(a),f=d.blockRange(),h=f&&Vy(f,e,s);if(!h)return null;c.wrap(f,h);let p=c.doc.resolve(a-1).nodeBefore;return p&&p.type==e&&ao(c.doc,a-1)&&(!r||r(l,p))&&c.join(a-1),c})}u(Z1,"wrappingInputRule");function R9(t,e,n=null){return new pr(t,(r,i,l,a)=>{let o=r.doc.resolve(l),s=n instanceof Function?n(i):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e)?r.tr.delete(l,a).setBlockType(l,l,e,s):null})}u(R9,"textblockTypeInputRule");const up="ProseMirror-prompt";function V9(t){let e=document.body.appendChild(document.createElement("div"));e.className=up;let n=u(h=>{e.contains(h.target)||r()},"mouseOutside");setTimeout(()=>window.addEventListener("mousedown",n),50);let r=u(()=>{window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},"close"),i=[];for(let h in t.fields)i.push(t.fields[h].render());let l=document.createElement("button");l.type="submit",l.className=up+"-submit",l.textContent="OK";let a=document.createElement("button");a.type="button",a.className=up+"-cancel",a.textContent="Cancel",a.addEventListener("click",r);let o=e.appendChild(document.createElement("form"));t.title&&(o.appendChild(document.createElement("h5")).textContent=t.title),i.forEach(h=>{o.appendChild(document.createElement("div")).appendChild(h)});let s=o.appendChild(document.createElement("div"));s.className=up+"-buttons",s.appendChild(l),s.appendChild(document.createTextNode(" ")),s.appendChild(a);let c=e.getBoundingClientRect();e.style.top=(window.innerHeight-c.height)/2+"px",e.style.left=(window.innerWidth-c.width)/2+"px";let d=u(()=>{let h=Fee(t.fields,i);h&&(r(),t.callback(h))},"submit");o.addEventListener("submit",h=>{h.preventDefault(),d()}),o.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),r()):h.keyCode==13&&!(h.ctrlKey||h.metaKey||h.shiftKey)?(h.preventDefault(),d()):h.keyCode==9&&window.setTimeout(()=>{e.contains(document.activeElement)||r()},500)});let f=o.elements[0];f&&f.focus()}u(V9,"openPrompt");function Fee(t,e){let n=Object.create(null),r=0;for(let i in t){let l=t[i],a=e[r++],o=l.read(a),s=l.validate(o);if(s)return Iee(a,s),null;n[i]=l.clean(o)}return n}u(Fee,"getValues");function Iee(t,e){let n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout(()=>n.removeChild(r),1500)}u(Iee,"reportInvalid");const W$=class W${constructor(e){this.options=e}read(e){return e.value}validateType(e){return null}validate(e){return!e&&this.options.required?"Required field":this.validateType(e)||(this.options.validate?this.options.validate(e):null)}clean(e){return this.options.clean?this.options.clean(e):e}};u(W$,"Field");let X1=W$;const Y$=class Y$ extends X1{render(){let e=document.createElement("input");return e.type="text",e.placeholder=this.options.label,e.value=this.options.value||"",e.autocomplete="off",e}};u(Y$,"TextField");let zl=Y$;function N9(t,e){let n=t.selection.$from;for(let r=n.depth;r>=0;r--){let i=n.index(r);if(n.node(r).canReplaceWith(i,i,e))return!0}return!1}u(N9,"canInsert");function Lee(t){return new an({title:"Insert image",label:"Image",enable(e){return N9(e,t)},run(e,n,r){let{from:i,to:l}=e.selection,a=null;e.selection instanceof ae&&e.selection.node.type==t&&(a=e.selection.node.attrs),V9({title:"Insert image",fields:{src:new zl({label:"Location",required:!0,value:a&&a.src}),title:new zl({label:"Title",value:a&&a.title}),alt:new zl({label:"Description",value:a?a.alt:e.doc.textBetween(i,l," ")})},callback(o){r.dispatch(r.state.tr.replaceSelectionWith(t.createAndFill(o))),r.focus()}})}})}u(Lee,"insertImageItem");function F9(t,e){let n={label:e.title,run:t};for(let r in e)n[r]=e[r];return!e.enable&&!e.select&&(n[e.enable?"enable":"select"]=r=>t(r)),new an(n)}u(F9,"cmdItem");function j1(t,e){let{from:n,$from:r,to:i,empty:l}=t.selection;return l?!!e.isInSet(t.storedMarks||r.marks()):t.doc.rangeHasMark(n,i,e)}u(j1,"markActive");function q1(t,e){let n={active(r){return j1(r,t)}};for(let r in e)n[r]=e[r];return F9(Ni(t),n)}u(q1,"markItem");function zee(t){return new an({title:"Add or remove link",icon:kn.link,active(e){return j1(e,t)},enable(e){return!e.selection.empty},run(e,n,r){if(j1(e,t))return Ni(t)(e,n),!0;V9({title:"Create a link",fields:{href:new zl({label:"Link target",required:!0}),title:new zl({label:"Title"})},callback(i){Ni(t,i)(r.state,r.dispatch),r.focus()}})}})}u(zee,"linkItem");function I9(t,e){return F9(C1(t,e.attrs),e)}u(I9,"wrapListItem");function L9(t){let e={},n;(n=t.marks.strong)&&(e.toggleStrong=q1(n,{title:"Toggle strong style",icon:kn.strong})),(n=t.marks.em)&&(e.toggleEm=q1(n,{title:"Toggle emphasis",icon:kn.em})),(n=t.marks.code)&&(e.toggleCode=q1(n,{title:"Toggle code font",icon:kn.code})),(n=t.marks.link)&&(e.toggleLink=zee(n));let r;if((r=t.nodes.image)&&(e.insertImage=Lee(r)),(r=t.nodes.bullet_list)&&(e.wrapBulletList=I9(r,{title:"Wrap in bullet list",icon:kn.bulletList})),(r=t.nodes.ordered_list)&&(e.wrapOrderedList=I9(r,{title:"Wrap in ordered list",icon:kn.orderedList})),(r=t.nodes.blockquote)&&(e.wrapBlockQuote=$ee(r,{title:"Wrap in block quote",icon:kn.blockquote})),(r=t.nodes.paragraph)&&(e.makeParagraph=I1(r,{title:"Change to paragraph",label:"Plain"})),(r=t.nodes.code_block)&&(e.makeCodeBlock=I1(r,{title:"Change to code block",label:"Code"})),r=t.nodes.heading)for(let l=1;l<=10;l++)e["makeHead"+l]=I1(r,{title:"Change to heading "+l,label:"Level "+l,attrs:{level:l}});if(r=t.nodes.horizontal_rule){let l=r;e.insertHorizontalRule=new an({title:"Insert horizontal rule",label:"Horizontal rule",enable(a){return N9(a,l)},run(a,o){o(a.tr.replaceSelectionWith(l.create()))}})}let i=u(l=>l.filter(a=>a),"cut");return e.insertMenu=new op(i([e.insertImage,e.insertHorizontalRule]),{label:"Insert"}),e.typeMenu=new op(i([e.makeParagraph,e.makeCodeBlock,e.makeHead1&&new F1(i([e.makeHead1,e.makeHead2,e.makeHead3,e.makeHead4,e.makeHead5,e.makeHead6]),{label:"Heading"})]),{label:"Type..."}),e.inlineMenu=[i([e.toggleStrong,e.toggleEm,e.toggleCode,e.toggleLink])],e.blockMenu=[i([e.wrapBulletList,e.wrapOrderedList,e.wrapBlockQuote,gee,Oee,bee])],e.fullMenu=e.inlineMenu.concat([[e.insertMenu,e.typeMenu]],[[yee,vee]],e.blockMenu),e}u(L9,"buildMenuItems");const z9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Zee(t,e){let n={},r;function i(l,a){if(e){let o=e[l];if(o===!1)return;o&&(l=o)}n[l]=a}if(u(i,"bind"),i("Mod-z",rp),i("Shift-Mod-z",ju),i("Backspace",Tee),z9||i("Mod-y",ju),i("Alt-ArrowUp",E1),i("Alt-ArrowDown",jJ),i("Mod-BracketLeft",T1),i("Escape",Q1),(r=t.marks.strong)&&(i("Mod-b",Ni(r)),i("Mod-B",Ni(r))),(r=t.marks.em)&&(i("Mod-i",Ni(r)),i("Mod-I",Ni(r))),(r=t.marks.code)&&i("Mod-`",Ni(r)),(r=t.nodes.bullet_list)&&i("Shift-Ctrl-8",C1(r)),(r=t.nodes.ordered_list)&&i("Shift-Ctrl-9",C1(r)),(r=t.nodes.blockquote)&&i("Ctrl->",M1(r)),r=t.nodes.hard_break){let l=r,a=lp(x9,(o,s)=>(s&&s(o.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0));i("Mod-Enter",a),i("Shift-Enter",a),z9&&i("Ctrl-Enter",a)}if((r=t.nodes.list_item)&&(i("Enter",vJ(r)),i("Mod-[",$J(r)),i("Mod-]",SJ(r))),(r=t.nodes.paragraph)&&i("Shift-Ctrl-0",ip(r)),(r=t.nodes.code_block)&&i("Shift-Ctrl-\\",ip(r)),r=t.nodes.heading)for(let l=1;l<=6;l++)i("Shift-Ctrl-"+l,ip(r,{level:l}));if(r=t.nodes.horizontal_rule){let l=r;i("Mod-_",(a,o)=>(o&&o(a.tr.replaceSelectionWith(l.create()).scrollIntoView()),!0))}return n}u(Zee,"buildKeymap");function Xee(t){return Z1(/^\s*>\s$/,t)}u(Xee,"blockQuoteRule");function jee(t){return Z1(/^(\d+)\.\s$/,t,e=>({order:+e[1]}),(e,n)=>n.childCount+n.attrs.order==+e[1])}u(jee,"orderedListRule");function qee(t){return Z1(/^\s*([-+*])\s$/,t)}u(qee,"bulletListRule");function Wee(t){return R9(/^```$/,t)}u(Wee,"codeBlockRule");function Yee(t,e){return R9(new RegExp("^(#{1,"+e+"})\\s$"),t,n=>({level:n[1].length}))}u(Yee,"headingRule");function Kee(t){let e=Nee.concat(Qee,Aee),n;return(n=t.nodes.blockquote)&&e.push(Xee(n)),(n=t.nodes.ordered_list)&&e.push(jee(n)),(n=t.nodes.bullet_list)&&e.push(qee(n)),(n=t.nodes.code_block)&&e.push(Wee(n)),(n=t.nodes.heading)&&e.push(Yee(n,6)),Eee({rules:e})}u(Kee,"buildInputRules");function Uee(t){let e=[Kee(t.schema),p9(Zee(t.schema,t.mapKeys)),p9(nee),ree(),aee()];return t.menuBar!==!1&&e.push(xee({floating:t.floatingMenu!==!1,content:t.menuContent||L9(t.schema).fullMenu})),t.history!==!1&&e.push(NJ()),e.concat(new jr({props:{attributes:{class:"ProseMirror-example-setup-style"}}}))}u(Uee,"exampleSetup");const Gee=wp.element.forwardRef(({rawView:t=!0,...e},n)=>{const[r,i]=wp.element.useState(e.value??""),[l,a]=wp.element.useState("visual"),o=wp.element.useRef(null),s=Hr.get("button-group");return wp.element.useEffect(()=>{e.onChange&&e.onChange(r)},[r]),wp.element.useEffect(()=>{const c=new Qh({nodes:OJ(h9.spec.nodes,"paragraph block*","block"),marks:h9.spec.marks}),d=Uee({schema:c,menuContent:L9(c).fullMenu}),f=document.createElement("div"),h=document.createElement("div");h.innerHTML=r,f.appendChild(h);const p=Cu.fromSchema(c).parse(h,{preserveWhitespace:!0}),m=qy.create({doc:p,plugins:d});return o.current=new ep(n.current,{state:m,dispatchTransaction:g=>{const O=o.current.state.apply(g);o.current.updateState(O);const b=o.current.dom.innerHTML;i(b)}}),()=>o.current.destroy()},[l]),wp.element.createElement("div",{className:"tf-editor-content"},t&&wp.element.createElement("div",{className:"tf-editor-view-toggle"},wp.element.createElement(s,{label:"Switch view",labelVisuallyHidden:!0,value:l,onChange:c=>{a(c),c==="raw"&&(n.current=null)},choices:{visual:"Visual",raw:"Raw"}})),l==="visual"?wp.element.createElement("div",{className:"tf-editor-visual-view",ref:n}):wp.element.createElement(zQ,{value:r,onChange:i}))});var _ee=Object.defineProperty,Hee=u((t,e)=>_ee(t,"name",{value:e,configurable:!0}),"n$6");const Jee=Hee(t=>{const[e,n]=wp.element.useState(t.value),r=wp.element.useRef(null),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("input",{...l,type:"hidden",name:t.name,value:e}),wp.element.createElement(Gee,{ref:r,value:e,onChange:n,rawView:t.rawView??!0}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Editor");var ete=Object.defineProperty,tte=u((t,e)=>ete(t,"name",{value:e,configurable:!0}),"l$5");const nte=tte(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si(t,e),[l,a]=wp.element.useState(t.value);return wp.element.useEffect(()=>{a(t.value)},[t.value]),wp.element.useEffect(()=>{setTimeout(()=>{tinyMCE.init({target:e.current,setup:function(o){o.on("input",()=>a(o.getContent()))}})})},[]),wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]),wp.element.createElement("div",{className:"tf-editor"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{ref:e,...r},l),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TinyMce");var rte=Object.defineProperty,ite=u((t,e)=>rte(t,"name",{value:e,configurable:!0}),"t$4"),Z9=ite(t=>{const{editor:e}=t;return e==="tinymce"?wp.element.createElement(nte,{...t}):wp.element.createElement(Jee,{...t})},"default"),lte=Object.defineProperty,ate=u((t,e)=>lte(t,"name",{value:e,configurable:!0}),"n$5");const ote=ate(({config:t,values:e,onChange:n,data:r})=>{const i=Object.keys(Hr._types.element).includes(t.type??""),l=i?$0:hp,a=i?{}:{value:e[t.name]??"",onChange:n};return wp.element.createElement(l,{itemType:i?"subelement":"subfield",visibility:{action:t.condition?.action??"show",condition:t.condition?.condition??!1},data:r,...t,...a})},"FieldGroupItem");var ste=Object.defineProperty,W1=u((t,e)=>ste(t,"name",{value:e,configurable:!0}),"s$5");const Y1=W1(t=>{const[e,n]=wp.element.useState([]),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(On(t.value??"")),o=wp.element.useRef();o.current=l;const s=W1((f,h)=>{a({...l,[f]:h}),e.length!==0&&i(()=>()=>{e.map(p=>p(f))})},"setAttribute");wp.element.useEffect(()=>{t.onChange&&t.onChange(l),r&&(r(),i(!1))},[l]);const c=t.fields??[],d=W1(f=>c.map(h=>h.name??!1).includes(f),"hasField");return wp.element.createElement("div",{className:"tf-field-group"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l)}),c.map((f,h)=>wp.element.createElement("div",{key:h,className:"tf-field-group-item"},wp.element.createElement(ote,{values:l,config:f,onChange:p=>s(f.name,p),data:{getValue:p=>d(p)?o.current[p]??"":t.data.getValue(p)??"",watcher:p=>{n(m=>[...m,g=>p(g)])}}}))))},"FieldGroup");var ute=Object.defineProperty,X9=u((t,e)=>ute(t,"name",{value:e,configurable:!0}),"p$1");const cte=X9(t=>{const{api:e}=Zn(),n=new FormData;return n.append("file",t),n.append("title",t.name),n.append("caption",t.caption),qU(e.endpoint.media,n)},"postMedia"),j9=X9(t=>{const{api:e}=Zn();return WQ(e.endpoint.media+t)},"getMedia");var dte=Object.defineProperty,q9=u((t,e)=>dte(t,"name",{value:e,configurable:!0}),"s$4");const fte=q9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);if(wp.element.useEffect(()=>{q9(async()=>{const o=await j9(t.id);i(o),n(!0)},"fetch")()},[]),!e||!r)return wp.element.createElement("li",{className:"tf-file-item"},"Loading...");const l=r.source_url,a=l.split("/").pop().split(".").length===2?l.split("/").pop().split(".")[1]:"";return wp.element.createElement("li",{className:"tf-file-item"},r.media_type==="image"&&wp.element.createElement("img",{loading:"lazy",decoding:"async",src:l,alt:r.alt_text,className:"attachment-medium size-medium"}),wp.element.createElement("span",null,`${r.title.rendered}${a!==""?"."+a:""}`),wp.element.createElement(se,{type:"action",onPress:()=>t.remove()},"Remove"))},"FilePreview");var hte=Object.defineProperty,_r=u((t,e)=>hte(t,"name",{value:e,configurable:!0}),"l$4");const pte=_r(t=>{const{mimetypes:e}=Zn(),n=wp.element.useRef(null),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(!1),[o,s]=wp.element.useState(t.value?Array.isArray(t.value)?t.value:JSON.parse(t.value):[]),[c,d]=wp.element.useState(!1),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>t.onChange&&t.onChange(o),[o]);const m=t.placeholder??"No file selected",g=t.maxUpload??!1,O=_r(()=>(g===!1||o.length(g===!1||o.length{a(!0),d(!1),cte(r[0]).then(C=>s([...o,C.id])).catch(C=>d(C.message)).finally(()=>{i(!1),a(!1)})},"upload"),$=_r(C=>{s([...o.slice(0,C),...o.slice(C+1)])},"removeUpload"),v=_r(()=>t.wp_media===!1||t.wp_media==="false","isWpMediaDisabled"),S=_r(()=>{const{mimeTypes:C}=t,Q=Object.values(e),T=_r(B=>B.includes("/")?B:Q.filter(w=>w.startsWith(`${B}/`)),"filterByMimetypePrefix");return(C?Array.isArray(C)?C.flatMap(T):T(C):Q).join(", ")},"getAllowedTypes"),x=_r(()=>{const C=wp.media({title:"Choose File",multiple:!1,library:{type:S()}});C.on("select",()=>{const Q=C.state().get("selection").first().toJSON();s([...o,Q.id])}),C.open()},"open");return wp.element.createElement("div",{className:"tf-file"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement(gn,null,wp.element.createElement("input",{type:"file",ref:n,accept:S(),onChange:C=>i(C.target.files),...h})),wp.element.createElement("div",{className:"tf-file-container"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(o)}),wp.element.createElement("ul",{className:"tf-file-list"},o.map((C,Q)=>wp.element.createElement(fte,{key:C,id:C,remove:()=>$(Q)}))),wp.element.createElement("div",{className:"tf-file-field"},wp.element.createElement(se,{type:"action",onPress:()=>v()?n.current.click():x(),isDisabled:!b(),"aria-hidden":"true"},t.buttonText??"Choose"),wp.element.createElement("div",{className:"tf-file-text","aria-hidden":"true"},r.length>0?r[0].name:m),v()&&wp.element.createElement(se,{type:"action",onPress:y,isDisabled:!O()},t.uploadText??"Upload"))),c&&wp.element.createElement(UP,{message:c,type:"error",onDismiss:()=>d(!1)}),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"FileUpload");var mte=Object.defineProperty,cp=u((t,e)=>mte(t,"name",{value:e,configurable:!0}),"l$3");const gte=cp(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1),[l,a]=wp.element.useState(t.value&&t.value!==""?typeof t.value!="object"?JSON.parse(t.value):t.value:{type:"linear",angle:45,shape:"ellipse",colors:["rgba(0,255,255,1)","rgba(0,255,255,1)"]}),o=wp.element.useRef(),s=wp.element.useRef(),c=wp.element.useRef(),d=wp.element.useRef(),{labelProps:f,fieldProps:h,descriptionProps:p}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange({...l,stringValue:m()})},[l]);const m=cp(()=>{switch(l.type){case"linear":return`linear-gradient(${l.angle}deg, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"radial":return`radial-gradient(${l.shape}, ${l.colors[0]} 0%, ${l.colors[1]} 100%)`;case"conic":return`conic-gradient(${l.colors[0]} 0%, ${l.colors[1]} 100%)`}},"generateGradient"),g=cp((b,y)=>{const $=[...l.colors];$[b]=y?.toString("rgba"),O("colors",$)},"updateColor"),O=cp((b,y)=>{a({...l,[b]:y})},"updateValue");return wp.element.createElement("div",{className:"tf-gradient"},t.label&&wp.element.createElement(xe,{labelProps:f,parent:t},t.label),wp.element.createElement("div",{className:"tf-gradient-container",ref:d},wp.element.createElement("input",{ref:s,type:"text",className:"tf-gradient-input",value:m(),onClick:b=>i(!0),readOnly:!0}),wp.element.createElement("input",{type:"hidden",ref:o,value:JSON.stringify(l),name:t.name??"",...h}),r&&wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:s,placement:"bottom start",style:{width:d?.current?.offsetWidth,minWidth:"fit-content"},className:"tf-gradient-popover"},wp.element.createElement(gs,null,wp.element.createElement(vd,{autoFocus:!0},wp.element.createElement("div",{className:"tf-gradient-popover-content"},wp.element.createElement("div",{className:"tf-gradient-preview",ref:c,style:{background:m()}},wp.element.createElement("div",{className:"tf-gradient-colors"},l.colors?.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-gradient-color tf-color-area-thumb",style:{background:l.colors[y]},onClick:()=>n(y)})))),wp.element.createElement("div",{className:"tf-gradient-settings"},wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Js,{label:"Gradient type",selectedKey:l.type??"linear",onSelectionChange:b=>O("type",b)},wp.element.createElement(Qr,{key:"linear"},"Linear"),wp.element.createElement(Qr,{key:"radial"},"Radial"),wp.element.createElement(Qr,{key:"conic"},"Conical"))),wp.element.createElement("div",null,l.type==="linear"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Bf,{label:"Angle",value:l.angle??45,onChange:b=>O("angle",b)})),l.type==="radial"&&wp.element.createElement("div",{className:"tf-gradient-settings-row"},wp.element.createElement(Js,{label:"Shape",selectedKey:l.shape??"ellipse",onSelectionChange:b=>O("shape",b)},wp.element.createElement(Qr,{key:"circle"},"Circle"),wp.element.createElement(Qr,{key:"ellipse"},"Ellipse"))))))))),e!==!1&&wp.element.createElement(Rr,{state:{isOpen:e!==!1,close:()=>n(!1)},triggerRef:c,placement:e===0?"bottom start":"bottom end"},wp.element.createElement(XQ,{value:l.colors[e],onChange:b=>g(e,b),hasAlpha:!0,onFocusChange:b=>b===!1?n(!1):!1}))),t.description&&wp.element.createElement(we,{descriptionProps:p,parent:t},t.description))},"Gradient");var Ote=Object.defineProperty,W9=u((t,e)=>Ote(t,"name",{value:e,configurable:!0}),"a$2");const bte=W9(t=>{const[e,n]=wp.element.useState(!1),[r,i]=wp.element.useState(!1);return wp.element.useEffect(()=>{W9(async()=>{const l=await j9(t.id);i(l),n(!0)},"fetch")()},[]),!e||!r?wp.element.createElement("div",{className:"tf-gallery-item"},"Loading..."):wp.element.createElement("div",{className:"tf-gallery-item"},wp.element.createElement("img",{src:r.source_url}))},"ImagePreview");var yte=Object.defineProperty,dp=u((t,e)=>yte(t,"name",{value:e,configurable:!0}),"a$1");const vte=dp(t=>{const e=dp(c=>(c!=="[]"?c.split(","):[]).map(d=>d.replaceAll("[","").replaceAll("]","").replaceAll('"',"")),"initValue"),[n,r]=wp.element.useState(t.value&&Array.isArray(t.value)?t.value:t.value?e(t.value):[]),{labelProps:i,inputProps:l,descriptionProps:a}=$t(t);wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const o=dp(()=>{const c=wp.media({frame:"post",multiple:!0,button:{text:"Use this media"},library:{type:["image"]},state:n.length<1?"gallery":"gallery-edit",selection:s()});c.on({update:d=>{r(d.models.map(f=>f.id))},open:()=>{c.menuView.unset("playlist"),c.menuView.unset("video-playlist")}},void 0),c.open()},"open"),s=dp(()=>{const c=wp.media.query({orderby:"post__in",order:"ASC",type:"image",perPage:-1,post__in:n});return new wp.media.model.Selection(c.models,{props:c.props.toJSON(),multiple:!0})},"getSelection");return wp.element.createElement("div",{className:"tf-gallery"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{className:"tf-gallery__controls"},wp.element.createElement("div",{className:"tf-gallery-preview"},n.map(c=>wp.element.createElement(bte,{key:c,id:c})))),wp.element.createElement("div",{className:"tf-gallery-buttons"},wp.element.createElement(se,{type:"action",onPress:o},n.length<1?"Create gallery":"Edit gallery"),n.length>0&&wp.element.createElement(se,{type:"action",onPress:()=>r([])},"Clear gallery")),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:n.join(","),...l}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"Gallery");var $te=Object.defineProperty,wte=u((t,e)=>$te(t,"name",{value:e,configurable:!0}),"a");const xte=wte(t=>wp.element.createElement("input",{type:"hidden",name:t.name,value:t.value,...t.attributes,className:`tf-hidden ${t.class??""} ${t.className??""}`}),"InputHidden");var Ste=Object.defineProperty,Ku=u((t,e)=>Ste(t,"name",{value:e,configurable:!0}),"i$5");const Cte=Ku(t=>{const e={value:"",_canDelete:!0,_enabled:!0},[n,r]=wp.element.useState(On(t.value??"[]",[]));wp.element.useEffect(()=>{t.onChange&&t.onChange(n)},[n]);const[i,l]=wp.element.useState(""),a=wp.element.useRef(0),{labelProps:o,fieldProps:s,descriptionProps:c}=$t(t),d=Ku(()=>{r([...n,{...e,value:i}]),l(""),a.current=a.current+1},"addSelectedItem"),f=Ku(m=>{r([...n.slice(0,m),...n.slice(m+1)])},"removeItem"),h=Ku((m,g,O)=>{setTimeout(()=>{r([...n.slice(0,m),{...n[m],[g]:O},...n.slice(m+1)])})},"updateItem"),p=Ku(m=>t.isAsync?m.label:t.choices[m]??m,"getItemText");return t.isAsync&&console.warn("Async mode is not supported yet for the list field"),wp.element.createElement("div",{className:"tf-list"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(n),...s}),wp.element.createElement("div",{className:"tf-list-container"},wp.element.createElement("div",{className:"tf-list-items"},wp.element.createElement("div",{className:"tf-list-header"},t.label&&wp.element.createElement(xe,{labelProps:o,parent:t},t.label),wp.element.createElement("div",{className:"tf-list-header-actions"})),wp.element.createElement("div",{className:"tf-list-items"},n.map((m,g)=>wp.element.createElement("div",{key:m.value,className:"tf-list-item"},wp.element.createElement("div",{className:"tf-list-item-text"},p(m.value)),wp.element.createElement("div",{key:m,className:"tf-list-item-actions"},m._canDelete&&wp.element.createElement(se,{type:"icon-trash",onPress:()=>f(g)}),t.useVisibility&&wp.element.createElement(se,{type:"icon-eye",onPress:()=>h(g,"_enabled",!m._enabled),style:m._enabled?{}:{opacity:.5,filter:"grayscale(60%)"}})))))),wp.element.createElement("div",{className:"tf-list-search"},wp.element.createElement(xh,{...t,name:null,key:a.current,value:i,description:!1,labelVisuallyHidden:!0,disabledKeys:n.map(m=>m.value),multiple:!1,onChange:m=>{m&&l(m)}}),wp.element.createElement(se,{type:"action",onPress:d,isDisabled:i===""},"Add"))),t.description&&wp.element.createElement(we,{descriptionProps:c,parent:t},t.description))},"List");var kte=Object.defineProperty,Dte=u((t,e)=>kte(t,"name",{value:e,configurable:!0}),"t$3"),Pte=Dte(t=>{const[e,n]=wp.element.useState(t.value??""),r=il(t.choices??{});return wp.element.useEffect(()=>t.onChange&&t.onChange(e),[e]),wp.element.createElement(OE,{...t,onChange:n},r.map(i=>wp.element.createElement(bE,{key:i.value??"",...i},i.label??"")))},"default"),Ete=Object.defineProperty,Tte=u((t,e)=>Ete(t,"name",{value:e,configurable:!0}),"m$4");const Ate=Tte(t=>{const[e,n]=wp.element.useState(t.value?W2(t.value):new Set),[r,i]=wp.element.useState(!1),l=y0({...t,selectionMode:"multiple",onSelectionChange:n,selectedKeys:e}),a=wp.element.useRef(),o=wp.element.useRef(),s=wp.element.useRef(),{listBoxProps:c,labelProps:d,descriptionProps:f}=lD(t,l,a);wp.element.useEffect(()=>{t.onChange&&t.onChange([...e])},[e]);const h=wp.element.createElement(Vd,{listBoxRef:a,state:l,items:t.items,...c});return wp.element.createElement("div",{className:"tf-multiple-select",ref:s},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:[...e].join(",")}),t.label&&wp.element.createElement(xe,{labelProps:d,parent:t},t.label),wp.element.createElement(se,{type:"select",ref:o,onPress:()=>i(!r)},wp.element.createElement("span",{className:"tf-multiple-select__value"},e.size>0?e.size===1?e.size+" item selected":e.size+" items selected":t.placeholder??"Select an option"),wp.element.createElement("span",{"aria-hidden":"true",className:"tf-select-icon"},"\u25BC")),r?wp.element.createElement(Rr,{state:{isOpen:r,close:()=>i(!1)},triggerRef:o,placement:"bottom start",style:{width:s?.current?.offsetWidth}},h):wp.element.createElement(gn,null,h),t.description&&wp.element.createElement(we,{descriptionProps:f,parent:t},t.description))},"MultipleSelect");var Qte=Object.defineProperty,Mte=u((t,e)=>Qte(t,"name",{value:e,configurable:!0}),"t$2"),Y9=Mte(t=>t.multiple?wp.element.createElement(Ate,{items:il(t.choices??{}),...t,onChange:t.onChange},Ld):wp.element.createElement(Js,{selectedKey:t.value,onSelectionChange:t.onChange,items:il(t.choices??{}),...t},Ld),"default"),Bte=Object.defineProperty,K9=u((t,e)=>Bte(t,"name",{value:e,configurable:!0}),"l$2");const Rte=K9(t=>{const e=t.units??["px"],{labelProps:n,fieldProps:r,descriptionProps:i}=$t(t),[l,a]=wp.element.useState(On(t.value??"",{value:0,unit:e[0]}));wp.element.useEffect(()=>t.onChange&&t.onChange(l),[l]);const o=K9((s,c)=>{a({...l,[c]:s})},"setAttribute");return wp.element.createElement("div",{className:"tf-simple-dimensions"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(l),...r}),wp.element.createElement("div",{className:"tf-simple-dimensions-container"},wp.element.createElement("div",null,wp.element.createElement(Bf,{value:l.value??0,name:"value",label:"Dimension number",labelVisuallyHidden:!0,description:!1,onChange:s=>o(s,"value")})),wp.element.createElement(Js,{label:"Dimension unit",labelVisuallyHidden:!0,description:!1,selectedKey:l.unit??"px",onSelectionChange:s=>o(s,"unit"),placeholder:"unit"},e.map(s=>wp.element.createElement(Qr,{key:s},s)))),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"Dimensions");var Vte=Object.defineProperty,Nte=u((t,e)=>Vte(t,"name",{value:e,configurable:!0}),"l$1");const Fte=Nte(t=>{const e=kx(t),n=wp.element.useRef(),{inputProps:r}=HF({...t,children:t.label??""},e,n),{focusProps:i}=rs(),{labelProps:l,fieldProps:a,descriptionProps:o}=$t(t);return wp.element.useEffect(()=>t.onChange&&t.onChange(e.isSelected),[e.isSelected]),wp.element.useEffect(()=>{t.value!==e.isSelected&&e.setSelected(t.value)},[t.value]),wp.element.createElement("div",{className:"tf-switch"},t.label&&wp.element.createElement(xe,{labelProps:l,parent:t},t.label),wp.element.createElement("label",{className:"tf-switch-label"},wp.element.createElement(gn,null,wp.element.createElement("input",{...a,...r,...i,ref:n,name:""})),wp.element.createElement("div",{className:`tf-switch-element${e.isSelected?"-selected":""}`,"aria-hidden":"true"},wp.element.createElement("span",null))),t.description&&wp.element.createElement(we,{descriptionProps:o,parent:t},t.description))},"Switch");var Ite=Object.defineProperty,Lte=u((t,e)=>Ite(t,"name",{value:e,configurable:!0}),"t$1"),K1=Lte(t=>{const e=t.valueOn??"on",n=t.valueOff??"off",[r,i]=wp.element.useState(t.value??n);return wp.element.useEffect(()=>t.onChange&&t.onChange(r),[r]),wp.element.useEffect(()=>{[e,n].includes(t.value)&&t.value!==r&&i(t.value)},[t.value]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(Fte,{label:t.label??"",labelVisuallyHidden:t.labelVisuallyHidden??!1,description:t.description??"",value:r===e,onChange:l=>i(l?e:n)}))},"default"),zte=Object.defineProperty,Zte=u((t,e)=>zte(t,"name",{value:e,configurable:!0}),"o$2");const Xte=Zte(t=>{const{Header:e,Container:n,Content:r,Title:i}=GP,l=Object.keys(t.tabs??{}).map(d=>({...t.tabs[d],name:d})),[a,o]=wp.element.useState(l[0]?.name??!1),[s,c]=wp.element.useState(On(t.value));return wp.element.useEffect(()=>t.onChange&&t.onChange(s),[s]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("input",{type:"hidden",name:t.name??"",value:JSON.stringify(s)}),wp.element.createElement(n,null,wp.element.createElement(e,null,l.map(d=>wp.element.createElement(i,{key:d.name,isOpen:d.name===a,onPress:()=>o(d.name)},d.title))),l&&l.map((d,f)=>wp.element.createElement(r,{key:d.name,isActive:d.name===a},wp.element.createElement(Y1,{...t,name:null,fields:d.fields,value:s[d.name]??{},onChange:h=>c({...s,[d.name]:h})})))))},"Tab");var jte=Object.defineProperty,qte=u((t,e)=>jte(t,"name",{value:e,configurable:!0}),"n$3");const U9=qte(t=>{const[e,n]=wp.element.useState(t.value??""),r=wp.element.useRef(),{labelProps:i,inputProps:l,descriptionProps:a}=si(t,r);return wp.element.useEffect(()=>{t.onChange&&t.onChange(e)},[e]),wp.element.createElement("div",{className:"tf-text"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement(IX,{...t,inputProps:l,onChange:n,ref:r,dynamic:t.dynamic??!1}),t.description&&wp.element.createElement(we,{descriptionProps:a,parent:t},t.description))},"TextField");var Wte=Object.defineProperty,Yte=u((t,e)=>Wte(t,"name",{value:e,configurable:!0}),"i$4");const Kte=Yte(t=>{const e=wp.element.useRef(),{labelProps:n,inputProps:r,descriptionProps:i}=si({...t,inputElementType:"textarea"},e);return wp.element.createElement("div",{className:"tf-text-area"},t.label&&wp.element.createElement(xe,{labelProps:n,parent:t},t.label),wp.element.createElement("textarea",{...r,maxLength:t.maxlength,minLength:t.minlength,required:t.required,rows:t.rows,ref:e,"data-identifier":t.identifier??""}),t.description&&wp.element.createElement(we,{descriptionProps:i,parent:t},t.description))},"TextArea");var Ute=Object.defineProperty,Gte=u((t,e)=>Ute(t,"name",{value:e,configurable:!0}),"m$3");const _te=Gte(t=>{const{locale:e}=Re(),n=jI({...t,value:t.value,onChange:s=>{const{hour:c,minute:d,second:f}=s;t.onChange?.(new Tr(c,d,f))},locale:e,minValue:t.minValue,maxValue:t.maxValue}),r=wp.element.useRef(),{labelProps:i,descriptionProps:l,fieldProps:a,inputProps:o}=fF(t,n,r);return wp.element.createElement("div",{className:"tf-time-wrapper"},t.label&&wp.element.createElement(xe,{labelProps:i,parent:t},t.label),wp.element.createElement("div",{...a,className:"tf-time-field"},n.segments.map((s,c)=>wp.element.createElement(lM,{key:c,segment:s,state:n})),n.isInvalid&&wp.element.createElement("span",{"aria-hidden":"true"},"\u{1F6AB}")),t.description&&wp.element.createElement(we,{descriptionProps:l,parent:t},t.description))},"TimeField");var Hte=Object.defineProperty,G9=u((t,e)=>Hte(t,"name",{value:e,configurable:!0}),"t");const Jte=G9(t=>{const e=G9(o=>{if(!o||typeof o!="string")return new Tr(0,0);if(o instanceof Tr)return o;const[s,c]=o.split(":").map(d=>parseInt(d));return new Tr(s,c)},"convertTime"),n=parseInt(t.hourCycle)??12,[r,i]=wp.element.useState(e(t.value)),l=e(t.minValue??"00:00"),a=e(t.maxValue??"23:59");return wp.element.useEffect(()=>{e(t.value).toString()!==r.toString()&&i(t.value)},[t.value]),wp.element.useEffect(()=>{r.toString()!==t.value.toString()&&t.onChange?.(r.toString())},[r]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-time-picker"},wp.element.createElement("input",{type:"hidden",name:t.name??"",value:r}),wp.element.createElement(_te,{label:t.label??"",description:t.description??"",labelVisuallyHidden:t.labelVisuallyHidden,descriptionVisuallyHidden:t.descriptionVisuallyHidden,value:r,onChange:i,name:t.name??"",hourCycle:n,minValue:l,maxValue:a})))},"TimePicker");var ene=Object.defineProperty,_9=u((t,e)=>ene(t,"name",{value:e,configurable:!0}),"c$3");const U1=_9(t=>{const[e,n]=wp.element.useState(""),[r,i]=wp.element.useState(!1);wp.element.useEffect(()=>{r?t.dispatch({type:"bulkCheck"}):t.dispatch({type:"bulkUncheck"})},[r]);const l=_9(()=>{switch(e){case"enabled":case"disabled":t.dispatch({type:"bulkUpdate",control:"enabled",value:e==="enabled"?"on":"off",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break;case"deletion":t.dispatch({type:"bulkRemove",callback:()=>{t.dispatch({type:"bulkUncheck"}),i(!1)}});break}},"applyAction");return wp.element.createElement("div",{className:"tf-repeater-bulk-actions"},wp.element.createElement(tu,{label:"Select or unselect all items",labelVisuallyHidden:!0,value:r,onChange:i}),wp.element.createElement(Y9,{label:"Select bulk action",labelVisuallyHidden:!0,placeholder:"Bulk actions",choices:t.actions,value:e,onChange:n}),e==="deletion"?wp.element.createElement($s,{title:"Confirmation",label:"Apply",onValidate:l},"Are you sure you want to remove the selected items?"):wp.element.createElement(se,{type:"action",onPress:l},"Apply"))},"BulkActions");var tne=Object.defineProperty,Uu=u((t,e)=>tne(t,"name",{value:e,configurable:!0}),"n$2");const nne=Uu((t,e=!1)=>e?e.map(n=>typeof n=="object"?n.name??!1:n):t.map(n=>n.name??""),"getHeaderFieldsName"),rne=Uu((t,e=!1)=>{const n=nne(t,e);return t.filter(r=>n.includes(r.name)||n.includes(r.name+".label")).map(r=>ine(r,e))},"getHeaderConfig"),ine=Uu((t,e)=>{const n=e?e.find(r=>typeof r=="object"&&r.callback&&r.name===t.name):!1;return{...t,callback:n?lne(n):!1}},"formatConfig"),lne=Uu(t=>typeof t.callback=="function"?t.callback:typeof t.callback=="string"?G1.repeater.__callbacks[t.callback]??!1:!1,"getCallback"),ane=Uu((t,e)=>!e[t.name]||e[t.name]===""?wp.element.createElement("i",null,"Empty"):t.callback?t.callback({column:t,value:e[t.name]}):typeof e[t.name]=="object"?e[t.name].label===""?JSON.stringify(e[t.name]):e[t.name].label:e[t.name],"renderHeaderValue");var one=Object.defineProperty,sne=u((t,e)=>one(t,"name",{value:e,configurable:!0}),"f$2");const une=sne(({items:t,fields:e,rowFields:n,renderItem:r,maxLength:i,dispatch:l,headerFields:a=!1,beforeRow:o=!1,afterRow:s=!1,renderAction:c,renderFooterActions:d,useBulk:f})=>{const[h,p]=wp.element.useState(!1),m=rne(e,a);return wp.element.createElement(wp.element.Fragment,null,f&&wp.element.createElement(U1,{actions:{deletion:"Delete"},dispatch:l}),wp.element.createElement("div",{className:"tf-repeater-advanced"},wp.element.createElement("div",{className:"tf-repeater-advanced-header tf-repeater-advanced-label-row"},wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"}),m.map((g,O)=>wp.element.createElement("div",{key:O,className:"tf-repeater-advanced-header-item tf-repeater-advanced-label-row-item"},g.label??"")),wp.element.createElement("div",{key:"arrow",className:"tf-repeater-advanced-label-row-arrow"})),wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-advanced-items"},t&&t.slice(0,i).map((g,O)=>wp.element.createElement("div",{key:g.key??O,className:"tf-repeater-advanced-item","data-open":h===O?"true":"false"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview tf-repeater-advanced-label-row"},f&&wp.element.createElement("div",{className:"tf-repeater-advanced-item-checkbox",onClick:b=>b.stopPropagation()},wp.element.createElement(tu,{label:`Select item ${O+1}`,labelVisuallyHidden:!0,value:g._bulkCheckbox,onChange:b=>l({type:"update",item:O,control:"_bulkCheckbox",value:b})})),wp.element.createElement("div",{key:"index",className:"tf-repeater-advanced-label-row-index"},O+1),wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-container"},wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-fields"},m.map((b,y)=>wp.element.createElement("div",{key:y,className:"tf-repeater-advanced-overview-item tf-repeater-advanced-label-row-item"},ane(b,g)))),i!==void 0&&wp.element.createElement("div",{className:"tf-repeater-advanced-overview-item-actions"},wp.element.createElement(se,{type:"text-primary",onPress:()=>p(h===O?!1:O)},h===O?"Close":"Edit"),c("clone",O,{type:"text-primary"}),c("delete",O,{buttonProps:{type:"text-danger"}}))),wp.element.createElement(se,{key:"arrow",type:"repeater-overview-open",onPress:()=>p(h===O?!1:O),changeTag:"span",className:"tf-repeater-advanced-label-row-arrow"},wp.element.createElement("div",null))),h===O&&wp.element.createElement("div",{className:"tf-repeater-advanced-row"},o&&o(g,O,l),n.map(b=>wp.element.createElement("div",{key:b.name??O,className:"tf-repeater-advanced-item-field"},r(b,g,O))),s&&s(g,O,l)))))),d())},"Advanced");var cne=Object.defineProperty,dne=u((t,e)=>cne(t,"name",{value:e,configurable:!0}),"f$1");const fne=dne(({items:t,rowFields:e,renderItem:n,maxLength:r,dispatch:i,beforeRow:l=!1,afterRow:a=!1,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-bare-items"},t&&t.slice(0,r).map((c,d)=>wp.element.createElement("div",{key:c.key??d,className:"tf-repeater-bare-row"},l&&l(c,d,i),e.map(f=>wp.element.createElement("div",{key:f.name??d,className:"tf-repeater-bare-item-field"},n(f,c,d))),o("delete",d),a&&a(c,d,i)))),s()),"Bare");var hne=Object.defineProperty,pne=u((t,e)=>hne(t,"name",{value:e,configurable:!0}),"d$1");const H9=pne((t,e,n,r,i,l)=>{const a=n||"Item "+(e+1);if(!JP(a))return a;const o={type:"wrapper",name:`_repeater-title-${r}-${t.key}`,content:n,dependent:{callbackData:{repeater:{props:l,item:t,index:e}},...l.dependent?l.dependent:{}}};return i(o,t,e)},"renderTitle");var mne=Object.defineProperty,fp=u((t,e)=>mne(t,"name",{value:e,configurable:!0}),"n$1");const gne=fp(({items:t,dispatch:e,rowFields:n,renderItem:r,maxLength:i,title:l=!1,useSwitch:a,useBulk:o,name:s,renderFooterActions:c,renderAction:d,parent:f})=>{const[h,p]=wp.element.useState(0),m=fp(y=>p(y!==h?y:!1),"toggleItem"),g={deletion:"Delete"};a&&(g.enabled="Enabled",g.disabled="Disabled");const O=fp((y,$)=>wp.element.createElement(wp.element.Fragment,null,o?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(tu,{label:`Select item ${$+1}`,labelVisuallyHidden:!0,value:y._bulkCheckbox,onChange:v=>e({type:"update",item:$,control:"_bulkCheckbox",value:v})})):null,a?wp.element.createElement("div",{onClick:v=>v.stopPropagation()},wp.element.createElement(K1,{label:`Enable item ${$+1}`,labelVisuallyHidden:!0,value:y.enabled,onChange:v=>e({type:"update",item:$,control:"enabled",value:v})})):null),"getHeaderLeft"),b=fp((y,$)=>wp.element.createElement(wp.element.Fragment,null,d("clone",y),wp.element.createElement(se,{type:"action",onPress:()=>m(y)},h!==y?"Edit":"Close"),d("delete",y)),"actions");return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-items tf-repeater-block-items"},o&&wp.element.createElement(U1,{actions:g,dispatch:e}),t&&t.slice(0,i).map((y,$)=>wp.element.createElement(_2,{key:y.key??$,title:H9(y,$,l,s,r,f),footer:b($,y),isOpen:h===$,className:"tf-repeater-block-item",onChange:v=>v?h!==$?p($):null:h===$?p(!1):null,headerLeft:O(y,$)},n.map(v=>wp.element.createElement("div",{key:v.name??$,className:"tf-repeater-block-item-field"},r(v,y,$)))))),c())},"Block");var One=Object.defineProperty,bne=u((t,e)=>One(t,"name",{value:e,configurable:!0}),"c$1");const yne={deletion:"Delete"},vne=bne(({items:t,fields:e,dispatch:n,rowFields:r,renderItem:i,maxLength:l,useBulk:a,renderAction:o,renderFooterActions:s})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",null,a&&wp.element.createElement(U1,{actions:yne,dispatch:n}),wp.element.createElement("table",null,wp.element.createElement("thead",null,wp.element.createElement("tr",null,a&&wp.element.createElement("th",null),e.map((c,d)=>wp.element.createElement("th",{key:d},c.label??"")),l>1&&wp.element.createElement("th",{align:"end"}))),wp.element.createElement("tbody",{className:"tf-repeater-items tf-repeater-table-items"},t&&t.slice(0,l).map((c,d)=>wp.element.createElement("tr",{key:c.key??d},a&&wp.element.createElement("td",{key:`${c.key}-enable`},wp.element.createElement("div",{onClick:f=>f.stopPropagation()},wp.element.createElement(tu,{value:c._bulkCheckbox,onChange:f=>n({type:"update",item:d,control:"_bulkCheckbox",value:f})}))),r.map((f,h)=>wp.element.createElement("td",{key:`${c.key}-${h}`},i(f,c,d))),wp.element.createElement("td",{className:"tf-repeater-row-actions"},wp.element.createElement("div",null,o("clone",d),o("delete",d)))))))),s()),"Table");var $ne=Object.defineProperty,wne=u((t,e)=>$ne(t,"name",{value:e,configurable:!0}),"m");const xne=wne(({items:t,rowFields:e,renderItem:n,renderAction:r,maxLength:i,dispatch:l,name:a,title:o=!1,beforeRow:s=!1,afterRow:c=!1,parent:d,string:f})=>{const{Header:h,Container:p,Content:m,Row:g,RowField:O,RowLabel:b,RowTitle:y,Title:$}=GP,[v,S]=wp.element.useState(0),x=wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"tf-repeater-tab-add-item tf-tab-item"},i!==void 0&&wp.element.createElement(se,{type:"text-primary",onPress:()=>l({type:"add"}),isDisabled:i<=t.length},f("add"))),wp.element.createElement("div",{className:"tf-repeater-tab-icon-actions"},r("clone",v,{type:"icon-clone",className:"tf-tab-item",contentVisuallyHidden:!0}),r("delete",v,{label:"Remove",title:"Confirmation",onValidate:()=>{l({type:"remove",item:v}),S(v==0?0:v-1)},buttonProps:{type:"icon-trash",contentVisuallyHidden:!0,className:"tf-tab-item"}})));return wp.element.createElement(p,{className:"tf-repeater-tab-container"},wp.element.createElement(h,{className:"tf-repeater-items tf-repeater-tab-items",actionsClassName:"tf-repeater-tab-actions",actions:x},t&&t.slice(0,i).map((C,Q)=>wp.element.createElement($,{key:C.key??Q,isOpen:v==Q,className:"tf-repeater-tab-item",onPress:()=>S(Q)},H9(C,Q,o,a,n,d)))),t&&t.map((C,Q)=>wp.element.createElement(m,{key:C.key??Q,isActive:v===Q,className:"tf-repeater-tab-content"},e.map((T,B)=>wp.element.createElement(g,{key:T.name??B,className:"tf-repeater-tab-row"},s&&s(C,Q,l),T.type==="title"?wp.element.createElement(y,{className:"tf-repeater-tab-row-title tf-repeater-tab-row-title-section"},n(T,C,Q)):wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(b,{className:"tf-repeater-tab-row-title"},T.label??""),wp.element.createElement(O,{className:"tf-repeater-tab-item-field"},n(T,C,Q))),c&&c(C,Q,l))))))},"Tab");var Hr={_types:{control:{accordion:_L,"alignment-matrix":iz,border:WX,"button-group":HX,checkbox:tu,code:AU,"color-picker":jQ,"conditional-panel":UL,"combo-box":xh,"date-picker":VG,dimensions:LT,"field-group":Y1,file:pte,gradient:gte,gallery:vte,list:Cte,hidden:xte,number:Bf,repeater:dE,radio:Pte,select:Y9,"simple-dimension":Rte,switch:K1,tab:Xte,text:U9,"text-suggestion":FG,wysiwyg:Z9,editor:Z9,textarea:Kte,"time-picker":Jte},element:{button:se,description:we,label:xe,"list-box":Vd,modal:$s,wrapper:SL,tooltip:$L,title:zd},repeater:{advanced:une,bare:fne,block:gne,table:vne,tab:xne}},get(t,e="control"){return this._types[e]?.[t]??(e==="repeater"?"table":!1)},add(t,e,n="control"){this._types[n][t]=e}},Sne=Object.defineProperty,J9=u((t,e)=>Sne(t,"name",{value:e,configurable:!0}),"i$2");const hp=J9(({visibility:t,data:e,afterInitialization:n=!1,...r})=>{const i=wp.element.useContext(Zl),l={...r.wrapper??{},className:`${r?.wrapper?.class??""} ${i.wrapper}`};delete l.class;const[a,o]=wp.element.useState(r.value??"");wp.element.useEffect(()=>{r.onChange&&r.onChange(a)},[a]);const s=Hr.get(r.type??"text");if(wp.element.useEffect(()=>{n&&n()},[]),!s)return wp.element.createElement(wp.element.Fragment,null);const c=J9(d=>{o(d),setTimeout(()=>{Xi("valueChange",{name:r.name??!1,props:r,value:d,previousValue:a})})},"onChange");return wp.element.createElement(pk,{...l},wp.element.createElement(sE,{visibility:t,data:e},wp.element.createElement(uE,{itemType:r.itemType??"field",name:r.name??!1,setValue:o},d=>wp.element.createElement(rE,{refresh:d,data:e,itemProps:r},f=>wp.element.createElement(s,{...f,value:a,onChange:c,data:e,dynamic:r.dynamic?iI(a,o,r):!1})))))},"Control");var Cne=Object.defineProperty,kne=u((t,e)=>Cne(t,"name",{value:e,configurable:!0}),"o");const Dne=kne((t,e)=>({getRow(n){const r=e.getValue(t);return Array.isArray(r)&&r[n]?r[n]:!1},setRow(n,r){const i=e.getValue(t);if(!Array.isArray(i)||!i[n])return!1;i[n]=r,e.setValue(t,i)},getRowValue(n,r){const i=this.getRow(n);return i?i[r]:!1},setRowValue(n,r,i){const l=this.getRow(n);if(!l)return!1;l[r]=i,this.setRow(n,l)}}),"getRepeaterStore");var In={_values:{},_setValueFromControl(t,e){this._values[t]=e},getAllValues(){return this._values},getValue(t){return this._values[t]??""},setValue(t,e){Xi("_refreshFieldValue",{name:t,value:e})},getRepeater(t){return Dne(t,this)}},G1={rerender:t=>Xi("_fieldRerender",t),dependent:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}},repeater:{__callbacks:{},registerCallback(t,e){this.__callbacks[t]=e}}},Pne=Object.defineProperty,bo=u((t,e)=>Pne(t,"name",{value:e,configurable:!0}),"i");const Zl=wp.element.createContext(null),Ene=bo((t,e="field")=>e==="element"?tB(t):eB(t),"renderComponent"),eB=bo(t=>wp.element.createElement(Zl.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:In.getValue.bind(In),portalContainer:t.portalContainer??document.body}},wp.element.createElement(hp,{...t,onChange:e=>{In._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:In.getValue.bind(In)}})),"renderField"),tB=bo(t=>wp.element.createElement(Zl.Provider,{value:{name:t.context??"default",wrapper:`tf-context-${t.context??"default"}`,getValue:In.getValue.bind(In),portalContainer:t.portalContainer??document.body}},wp.element.createElement($0,{...t,onChange:e=>{In._setValueFromControl(t.name,e),t.onChange&&t.onChange(e)},visibility:{condition:t.condition?.condition??!1,action:t.condition?.action??"show"},data:{getValue:In.getValue.bind(In)}})),"renderElement"),nB=bo(()=>{const{fields:t,elements:e}=Zn(),n=[];for(const r in t)n.push(rB(r,t[r],"fields"));for(const r in e)e[r].forEach(i=>{n.push(rB(r,i,"elements"))});Promise.all(n).then(()=>Xi("ready",{}))},"init"),rB=bo((t,e,n)=>new Promise(r=>{const i=document.getElementById(e.element);if(!i)return r();const l=bo(()=>{r(),Xi(n==="fields"?"initField":"initElement",{name:t,props:e})},"afterInitialization"),a=n==="fields"?eB({name:t,afterInitialization:l,...e}):tB({name:t,afterInitialization:l,...e});wp.element.createRoot?wp.element.createRoot(i).render(a):wp.element.render(a,i)}),"initItem");var Tne=Object.freeze({__proto__:null,ControlContext:Zl,config:om,event:sa,fields:G1,getConfig:Zn,init:nB,render:Ene,setConfig:sm,store:In,trigger:Xi,types:Hr,utils:sI});window.tangibleFields=Tne,window.addEventListener("load",()=>{window.TangibleFieldsConfig&&sm(window.TangibleFieldsConfig),nB()})})(); diff --git a/assets/src/components/field/number/Number.tsx b/assets/src/components/field/number/Number.tsx index a04572ae..b6d7bef8 100644 --- a/assets/src/components/field/number/Number.tsx +++ b/assets/src/components/field/number/Number.tsx @@ -1,5 +1,6 @@ -import { +import { useRef, + useMemo, useState, useEffect } from 'react' @@ -22,7 +23,10 @@ const NumberComponent = props => { const { locale } = useLocale() const [value, setValue] = useState(props.value ?? '') - const state = useNumberFieldState({ ...props, locale }) + + const defaultFormatOptions = useMemo(() => ({ maximumFractionDigits: 10, useGrouping: false }), []) + const formatOptions = props.formatOptions ?? defaultFormatOptions + const state = useNumberFieldState({ ...props, formatOptions, locale }) const inputRef = useRef() const { @@ -32,7 +36,7 @@ const NumberComponent = props => { inputProps, incrementButtonProps, decrementButtonProps - } = useNumberField(props, state, inputRef) + } = useNumberField({ ...props, formatOptions }, state, inputRef) useEffect(() => props.onChange && props.onChange(value), [value]) @@ -53,10 +57,10 @@ const NumberComponent = props => { ref={ inputRef } inputProps={ inputProps } > - From 9f5e98ddb810ad402c3969a068bb32bef00b834c Mon Sep 17 00:00:00 2001 From: Nicolas Jaussaud Date: Mon, 16 Mar 2026 19:55:01 +0100 Subject: [PATCH 2/2] Tests: Jest - Add decimal support tests for Number field Validate the decimal input fix with tests covering initial decimal values (float and string), user-typed decimals, step increment behavior via button clicks, and formatOptions truncation. Co-Authored-By: Claude Opus 4.6 --- .../cases/components/controls/Number.test.tsx | 136 +++++++++++++++++- 1 file changed, 129 insertions(+), 7 deletions(-) diff --git a/tests/jest/cases/components/controls/Number.test.tsx b/tests/jest/cases/components/controls/Number.test.tsx index 28068470..8560db80 100644 --- a/tests/jest/cases/components/controls/Number.test.tsx +++ b/tests/jest/cases/components/controls/Number.test.tsx @@ -1,9 +1,10 @@ import * as fields from '../../../../../assets/src/index.tsx' -import { - render, - within +import { + render, + within } from '@testing-library/react' -import { +import userEvent from '@testing-library/user-event' +import { rendersWithMinimal, rendersWithoutLabelThrowWarning, rendersLabelAndDescription, @@ -37,10 +38,10 @@ describe('Number component', () => { { props: { readOnly : false }, result: false } ])('supports readOnly (%p)', async args => { - const { container } = render( + const { container } = render( fields.render({ - name : 'field-name', - type : 'number', + name : 'field-name', + type : 'number', label : 'Label', ...args.props }) @@ -53,4 +54,125 @@ describe('Number component', () => { expect( within(container).getByText('-').hasAttribute('disabled') ).toBe(args.result) }) + test.each([ + { value: 3.14, expected: '3.14' }, + { value: '3.14', expected: '3.14' }, + ])('accepts a decimal value as initial prop ($value)', ({ value, expected }) => { + + const { container } = render( + fields.render({ + name : 'field-name', + type : 'number', + label : 'Label', + value : value + }) + ) + + const input = container.querySelector('.tf-number input') + expect( input.value ).toBe(expected) + }) + + test.each([ + { value: 0.5, expected: '0.5' }, + { value: '0.5', expected: '0.5' }, + ])('does not collapse decimal values to 0 ($value)', ({ value, expected }) => { + + const { container } = render( + fields.render({ + name : 'field-name', + type : 'number', + label : 'Label', + value : value + }) + ) + + const input = container.querySelector('.tf-number input') + expect( input.value ).toBe(expected) + }) + + it('accepts a decimal input typed by the user', async () => { + + const user = userEvent.setup() + + const { container } = render( + fields.render({ + name : 'field-name', + type : 'number', + label : 'Label', + }) + ) + + const input = container.querySelector('.tf-number input') + + await user.clear(input) + await user.type(input, '2.75') + + expect( input.value ).toBe('2.75') + }) + + it('increments by step value when clicking +', async () => { + + const user = userEvent.setup() + + const { container } = render( + fields.render({ + name : 'field-name', + type : 'number', + label : 'Label', + value : 1, + step : 0.5 + }) + ) + + const input = container.querySelector('.tf-number input') + const incrementButton = within(container).getByText('+') + + expect( input.value ).toBe('1') + + await user.click(incrementButton) + expect( input.value ).toBe('1.5') + + await user.click(incrementButton) + expect( input.value ).toBe('2') + }) + + it('increments by 1 when step is not specified', async () => { + + const user = userEvent.setup() + + const { container } = render( + fields.render({ + name : 'field-name', + type : 'number', + label : 'Label', + value : 3, + }) + ) + + const input = container.querySelector('.tf-number input') + const incrementButton = within(container).getByText('+') + + await user.click(incrementButton) + expect( input.value ).toBe('4') + }) + + test.each([ + { value: 3.14159, expected: '3.14' }, + { value: '3.14159', expected: '3.14' }, + ])('truncates decimals when formatOptions limits fraction digits ($value)', ({ value, expected }) => { + + const { container } = render( + fields.render({ + name : 'field-name', + type : 'number', + label : 'Label', + value : value, + formatOptions : { maximumFractionDigits: 2, useGrouping: false } + }) + ) + + const input = container.querySelector('.tf-number input') + expect( input.value ).toBe(expected) + }) + })