@ws-ui/shared 1.13.9 → 1.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +6 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +879 -859
- package/dist/index.es.js.map +1 -1
- package/dist/types/webform-editor.d.ts +2 -1
- package/dist/utils/datasources.d.ts +11 -0
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
`)},jg=function(){var e=parseInt(document.body.getAttribute(Ti)||"0",10);return isFinite(e)?e:0},QP=function(){$.useEffect(function(){return document.body.setAttribute(Ti,(jg()+1).toString()),function(){var e=jg()-1;e<=0?document.body.removeAttribute(Ti):document.body.setAttribute(Ti,e.toString())}},[])},eC=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;QP();var a=$.useMemo(function(){return YP(s)},[s]);return $.createElement(XP,{styles:JP(a,!t,s,r?"":"!important")})},Rc=!1;if(typeof window<"u")try{var Qs=Object.defineProperty({},"passive",{get:function(){return Rc=!0,!0}});window.addEventListener("test",Qs,Qs),window.removeEventListener("test",Qs,Qs)}catch{Rc=!1}var wi=Rc?{passive:!1}:!1,tC=function(e){return e.tagName==="TEXTAREA"},ay=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!tC(e)&&r[t]==="visible")},rC=function(e){return ay(e,"overflowY")},nC=function(e){return ay(e,"overflowX")},zg=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=uy(e,i);if(s){var a=ly(e,i),u=a[1],l=a[2];if(u>l)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},iC=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},oC=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},uy=function(e,t){return e==="v"?rC(t):nC(t)},ly=function(e,t){return e==="v"?iC(t):oC(t)},sC=function(e,t){return e==="h"&&t==="rtl"?-1:1},aC=function(e,t,r,i,s){var a=sC(e,window.getComputedStyle(t).direction),u=a*i,l=r.target,f=t.contains(l),p=!1,m=u>0,d=0,g=0;do{if(!l)break;var y=ly(e,l),x=y[0],h=y[1],w=y[2],v=h-w-a*x;(x||v)&&uy(e,l)&&(d+=v,g+=x);var S=l.parentNode;l=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!f&&l!==document.body||f&&(t.contains(l)||t===l));return(m&&Math.abs(d)<1||!m&&Math.abs(g)<1)&&(p=!0),p},ea=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bg=function(e){return[e.deltaX,e.deltaY]},Wg=function(e){return e&&"current"in e?e.current:e},uC=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lC=function(e){return`
|
|
60
60
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
61
61
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
62
|
-
`)},cC=0,xi=[];function fC(e){var t=$.useRef([]),r=$.useRef([0,0]),i=$.useRef(),s=$.useState(cC++)[0],a=$.useState(sy)[0],u=$.useRef(e);$.useEffect(function(){u.current=e},[e]),$.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var h=Ra([e.lockRef.current],(e.shards||[]).map(Wg),!0).filter(Boolean);return h.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=$.useCallback(function(h,w){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!u.current.allowPinchZoom;var v=ea(h),S=r.current,E="deltaX"in h?h.deltaX:S[0]-v[0],R="deltaY"in h?h.deltaY:S[1]-v[1],T,C=h.target,W=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in h&&W==="h"&&C.type==="range")return!1;var N=window.getSelection(),F=N&&N.anchorNode,q=F?F===C||F.contains(C):!1;if(q)return!1;var j=zg(W,C);if(!j)return!0;if(j?T=W:(T=W==="v"?"h":"v",j=zg(W,C)),!j)return!1;if(!i.current&&"changedTouches"in h&&(E||R)&&(i.current=T),!T)return!0;var D=i.current||T;return aC(D,w,h,D==="h"?E:R)},[]),f=$.useCallback(function(h){var w=h;if(!(!xi.length||xi[xi.length-1]!==a)){var v="deltaY"in w?Bg(w):ea(w),S=t.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&uC(T.delta,v)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var E=(u.current.shards||[]).map(Wg).filter(Boolean).filter(function(T){return T.contains(w.target)}),R=E.length>0?l(w,E[0]):!u.current.noIsolation;R&&w.cancelable&&w.preventDefault()}}},[]),p=$.useCallback(function(h,w,v,S){var E={name:h,delta:w,target:v,should:S,shadowParent:dC(v)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(R){return R!==E})},1)},[]),m=$.useCallback(function(h){r.current=ea(h),i.current=void 0},[]),d=$.useCallback(function(h){p(h.type,Bg(h),h.target,l(h,e.lockRef.current))},[]),g=$.useCallback(function(h){p(h.type,ea(h),h.target,l(h,e.lockRef.current))},[]);$.useEffect(function(){return xi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:g}),document.addEventListener("wheel",f,wi),document.addEventListener("touchmove",f,wi),document.addEventListener("touchstart",m,wi),function(){xi=xi.filter(function(h){return h!==a}),document.removeEventListener("wheel",f,wi),document.removeEventListener("touchmove",f,wi),document.removeEventListener("touchstart",m,wi)}},[]);var y=e.removeScrollBar,x=e.inert;return $.createElement($.Fragment,null,x?$.createElement(a,{styles:lC(s)}):null,y?$.createElement(eC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dC(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pC=BP(oy,fC);var cy=$.forwardRef(function(e,t){return $.createElement(Va,$r({},e,{ref:t,sideCar:pC}))});cy.classNames=Va.classNames;const hC=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{},gC=$.useId||(()=>{});let mC=0;function fy(e){const[t,r]=$.useState(gC());return hC((()=>{r((i=>i??String(mC++)))}),[e]),t?`radix-${t}`:""}function dy(...e){return t=>e.forEach((r=>(function(i,s){typeof i=="function"?i(s):i!=null&&(i.current=s)})(r,t)))}function Rn(...e){return $.useCallback(dy(...e),e)}const py=$.forwardRef(((e,t)=>{const{children:r,...i}=e;return $.Children.toArray(r).some(Hg)?$.createElement($.Fragment,null,$.Children.map(r,(s=>Hg(s)?$.createElement(Pc,rt({},i,{ref:t}),s.props.children):s))):$.createElement(Pc,rt({},i,{ref:t}),r)}));py.displayName="Slot";const Pc=$.forwardRef(((e,t)=>{const{children:r,...i}=e;return $.isValidElement(r)?$.cloneElement(r,{...vC(i,r.props),ref:dy(t,r.ref)}):$.Children.count(r)>1?$.Children.only(null):null}));Pc.displayName="SlotClone";const hy=({children:e})=>$.createElement($.Fragment,null,e);function Hg(e){return $.isValidElement(e)&&e.type===hy}function vC(e,t){const r={...t};for(const i in t){const s=e[i],a=t[i];/^on[A-Z]/.test(i)?r[i]=(...u)=>{a==null||a(...u),s==null||s(...u)}:i==="style"?r[i]={...s,...a}:i==="className"&&(r[i]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}const Pn=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>({...e,[t]:$.forwardRef(((r,i)=>{const{asChild:s,...a}=r,u=s?py:t;return $.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),$.createElement(u,rt({},a,{ref:i}))}))})),{}),Ug=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{},df=e=>{const{present:t,children:r}=e,i=(function(u){const[l,f]=$.useState(),p=$.useRef({}),m=$.useRef(u),d=$.useRef("none"),g=u?"mounted":"unmounted",[y,x]=(function(h,w){return $.useReducer(((v,S)=>{const E=w[v][S];return E??v}),h)})(g,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect((()=>{const h=ta(p.current);d.current=y==="mounted"?h:"none"}),[y]),Ug((()=>{const h=p.current,w=m.current;if(w!==u){const v=d.current,S=ta(h);u?x("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?x("UNMOUNT"):x(w&&v!==S?"ANIMATION_OUT":"UNMOUNT"),m.current=u}}),[u,x]),Ug((()=>{if(l){const h=v=>{const S=ta(p.current).includes(v.animationName);v.target===l&&S&&x("ANIMATION_END")},w=v=>{v.target===l&&(d.current=ta(p.current))};return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",h),l.addEventListener("animationend",h),()=>{l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",h),l.removeEventListener("animationend",h)}}x("ANIMATION_END")}),[l,x]),{isPresent:["mounted","unmountSuspended"].includes(y),ref:$.useCallback((h=>{h&&(p.current=getComputedStyle(h)),f(h)}),[])}})(t),s=typeof r=="function"?r({present:i.isPresent}):$.Children.only(r),a=Rn(i.ref,s.ref);return typeof r=="function"||i.isPresent?$.cloneElement(s,{ref:a}):null};function ta(e){return(e==null?void 0:e.animationName)||"none"}df.displayName="Presence";let Kl=0;function yC(){$.useEffect((()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:qg()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:qg()),Kl++,()=>{Kl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach((i=>i.remove())),Kl--}}),[])}function qg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const bC=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{},pf=$.forwardRef(((e,t)=>{var r,i;const{containerRef:s,style:a,...u}=e,l=(r=s==null?void 0:s.current)!==null&&r!==void 0?r:globalThis==null||(i=globalThis.document)===null||i===void 0?void 0:i.body,[,f]=$.useState({});return bC((()=>{f({})}),[]),l?Qn.createPortal($.createElement(Pn.div,rt({"data-radix-portal":""},u,{ref:t,style:l===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...a}:void 0})),l):null}));function Yn(e){const t=$.useRef(e);return $.useEffect((()=>{t.current=e})),$.useMemo((()=>(...r)=>{var i;return(i=t.current)===null||i===void 0?void 0:i.call(t,...r)}),[])}const Gg={bubbles:!1,cancelable:!0},wC=$.forwardRef(((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...u}=e,[l,f]=$.useState(null),p=Yn(s),m=Yn(a),d=$.useRef(null),g=Rn(t,(h=>f(h))),y=$.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;$.useEffect((()=>{if(i){let h=function(v){if(y.paused||!l)return;const S=v.target;l.contains(S)?d.current=S:Bn(d.current,{select:!0})},w=function(v){!y.paused&&l&&(l.contains(v.relatedTarget)||Bn(d.current,{select:!0}))};return document.addEventListener("focusin",h),document.addEventListener("focusout",w),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",w)}}}),[i,l,y.paused]),$.useEffect((()=>{if(l){Kg.add(y);const w=document.activeElement;if(!l.contains(w)){const v=new Event("focusScope.autoFocusOnMount",Gg);l.addEventListener("focusScope.autoFocusOnMount",p),l.dispatchEvent(v),v.defaultPrevented||((function(S,{select:E=!1}={}){const R=document.activeElement;for(const T of S)if(Bn(T,{select:E}),document.activeElement!==R)return})((h=Zg(l),h.filter((S=>S.tagName!=="A"))),{select:!0}),document.activeElement===w&&Bn(l))}return()=>{l.removeEventListener("focusScope.autoFocusOnMount",p),setTimeout((()=>{const v=new Event("focusScope.autoFocusOnUnmount",Gg);l.addEventListener("focusScope.autoFocusOnUnmount",m),l.dispatchEvent(v),v.defaultPrevented||Bn(w??document.body,{select:!0}),l.removeEventListener("focusScope.autoFocusOnUnmount",m),Kg.remove(y)}),0)}}var h}),[l,p,m,y]);const x=$.useCallback((h=>{if(!r&&!i||y.paused)return;const w=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,v=document.activeElement;if(w&&v){const S=h.currentTarget,[E,R]=(function(T){const C=Zg(T),W=Vg(C,T),N=Vg(C.reverse(),T);return[W,N]})(S);E&&R?h.shiftKey||v!==R?h.shiftKey&&v===E&&(h.preventDefault(),r&&Bn(R,{select:!0})):(h.preventDefault(),r&&Bn(E,{select:!0})):v===S&&h.preventDefault()}}),[r,i,y.paused]);return $.createElement(Pn.div,rt({tabIndex:-1},u,{ref:g,onKeyDown:x}))}));function Zg(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Vg(e,t){for(const r of e)if(!xC(r,{upTo:t}))return r}function xC(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(function(i){return i instanceof HTMLInputElement&&"select"in i})(e)&&t&&e.select()}}const Kg=(function(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Yg(e,t),e.unshift(t)},remove(t){var r;e=Yg(e,t),(r=e[0])===null||r===void 0||r.resume()}}})();function Yg(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function gy(e){const t=Yn(e);$.useEffect((()=>{const r=i=>{i.key==="Escape"&&t(i)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)}),[t])}const SC=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{};let Xg,ra=0;function EC({disabled:e}){const t=$.useRef(!1);SC((()=>{if(e){let r=function(){ra--,ra===0&&(document.body.style.pointerEvents=Xg)},i=function(s){t.current=s.pointerType!=="mouse"};return ra===0&&(Xg=document.body.style.pointerEvents),document.body.style.pointerEvents="none",ra++,document.addEventListener("pointerup",i),()=>{t.current?document.addEventListener("click",r,{once:!0}):r(),document.removeEventListener("pointerup",i)}}}),[e])}function Zt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const _C=$.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),TC=$.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:u,onDismiss:l,...f}=e,p=$.useContext(_C),[m,d]=$.useState(null),[,g]=$.useState({}),y=Rn(t,(C=>d(C))),x=Array.from(p.layers),[h]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(h),v=m?x.indexOf(m):-1,S=p.layersWithOutsidePointerEventsDisabled.size>0,E=v>=w,R=(function(C){const W=Yn(C),N=$.useRef(!1);return $.useEffect((()=>{const F=j=>{j.target&&!N.current&&Qg("dismissableLayer.pointerDownOutside",W,{originalEvent:j}),N.current=!1},q=window.setTimeout((()=>{document.addEventListener("pointerdown",F)}),0);return()=>{window.clearTimeout(q),document.removeEventListener("pointerdown",F)}}),[W]),{onPointerDownCapture:()=>N.current=!0}})((C=>{const W=C.target,N=[...p.branches].some((F=>F.contains(W)));E&&!N&&(s==null||s(C),u==null||u(C),C.defaultPrevented||l==null||l())})),T=(function(C){const W=Yn(C),N=$.useRef(!1);return $.useEffect((()=>{const F=q=>{q.target&&!N.current&&Qg("dismissableLayer.focusOutside",W,{originalEvent:q})};return document.addEventListener("focusin",F),()=>document.removeEventListener("focusin",F)}),[W]),{onFocusCapture:()=>N.current=!0,onBlurCapture:()=>N.current=!1}})((C=>{const W=C.target;[...p.branches].some((N=>N.contains(W)))||(a==null||a(C),u==null||u(C),C.defaultPrevented||l==null||l())}));return gy((C=>{v===p.layers.size-1&&(i==null||i(C),C.defaultPrevented||l==null||l())})),EC({disabled:r}),$.useEffect((()=>{m&&(r&&p.layersWithOutsidePointerEventsDisabled.add(m),p.layers.add(m),Jg())}),[m,r,p]),$.useEffect((()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),Jg())}),[m,p]),$.useEffect((()=>{const C=()=>g({});return document.addEventListener("dismissableLayer.update",C),()=>document.removeEventListener("dismissableLayer.update",C)}),[]),$.createElement(Pn.div,rt({},f,{ref:y,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,R.onPointerDownCapture)}))}));function Jg(){const e=new Event("dismissableLayer.update");document.dispatchEvent(e)}function Qg(e,t,r){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});return t&&i.addEventListener(e,t,{once:!0}),!i.dispatchEvent(s)}function em(e){const[t,r]=$.useState(void 0);return $.useEffect((()=>{if(e){const i=new ResizeObserver((s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let u,l;if("borderBoxSize"in a){const f=a.borderBoxSize,p=Array.isArray(f)?f[0]:f;u=p.inlineSize,l=p.blockSize}else{const f=e.getBoundingClientRect();u=f.width,l=f.height}r({width:u,height:l})}));return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}r(void 0)}),[e]),t}function OC(e,t){const r=Wn.get(e);return r===void 0?(Wn.set(e,{rect:{},callbacks:[t]}),Wn.size===1&&(Cc=requestAnimationFrame(my))):(r.callbacks.push(t),t(e.getBoundingClientRect())),()=>{const i=Wn.get(e);if(i===void 0)return;const s=i.callbacks.indexOf(t);s>-1&&i.callbacks.splice(s,1),i.callbacks.length===0&&(Wn.delete(e),Wn.size===0&&cancelAnimationFrame(Cc))}}let Cc;const Wn=new Map;function my(){const e=[];Wn.forEach(((t,r)=>{const i=r.getBoundingClientRect();var s,a;s=t.rect,a=i,(s.width!==a.width||s.height!==a.height||s.top!==a.top||s.right!==a.right||s.bottom!==a.bottom||s.left!==a.left)&&(t.rect=i,e.push(t))})),e.forEach((t=>{t.callbacks.forEach((r=>r(t.rect)))})),Cc=requestAnimationFrame(my)}function vy(e){const[t,r]=$.useState();return $.useEffect((()=>{if(e){const i=OC(e,r);return()=>{r(void 0),i()}}}),[e]),t}function hf(e,t=[]){let r=[];const i=()=>{const s=r.map((a=>$.createContext(a)));return function(a){const u=(a==null?void 0:a[e])||s;return $.useMemo((()=>({[`__scope${e}`]:{...a,[e]:u}})),[a,u])}};return i.scopeName=e,[function(s,a){const u=$.createContext(a),l=r.length;function f(p){const{scope:m,children:d,...g}=p,y=(m==null?void 0:m[e][l])||u,x=$.useMemo((()=>g),Object.values(g));return $.createElement(y.Provider,{value:x},d)}return r=[...r,a],f.displayName=s+"Provider",[f,function(p,m){const d=(m==null?void 0:m[e][l])||u,g=$.useContext(d);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${s}\``)}]},AC(i,...t)]}function AC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map((s=>({useScope:s(),scopeName:s.scopeName})));return function(s){const a=i.reduce(((u,{useScope:l,scopeName:f})=>({...u,...l(s)[`__scope${f}`]})),{});return $.useMemo((()=>({[`__scope${t.scopeName}`]:a})),[a])}};return r.scopeName=t.scopeName,r}function RC({anchorRect:e,popperSize:t,arrowSize:r,arrowOffset:i=0,side:s,sideOffset:a=0,align:u,alignOffset:l=0,shouldAvoidCollisions:f=!0,collisionBoundariesRect:p,collisionTolerance:m=0}){if(!e||!t||!p)return{popperStyles:PC,arrowStyles:Yl};const d=(function(W,N,F=0,q=0,j){const D=j?j.height:0,H=tm(N,W,"x"),G=tm(N,W,"y"),k=G.before-F-D,Q=G.after+F+D,J=H.before-F-D,re=H.after+F+D;return{top:{start:{x:H.start+q,y:k},center:{x:H.center,y:k},end:{x:H.end-q,y:k}},right:{start:{x:re,y:G.start+q},center:{x:re,y:G.center},end:{x:re,y:G.end-q}},bottom:{start:{x:H.start+q,y:Q},center:{x:H.center,y:Q},end:{x:H.end-q,y:Q}},left:{start:{x:J,y:G.start+q},center:{x:J,y:G.center},end:{x:J,y:G.end-q}}}})(t,e,a,l,r),g=d[s][u];if(f===!1){const W=rm(g);let N=Yl;return r&&(N=im({popperSize:t,arrowSize:r,arrowOffset:i,side:s,align:u})),{popperStyles:{...W,"--radix-popper-transform-origin":nm(t,s,u,i,r)},arrowStyles:N,placedSide:s,placedAlign:u}}const y=DOMRect.fromRect({...t,...g}),x=(h=p,w=m,DOMRect.fromRect({width:h.width-2*w,height:h.height-2*w,x:h.left+w,y:h.top+w}));var h,w;const v=sm(y,x),S=d[om(s)][u],E=(function(W,N,F){const q=om(W);return N[W]&&!F[q]?q:W})(s,v,sm(DOMRect.fromRect({...t,...S}),x)),R=(function(W,N,F,q,j){const D=F==="top"||F==="bottom",H=D?"left":"top",G=D?"right":"bottom",k=D?"width":"height",Q=N[k]>W[k];return(q==="start"||q==="center")&&(j[H]&&Q||j[G]&&!Q)?"end":(q==="end"||q==="center")&&(j[G]&&Q||j[H]&&!Q)?"start":q})(t,e,s,u,v),T=rm(d[E][R]);let C=Yl;return r&&(C=im({popperSize:t,arrowSize:r,arrowOffset:i,side:E,align:R})),{popperStyles:{...T,"--radix-popper-transform-origin":nm(t,E,R,i,r)},arrowStyles:C,placedSide:E,placedAlign:R}}function tm(e,t,r){const i=e[r==="x"?"left":"top"],s=r==="x"?"width":"height",a=e[s],u=t[s];return{before:i-u,start:i,center:i+(a-u)/2,end:i+a-u,after:i+a}}function rm(e){return{position:"absolute",top:0,left:0,minWidth:"max-content",willChange:"transform",transform:`translate3d(${Math.round(e.x+window.scrollX)}px, ${Math.round(e.y+window.scrollY)}px, 0)`}}function nm(e,t,r,i,s){const a=t==="top"||t==="bottom",u=s?s.width:0,l=s?s.height:0,f=u/2+i;let p="",m="";return a?(p={start:`${f}px`,center:"center",end:e.width-f+"px"}[r],m=t==="top"?`${e.height+l}px`:-l+"px"):(p=t==="left"?`${e.width+l}px`:-l+"px",m={start:`${f}px`,center:"center",end:e.height-f+"px"}[r]),`${p} ${m}`}const PC={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},Yl={position:"absolute",opacity:0};function im({popperSize:e,arrowSize:t,arrowOffset:r,side:i,align:s}){const a=(e.width-t.width)/2,u=(e.height-t.width)/2,l={top:0,right:90,bottom:180,left:-90}[i],f=Math.max(t.width,t.height),p={width:`${f}px`,height:`${f}px`,transform:`rotate(${l}deg)`,willChange:"transform",position:"absolute",[i]:"100%",direction:CC(i,s)};return i!=="top"&&i!=="bottom"||(s==="start"&&(p.left=`${r}px`),s==="center"&&(p.left=`${a}px`),s==="end"&&(p.right=`${r}px`)),i!=="left"&&i!=="right"||(s==="start"&&(p.top=`${r}px`),s==="center"&&(p.top=`${u}px`),s==="end"&&(p.bottom=`${r}px`)),p}function CC(e,t){return(e!=="top"&&e!=="right"||t!=="end")&&(e!=="bottom"&&e!=="left"||t==="end")?"ltr":"rtl"}function om(e){return{top:"bottom",right:"left",bottom:"top",left:"right"}[e]}function sm(e,t){return{top:e.top<t.top,right:e.right>t.right,bottom:e.bottom>t.bottom,left:e.left<t.left}}const[yy,Ka]=hf("Popper"),[kC,by]=yy("Popper"),IC=e=>{const{__scopePopper:t,children:r}=e,[i,s]=$.useState(null);return $.createElement(kC,{scope:t,anchor:i,onAnchorChange:s},r)},$C=$.forwardRef(((e,t)=>{const{__scopePopper:r,virtualRef:i,...s}=e,a=by("PopperAnchor",r),u=$.useRef(null),l=Rn(t,u);return $.useEffect((()=>{a.onAnchorChange((i==null?void 0:i.current)||u.current)})),i?null:$.createElement(Pn.div,rt({},s,{ref:l}))})),[LC,T2]=yy("PopperContent"),MC=$.forwardRef(((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s,align:a="center",alignOffset:u,collisionTolerance:l,avoidCollisions:f=!0,...p}=e,m=by("PopperContent",r),[d,g]=$.useState(),y=vy(m.anchor),[x,h]=$.useState(null),w=em(x),[v,S]=$.useState(null),E=em(v),R=Rn(t,(D=>h(D))),T=(function(){const[D,H]=$.useState(void 0);return $.useEffect((()=>{let G;function k(){H({width:window.innerWidth,height:window.innerHeight})}function Q(){window.clearTimeout(G),G=window.setTimeout(k,100)}return k(),window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)}),[]),D})(),C=T?DOMRect.fromRect({...T,x:0,y:0}):void 0,{popperStyles:W,arrowStyles:N,placedSide:F,placedAlign:q}=RC({anchorRect:y,popperSize:w,arrowSize:E,arrowOffset:d,side:i,sideOffset:s,align:a,alignOffset:u,shouldAvoidCollisions:f,collisionBoundariesRect:C,collisionTolerance:l}),j=F!==void 0;return $.createElement("div",{style:W,"data-radix-popper-content-wrapper":""},$.createElement(LC,{scope:r,arrowStyles:N,onArrowChange:S,onArrowOffsetChange:g},$.createElement(Pn.div,rt({"data-side":F,"data-align":q},p,{style:{...p.style,animation:j?void 0:"none"},ref:R}))))})),wy=IC,xy=$C,Sy=MC;function Ey({prop:e,defaultProp:t,onChange:r=(()=>{})}){const[i,s]=(function({defaultProp:f,onChange:p}){const m=$.useState(f),[d]=m,g=$.useRef(d),y=Yn(p);return $.useEffect((()=>{g.current!==d&&(y(d),g.current=d)}),[d,g,y]),m})({defaultProp:t,onChange:r}),a=e!==void 0,u=a?e:i,l=Yn(r);return[u,$.useCallback((f=>{if(a){const p=f,m=typeof f=="function"?p(e):f;m!==e&&l(m)}else s(f)}),[a,e,s,l])]}const[DC]=hf("Popover",[Ka]),gf=Ka(),[NC,Ko]=DC("Popover"),FC=e=>{const{__scopePopover:t,children:r,open:i,defaultOpen:s,onOpenChange:a,modal:u=!1}=e,l=gf(t),f=$.useRef(null),[p,m]=$.useState(!1),[d=!1,g]=Ey({prop:i,defaultProp:s,onChange:a});return $.createElement(wy,l,$.createElement(NC,{scope:t,contentId:fy(),triggerRef:f,open:d,onOpenChange:g,onOpenToggle:$.useCallback((()=>g((y=>!y))),[g]),hasCustomAnchor:p,onCustomAnchorAdd:$.useCallback((()=>m(!0)),[]),onCustomAnchorRemove:$.useCallback((()=>m(!1)),[]),modal:u},r))},jC=$.forwardRef(((e,t)=>{const{__scopePopover:r,...i}=e,s=Ko("PopoverTrigger",r),a=gf(r),u=Rn(t,s.triggerRef),l=$.createElement(Pn.button,rt({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ty(s.open)},i,{ref:u,onClick:Zt(e.onClick,s.onOpenToggle)}));return s.hasCustomAnchor?l:$.createElement(xy,rt({asChild:!0},a),l)})),zC=$.forwardRef(((e,t)=>{const{forceMount:r,...i}=e,s=Ko("PopoverContent",e.__scopePopover);return $.createElement(df,{present:r||s.open},s.modal?$.createElement(BC,rt({},i,{ref:t})):$.createElement(WC,rt({},i,{ref:t})))})),BC=$.forwardRef(((e,t)=>{const{allowPinchZoom:r,portalled:i=!0,...s}=e,a=Ko("PopoverContent",e.__scopePopover),u=$.useRef(null),l=Rn(t,u),f=$.useRef(!1);$.useEffect((()=>{const m=u.current;if(m)return IP(m)}),[]);const p=i?pf:$.Fragment;return $.createElement(p,null,$.createElement(cy,{allowPinchZoom:r},$.createElement(_y,rt({},s,{ref:l,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zt(e.onCloseAutoFocus,(m=>{var d;m.preventDefault(),f.current||(d=a.triggerRef.current)===null||d===void 0||d.focus()})),onPointerDownOutside:Zt(e.onPointerDownOutside,(m=>{const d=m.detail.originalEvent,g=d.button===0&&d.ctrlKey===!0,y=d.button===2||g;f.current=y}),{checkForDefaultPrevented:!1}),onFocusOutside:Zt(e.onFocusOutside,(m=>m.preventDefault()),{checkForDefaultPrevented:!1})}))))})),WC=$.forwardRef(((e,t)=>{const{portalled:r=!0,...i}=e,s=Ko("PopoverContent",e.__scopePopover),a=$.useRef(!1),u=r?pf:$.Fragment;return $.createElement(u,null,$.createElement(_y,rt({},i,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var f,p;(f=e.onCloseAutoFocus)===null||f===void 0||f.call(e,l),l.defaultPrevented||(a.current||(p=s.triggerRef.current)===null||p===void 0||p.focus(),l.preventDefault()),a.current=!1},onInteractOutside:l=>{var f,p;(f=e.onInteractOutside)===null||f===void 0||f.call(e,l),l.defaultPrevented||(a.current=!0);const m=l.target;!((p=s.triggerRef.current)===null||p===void 0)&&p.contains(m)&&l.preventDefault()}})))})),_y=$.forwardRef(((e,t)=>{const{__scopePopover:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,...d}=e,g=Ko("PopoverContent",r),y=gf(r);return yC(),$.createElement(wC,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:a},$.createElement(TC,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:p,onDismiss:()=>g.onOpenChange(!1)},$.createElement(Sy,rt({"data-state":Ty(g.open),role:"dialog",id:g.contentId},y,d,{ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)"}}))))}));function Ty(e){return e?"open":"closed"}const HC=FC,UC=jC,qC=zC;var wa=(e=>(e.VIDEO="video",e.CAROUSEL="carousel",e.TEXT="text",e))(wa||{}),Xl={},ho={},na={},ia={},oa={exports:{}},sa={exports:{}},Fe={};/** @license React v16.13.1
|
|
62
|
+
`)},cC=0,xi=[];function fC(e){var t=$.useRef([]),r=$.useRef([0,0]),i=$.useRef(),s=$.useState(cC++)[0],a=$.useState(sy)[0],u=$.useRef(e);$.useEffect(function(){u.current=e},[e]),$.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var h=Ra([e.lockRef.current],(e.shards||[]).map(Wg),!0).filter(Boolean);return h.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=$.useCallback(function(h,w){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!u.current.allowPinchZoom;var v=ea(h),S=r.current,E="deltaX"in h?h.deltaX:S[0]-v[0],R="deltaY"in h?h.deltaY:S[1]-v[1],T,C=h.target,W=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in h&&W==="h"&&C.type==="range")return!1;var N=window.getSelection(),F=N&&N.anchorNode,q=F?F===C||F.contains(C):!1;if(q)return!1;var j=zg(W,C);if(!j)return!0;if(j?T=W:(T=W==="v"?"h":"v",j=zg(W,C)),!j)return!1;if(!i.current&&"changedTouches"in h&&(E||R)&&(i.current=T),!T)return!0;var D=i.current||T;return aC(D,w,h,D==="h"?E:R)},[]),f=$.useCallback(function(h){var w=h;if(!(!xi.length||xi[xi.length-1]!==a)){var v="deltaY"in w?Bg(w):ea(w),S=t.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&uC(T.delta,v)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var E=(u.current.shards||[]).map(Wg).filter(Boolean).filter(function(T){return T.contains(w.target)}),R=E.length>0?l(w,E[0]):!u.current.noIsolation;R&&w.cancelable&&w.preventDefault()}}},[]),p=$.useCallback(function(h,w,v,S){var E={name:h,delta:w,target:v,should:S,shadowParent:dC(v)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(R){return R!==E})},1)},[]),m=$.useCallback(function(h){r.current=ea(h),i.current=void 0},[]),d=$.useCallback(function(h){p(h.type,Bg(h),h.target,l(h,e.lockRef.current))},[]),g=$.useCallback(function(h){p(h.type,ea(h),h.target,l(h,e.lockRef.current))},[]);$.useEffect(function(){return xi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:g}),document.addEventListener("wheel",f,wi),document.addEventListener("touchmove",f,wi),document.addEventListener("touchstart",m,wi),function(){xi=xi.filter(function(h){return h!==a}),document.removeEventListener("wheel",f,wi),document.removeEventListener("touchmove",f,wi),document.removeEventListener("touchstart",m,wi)}},[]);var y=e.removeScrollBar,x=e.inert;return $.createElement($.Fragment,null,x?$.createElement(a,{styles:lC(s)}):null,y?$.createElement(eC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dC(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pC=BP(oy,fC);var cy=$.forwardRef(function(e,t){return $.createElement(Va,$r({},e,{ref:t,sideCar:pC}))});cy.classNames=Va.classNames;const hC=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{},gC=$.useId||(()=>{});let mC=0;function fy(e){const[t,r]=$.useState(gC());return hC((()=>{r((i=>i??String(mC++)))}),[e]),t?`radix-${t}`:""}function dy(...e){return t=>e.forEach((r=>(function(i,s){typeof i=="function"?i(s):i!=null&&(i.current=s)})(r,t)))}function Rn(...e){return $.useCallback(dy(...e),e)}const py=$.forwardRef(((e,t)=>{const{children:r,...i}=e;return $.Children.toArray(r).some(Hg)?$.createElement($.Fragment,null,$.Children.map(r,(s=>Hg(s)?$.createElement(Pc,rt({},i,{ref:t}),s.props.children):s))):$.createElement(Pc,rt({},i,{ref:t}),r)}));py.displayName="Slot";const Pc=$.forwardRef(((e,t)=>{const{children:r,...i}=e;return $.isValidElement(r)?$.cloneElement(r,{...vC(i,r.props),ref:dy(t,r.ref)}):$.Children.count(r)>1?$.Children.only(null):null}));Pc.displayName="SlotClone";const hy=({children:e})=>$.createElement($.Fragment,null,e);function Hg(e){return $.isValidElement(e)&&e.type===hy}function vC(e,t){const r={...t};for(const i in t){const s=e[i],a=t[i];/^on[A-Z]/.test(i)?r[i]=(...u)=>{a==null||a(...u),s==null||s(...u)}:i==="style"?r[i]={...s,...a}:i==="className"&&(r[i]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}const Pn=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>({...e,[t]:$.forwardRef(((r,i)=>{const{asChild:s,...a}=r,u=s?py:t;return $.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),$.createElement(u,rt({},a,{ref:i}))}))})),{}),Ug=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{},df=e=>{const{present:t,children:r}=e,i=(function(u){const[l,f]=$.useState(),p=$.useRef({}),m=$.useRef(u),d=$.useRef("none"),g=u?"mounted":"unmounted",[y,x]=(function(h,w){return $.useReducer(((v,S)=>{const E=w[v][S];return E??v}),h)})(g,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect((()=>{const h=ta(p.current);d.current=y==="mounted"?h:"none"}),[y]),Ug((()=>{const h=p.current,w=m.current;if(w!==u){const v=d.current,S=ta(h);u?x("MOUNT"):S==="none"||(h==null?void 0:h.display)==="none"?x("UNMOUNT"):x(w&&v!==S?"ANIMATION_OUT":"UNMOUNT"),m.current=u}}),[u,x]),Ug((()=>{if(l){const h=v=>{const S=ta(p.current).includes(v.animationName);v.target===l&&S&&x("ANIMATION_END")},w=v=>{v.target===l&&(d.current=ta(p.current))};return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",h),l.addEventListener("animationend",h),()=>{l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",h),l.removeEventListener("animationend",h)}}x("ANIMATION_END")}),[l,x]),{isPresent:["mounted","unmountSuspended"].includes(y),ref:$.useCallback((h=>{h&&(p.current=getComputedStyle(h)),f(h)}),[])}})(t),s=typeof r=="function"?r({present:i.isPresent}):$.Children.only(r),a=Rn(i.ref,s.ref);return typeof r=="function"||i.isPresent?$.cloneElement(s,{ref:a}):null};function ta(e){return(e==null?void 0:e.animationName)||"none"}df.displayName="Presence";let Kl=0;function yC(){$.useEffect((()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:qg()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:qg()),Kl++,()=>{Kl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach((i=>i.remove())),Kl--}}),[])}function qg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const bC=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{},pf=$.forwardRef(((e,t)=>{var r,i;const{containerRef:s,style:a,...u}=e,l=(r=s==null?void 0:s.current)!==null&&r!==void 0?r:globalThis==null||(i=globalThis.document)===null||i===void 0?void 0:i.body,[,f]=$.useState({});return bC((()=>{f({})}),[]),l?Qn.createPortal($.createElement(Pn.div,rt({"data-radix-portal":""},u,{ref:t,style:l===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...a}:void 0})),l):null}));function Yn(e){const t=$.useRef(e);return $.useEffect((()=>{t.current=e})),$.useMemo((()=>(...r)=>{var i;return(i=t.current)===null||i===void 0?void 0:i.call(t,...r)}),[])}const Gg={bubbles:!1,cancelable:!0},wC=$.forwardRef(((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...u}=e,[l,f]=$.useState(null),p=Yn(s),m=Yn(a),d=$.useRef(null),g=Rn(t,(h=>f(h))),y=$.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;$.useEffect((()=>{if(i){let h=function(v){if(y.paused||!l)return;const S=v.target;l.contains(S)?d.current=S:Bn(d.current,{select:!0})},w=function(v){!y.paused&&l&&(l.contains(v.relatedTarget)||Bn(d.current,{select:!0}))};return document.addEventListener("focusin",h),document.addEventListener("focusout",w),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",w)}}}),[i,l,y.paused]),$.useEffect((()=>{if(l){Kg.add(y);const w=document.activeElement;if(!l.contains(w)){const v=new Event("focusScope.autoFocusOnMount",Gg);l.addEventListener("focusScope.autoFocusOnMount",p),l.dispatchEvent(v),v.defaultPrevented||((function(S,{select:E=!1}={}){const R=document.activeElement;for(const T of S)if(Bn(T,{select:E}),document.activeElement!==R)return})((h=Zg(l),h.filter((S=>S.tagName!=="A"))),{select:!0}),document.activeElement===w&&Bn(l))}return()=>{l.removeEventListener("focusScope.autoFocusOnMount",p),setTimeout((()=>{const v=new Event("focusScope.autoFocusOnUnmount",Gg);l.addEventListener("focusScope.autoFocusOnUnmount",m),l.dispatchEvent(v),v.defaultPrevented||Bn(w??document.body,{select:!0}),l.removeEventListener("focusScope.autoFocusOnUnmount",m),Kg.remove(y)}),0)}}var h}),[l,p,m,y]);const x=$.useCallback((h=>{if(!r&&!i||y.paused)return;const w=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,v=document.activeElement;if(w&&v){const S=h.currentTarget,[E,R]=(function(T){const C=Zg(T),W=Vg(C,T),N=Vg(C.reverse(),T);return[W,N]})(S);E&&R?h.shiftKey||v!==R?h.shiftKey&&v===E&&(h.preventDefault(),r&&Bn(R,{select:!0})):(h.preventDefault(),r&&Bn(E,{select:!0})):v===S&&h.preventDefault()}}),[r,i,y.paused]);return $.createElement(Pn.div,rt({tabIndex:-1},u,{ref:g,onKeyDown:x}))}));function Zg(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Vg(e,t){for(const r of e)if(!xC(r,{upTo:t}))return r}function xC(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(function(i){return i instanceof HTMLInputElement&&"select"in i})(e)&&t&&e.select()}}const Kg=(function(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Yg(e,t),e.unshift(t)},remove(t){var r;e=Yg(e,t),(r=e[0])===null||r===void 0||r.resume()}}})();function Yg(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function gy(e){const t=Yn(e);$.useEffect((()=>{const r=i=>{i.key==="Escape"&&t(i)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)}),[t])}const SC=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{};let Xg,ra=0;function EC({disabled:e}){const t=$.useRef(!1);SC((()=>{if(e){let r=function(){ra--,ra===0&&(document.body.style.pointerEvents=Xg)},i=function(s){t.current=s.pointerType!=="mouse"};return ra===0&&(Xg=document.body.style.pointerEvents),document.body.style.pointerEvents="none",ra++,document.addEventListener("pointerup",i),()=>{t.current?document.addEventListener("click",r,{once:!0}):r(),document.removeEventListener("pointerup",i)}}}),[e])}function Zt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const _C=$.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),TC=$.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:u,onDismiss:l,...f}=e,p=$.useContext(_C),[m,d]=$.useState(null),[,g]=$.useState({}),y=Rn(t,(C=>d(C))),x=Array.from(p.layers),[h]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(h),v=m?x.indexOf(m):-1,S=p.layersWithOutsidePointerEventsDisabled.size>0,E=v>=w,R=(function(C){const W=Yn(C),N=$.useRef(!1);return $.useEffect((()=>{const F=j=>{j.target&&!N.current&&Qg("dismissableLayer.pointerDownOutside",W,{originalEvent:j}),N.current=!1},q=window.setTimeout((()=>{document.addEventListener("pointerdown",F)}),0);return()=>{window.clearTimeout(q),document.removeEventListener("pointerdown",F)}}),[W]),{onPointerDownCapture:()=>N.current=!0}})((C=>{const W=C.target,N=[...p.branches].some((F=>F.contains(W)));E&&!N&&(s==null||s(C),u==null||u(C),C.defaultPrevented||l==null||l())})),T=(function(C){const W=Yn(C),N=$.useRef(!1);return $.useEffect((()=>{const F=q=>{q.target&&!N.current&&Qg("dismissableLayer.focusOutside",W,{originalEvent:q})};return document.addEventListener("focusin",F),()=>document.removeEventListener("focusin",F)}),[W]),{onFocusCapture:()=>N.current=!0,onBlurCapture:()=>N.current=!1}})((C=>{const W=C.target;[...p.branches].some((N=>N.contains(W)))||(a==null||a(C),u==null||u(C),C.defaultPrevented||l==null||l())}));return gy((C=>{v===p.layers.size-1&&(i==null||i(C),C.defaultPrevented||l==null||l())})),EC({disabled:r}),$.useEffect((()=>{m&&(r&&p.layersWithOutsidePointerEventsDisabled.add(m),p.layers.add(m),Jg())}),[m,r,p]),$.useEffect((()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),Jg())}),[m,p]),$.useEffect((()=>{const C=()=>g({});return document.addEventListener("dismissableLayer.update",C),()=>document.removeEventListener("dismissableLayer.update",C)}),[]),$.createElement(Pn.div,rt({},f,{ref:y,style:{pointerEvents:S?E?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,R.onPointerDownCapture)}))}));function Jg(){const e=new Event("dismissableLayer.update");document.dispatchEvent(e)}function Qg(e,t,r){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});return t&&i.addEventListener(e,t,{once:!0}),!i.dispatchEvent(s)}function em(e){const[t,r]=$.useState(void 0);return $.useEffect((()=>{if(e){const i=new ResizeObserver((s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let u,l;if("borderBoxSize"in a){const f=a.borderBoxSize,p=Array.isArray(f)?f[0]:f;u=p.inlineSize,l=p.blockSize}else{const f=e.getBoundingClientRect();u=f.width,l=f.height}r({width:u,height:l})}));return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}r(void 0)}),[e]),t}function OC(e,t){const r=Wn.get(e);return r===void 0?(Wn.set(e,{rect:{},callbacks:[t]}),Wn.size===1&&(Cc=requestAnimationFrame(my))):(r.callbacks.push(t),t(e.getBoundingClientRect())),()=>{const i=Wn.get(e);if(i===void 0)return;const s=i.callbacks.indexOf(t);s>-1&&i.callbacks.splice(s,1),i.callbacks.length===0&&(Wn.delete(e),Wn.size===0&&cancelAnimationFrame(Cc))}}let Cc;const Wn=new Map;function my(){const e=[];Wn.forEach(((t,r)=>{const i=r.getBoundingClientRect();var s,a;s=t.rect,a=i,(s.width!==a.width||s.height!==a.height||s.top!==a.top||s.right!==a.right||s.bottom!==a.bottom||s.left!==a.left)&&(t.rect=i,e.push(t))})),e.forEach((t=>{t.callbacks.forEach((r=>r(t.rect)))})),Cc=requestAnimationFrame(my)}function vy(e){const[t,r]=$.useState();return $.useEffect((()=>{if(e){const i=OC(e,r);return()=>{r(void 0),i()}}}),[e]),t}function hf(e,t=[]){let r=[];const i=()=>{const s=r.map((a=>$.createContext(a)));return function(a){const u=(a==null?void 0:a[e])||s;return $.useMemo((()=>({[`__scope${e}`]:{...a,[e]:u}})),[a,u])}};return i.scopeName=e,[function(s,a){const u=$.createContext(a),l=r.length;function f(p){const{scope:m,children:d,...g}=p,y=(m==null?void 0:m[e][l])||u,x=$.useMemo((()=>g),Object.values(g));return $.createElement(y.Provider,{value:x},d)}return r=[...r,a],f.displayName=s+"Provider",[f,function(p,m){const d=(m==null?void 0:m[e][l])||u,g=$.useContext(d);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${s}\``)}]},AC(i,...t)]}function AC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map((s=>({useScope:s(),scopeName:s.scopeName})));return function(s){const a=i.reduce(((u,{useScope:l,scopeName:f})=>({...u,...l(s)[`__scope${f}`]})),{});return $.useMemo((()=>({[`__scope${t.scopeName}`]:a})),[a])}};return r.scopeName=t.scopeName,r}function RC({anchorRect:e,popperSize:t,arrowSize:r,arrowOffset:i=0,side:s,sideOffset:a=0,align:u,alignOffset:l=0,shouldAvoidCollisions:f=!0,collisionBoundariesRect:p,collisionTolerance:m=0}){if(!e||!t||!p)return{popperStyles:PC,arrowStyles:Yl};const d=(function(W,N,F=0,q=0,j){const D=j?j.height:0,H=tm(N,W,"x"),G=tm(N,W,"y"),k=G.before-F-D,Q=G.after+F+D,J=H.before-F-D,re=H.after+F+D;return{top:{start:{x:H.start+q,y:k},center:{x:H.center,y:k},end:{x:H.end-q,y:k}},right:{start:{x:re,y:G.start+q},center:{x:re,y:G.center},end:{x:re,y:G.end-q}},bottom:{start:{x:H.start+q,y:Q},center:{x:H.center,y:Q},end:{x:H.end-q,y:Q}},left:{start:{x:J,y:G.start+q},center:{x:J,y:G.center},end:{x:J,y:G.end-q}}}})(t,e,a,l,r),g=d[s][u];if(f===!1){const W=rm(g);let N=Yl;return r&&(N=im({popperSize:t,arrowSize:r,arrowOffset:i,side:s,align:u})),{popperStyles:{...W,"--radix-popper-transform-origin":nm(t,s,u,i,r)},arrowStyles:N,placedSide:s,placedAlign:u}}const y=DOMRect.fromRect({...t,...g}),x=(h=p,w=m,DOMRect.fromRect({width:h.width-2*w,height:h.height-2*w,x:h.left+w,y:h.top+w}));var h,w;const v=sm(y,x),S=d[om(s)][u],E=(function(W,N,F){const q=om(W);return N[W]&&!F[q]?q:W})(s,v,sm(DOMRect.fromRect({...t,...S}),x)),R=(function(W,N,F,q,j){const D=F==="top"||F==="bottom",H=D?"left":"top",G=D?"right":"bottom",k=D?"width":"height",Q=N[k]>W[k];return(q==="start"||q==="center")&&(j[H]&&Q||j[G]&&!Q)?"end":(q==="end"||q==="center")&&(j[G]&&Q||j[H]&&!Q)?"start":q})(t,e,s,u,v),T=rm(d[E][R]);let C=Yl;return r&&(C=im({popperSize:t,arrowSize:r,arrowOffset:i,side:E,align:R})),{popperStyles:{...T,"--radix-popper-transform-origin":nm(t,E,R,i,r)},arrowStyles:C,placedSide:E,placedAlign:R}}function tm(e,t,r){const i=e[r==="x"?"left":"top"],s=r==="x"?"width":"height",a=e[s],u=t[s];return{before:i-u,start:i,center:i+(a-u)/2,end:i+a-u,after:i+a}}function rm(e){return{position:"absolute",top:0,left:0,minWidth:"max-content",willChange:"transform",transform:`translate3d(${Math.round(e.x+window.scrollX)}px, ${Math.round(e.y+window.scrollY)}px, 0)`}}function nm(e,t,r,i,s){const a=t==="top"||t==="bottom",u=s?s.width:0,l=s?s.height:0,f=u/2+i;let p="",m="";return a?(p={start:`${f}px`,center:"center",end:e.width-f+"px"}[r],m=t==="top"?`${e.height+l}px`:-l+"px"):(p=t==="left"?`${e.width+l}px`:-l+"px",m={start:`${f}px`,center:"center",end:e.height-f+"px"}[r]),`${p} ${m}`}const PC={position:"fixed",top:0,left:0,opacity:0,transform:"translate3d(0, -200%, 0)"},Yl={position:"absolute",opacity:0};function im({popperSize:e,arrowSize:t,arrowOffset:r,side:i,align:s}){const a=(e.width-t.width)/2,u=(e.height-t.width)/2,l={top:0,right:90,bottom:180,left:-90}[i],f=Math.max(t.width,t.height),p={width:`${f}px`,height:`${f}px`,transform:`rotate(${l}deg)`,willChange:"transform",position:"absolute",[i]:"100%",direction:CC(i,s)};return i!=="top"&&i!=="bottom"||(s==="start"&&(p.left=`${r}px`),s==="center"&&(p.left=`${a}px`),s==="end"&&(p.right=`${r}px`)),i!=="left"&&i!=="right"||(s==="start"&&(p.top=`${r}px`),s==="center"&&(p.top=`${u}px`),s==="end"&&(p.bottom=`${r}px`)),p}function CC(e,t){return(e!=="top"&&e!=="right"||t!=="end")&&(e!=="bottom"&&e!=="left"||t==="end")?"ltr":"rtl"}function om(e){return{top:"bottom",right:"left",bottom:"top",left:"right"}[e]}function sm(e,t){return{top:e.top<t.top,right:e.right>t.right,bottom:e.bottom>t.bottom,left:e.left<t.left}}const[yy,Ka]=hf("Popper"),[kC,by]=yy("Popper"),IC=e=>{const{__scopePopper:t,children:r}=e,[i,s]=$.useState(null);return $.createElement(kC,{scope:t,anchor:i,onAnchorChange:s},r)},$C=$.forwardRef(((e,t)=>{const{__scopePopper:r,virtualRef:i,...s}=e,a=by("PopperAnchor",r),u=$.useRef(null),l=Rn(t,u);return $.useEffect((()=>{a.onAnchorChange((i==null?void 0:i.current)||u.current)})),i?null:$.createElement(Pn.div,rt({},s,{ref:l}))})),[LC,AF]=yy("PopperContent"),MC=$.forwardRef(((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s,align:a="center",alignOffset:u,collisionTolerance:l,avoidCollisions:f=!0,...p}=e,m=by("PopperContent",r),[d,g]=$.useState(),y=vy(m.anchor),[x,h]=$.useState(null),w=em(x),[v,S]=$.useState(null),E=em(v),R=Rn(t,(D=>h(D))),T=(function(){const[D,H]=$.useState(void 0);return $.useEffect((()=>{let G;function k(){H({width:window.innerWidth,height:window.innerHeight})}function Q(){window.clearTimeout(G),G=window.setTimeout(k,100)}return k(),window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)}),[]),D})(),C=T?DOMRect.fromRect({...T,x:0,y:0}):void 0,{popperStyles:W,arrowStyles:N,placedSide:F,placedAlign:q}=RC({anchorRect:y,popperSize:w,arrowSize:E,arrowOffset:d,side:i,sideOffset:s,align:a,alignOffset:u,shouldAvoidCollisions:f,collisionBoundariesRect:C,collisionTolerance:l}),j=F!==void 0;return $.createElement("div",{style:W,"data-radix-popper-content-wrapper":""},$.createElement(LC,{scope:r,arrowStyles:N,onArrowChange:S,onArrowOffsetChange:g},$.createElement(Pn.div,rt({"data-side":F,"data-align":q},p,{style:{...p.style,animation:j?void 0:"none"},ref:R}))))})),wy=IC,xy=$C,Sy=MC;function Ey({prop:e,defaultProp:t,onChange:r=(()=>{})}){const[i,s]=(function({defaultProp:f,onChange:p}){const m=$.useState(f),[d]=m,g=$.useRef(d),y=Yn(p);return $.useEffect((()=>{g.current!==d&&(y(d),g.current=d)}),[d,g,y]),m})({defaultProp:t,onChange:r}),a=e!==void 0,u=a?e:i,l=Yn(r);return[u,$.useCallback((f=>{if(a){const p=f,m=typeof f=="function"?p(e):f;m!==e&&l(m)}else s(f)}),[a,e,s,l])]}const[DC]=hf("Popover",[Ka]),gf=Ka(),[NC,Ko]=DC("Popover"),FC=e=>{const{__scopePopover:t,children:r,open:i,defaultOpen:s,onOpenChange:a,modal:u=!1}=e,l=gf(t),f=$.useRef(null),[p,m]=$.useState(!1),[d=!1,g]=Ey({prop:i,defaultProp:s,onChange:a});return $.createElement(wy,l,$.createElement(NC,{scope:t,contentId:fy(),triggerRef:f,open:d,onOpenChange:g,onOpenToggle:$.useCallback((()=>g((y=>!y))),[g]),hasCustomAnchor:p,onCustomAnchorAdd:$.useCallback((()=>m(!0)),[]),onCustomAnchorRemove:$.useCallback((()=>m(!1)),[]),modal:u},r))},jC=$.forwardRef(((e,t)=>{const{__scopePopover:r,...i}=e,s=Ko("PopoverTrigger",r),a=gf(r),u=Rn(t,s.triggerRef),l=$.createElement(Pn.button,rt({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ty(s.open)},i,{ref:u,onClick:Zt(e.onClick,s.onOpenToggle)}));return s.hasCustomAnchor?l:$.createElement(xy,rt({asChild:!0},a),l)})),zC=$.forwardRef(((e,t)=>{const{forceMount:r,...i}=e,s=Ko("PopoverContent",e.__scopePopover);return $.createElement(df,{present:r||s.open},s.modal?$.createElement(BC,rt({},i,{ref:t})):$.createElement(WC,rt({},i,{ref:t})))})),BC=$.forwardRef(((e,t)=>{const{allowPinchZoom:r,portalled:i=!0,...s}=e,a=Ko("PopoverContent",e.__scopePopover),u=$.useRef(null),l=Rn(t,u),f=$.useRef(!1);$.useEffect((()=>{const m=u.current;if(m)return IP(m)}),[]);const p=i?pf:$.Fragment;return $.createElement(p,null,$.createElement(cy,{allowPinchZoom:r},$.createElement(_y,rt({},s,{ref:l,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zt(e.onCloseAutoFocus,(m=>{var d;m.preventDefault(),f.current||(d=a.triggerRef.current)===null||d===void 0||d.focus()})),onPointerDownOutside:Zt(e.onPointerDownOutside,(m=>{const d=m.detail.originalEvent,g=d.button===0&&d.ctrlKey===!0,y=d.button===2||g;f.current=y}),{checkForDefaultPrevented:!1}),onFocusOutside:Zt(e.onFocusOutside,(m=>m.preventDefault()),{checkForDefaultPrevented:!1})}))))})),WC=$.forwardRef(((e,t)=>{const{portalled:r=!0,...i}=e,s=Ko("PopoverContent",e.__scopePopover),a=$.useRef(!1),u=r?pf:$.Fragment;return $.createElement(u,null,$.createElement(_y,rt({},i,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var f,p;(f=e.onCloseAutoFocus)===null||f===void 0||f.call(e,l),l.defaultPrevented||(a.current||(p=s.triggerRef.current)===null||p===void 0||p.focus(),l.preventDefault()),a.current=!1},onInteractOutside:l=>{var f,p;(f=e.onInteractOutside)===null||f===void 0||f.call(e,l),l.defaultPrevented||(a.current=!0);const m=l.target;!((p=s.triggerRef.current)===null||p===void 0)&&p.contains(m)&&l.preventDefault()}})))})),_y=$.forwardRef(((e,t)=>{const{__scopePopover:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,...d}=e,g=Ko("PopoverContent",r),y=gf(r);return yC(),$.createElement(wC,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:a},$.createElement(TC,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:p,onDismiss:()=>g.onOpenChange(!1)},$.createElement(Sy,rt({"data-state":Ty(g.open),role:"dialog",id:g.contentId},y,d,{ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)"}}))))}));function Ty(e){return e?"open":"closed"}const HC=FC,UC=jC,qC=zC;var wa=(e=>(e.VIDEO="video",e.CAROUSEL="carousel",e.TEXT="text",e))(wa||{}),Xl={},ho={},na={},ia={},oa={exports:{}},sa={exports:{}},Fe={};/** @license React v16.13.1
|
|
63
63
|
* react-is.production.min.js
|
|
64
64
|
*
|
|
65
65
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -198,10 +198,10 @@ __p += '`),Ce&&(ee+=`' +
|
|
|
198
198
|
function print() { __p += __j.call(arguments, '') }
|
|
199
199
|
`:`;
|
|
200
200
|
`)+ee+`return __p
|
|
201
|
-
}`;var Te=Dh(function(){return Le(A,le+"return "+ee).apply(r,P)});if(Te.source=ee,bl(Te))throw Te;return Te}function IT(n){return Ne(n).toLowerCase()}function $T(n){return Ne(n).toUpperCase()}function LT(n,o,c){if(n=Ne(n),n&&(c||o===r))return Ud(n);if(!n||!(o=Wt(o)))return n;var b=fr(n),_=fr(o),A=qd(b,_),P=Gd(b,_)+1;return mn(b,A,P).join("")}function MT(n,o,c){if(n=Ne(n),n&&(c||o===r))return n.slice(0,Vd(n)+1);if(!n||!(o=Wt(o)))return n;var b=fr(n),_=Gd(b,fr(o))+1;return mn(b,0,_).join("")}function DT(n,o,c){if(n=Ne(n),n&&(c||o===r))return n.replace(bu,"");if(!n||!(o=Wt(o)))return n;var b=fr(n),_=qd(b,fr(o));return mn(b,_).join("")}function NT(n,o){var c=j,b=D;if(et(o)){var _="separator"in o?o.separator:_;c="length"in o?Ee(o.length):c,b="omission"in o?Wt(o.omission):b}n=Ne(n);var A=n.length;if(si(n)){var P=fr(n);A=P.length}if(c>=A)return n;var L=c-ai(b);if(L<1)return b;var B=P?mn(P,0,L).join(""):n.slice(0,L);if(_===r)return B+b;if(P&&(L+=B.length-L),wl(_)){if(n.slice(L).search(_)){var K,Y=B;for(_.global||(_=Du(_.source,Ne(dd.exec(_))+"g")),_.lastIndex=0;K=_.exec(Y);)var ee=K.index;B=B.slice(0,ee===r?L:ee)}}else if(n.indexOf(Wt(_),L)!=L){var se=B.lastIndexOf(_);se>-1&&(B=B.slice(0,se))}return B+b}function FT(n){return n=Ne(n),n&&Xb.test(n)?n.replace(ud,h1):n}var jT=hi(function(n,o,c){return n+(c?" ":"")+o.toUpperCase()}),_l=Dp("toUpperCase");function Mh(n,o,c){return n=Ne(n),o=c?r:o,o===r?l1(n)?v1(n):e1(n):n.match(o)||[]}var Dh=Ae(function(n,o){try{return jt(n,r,o)}catch(c){return bl(c)?c:new be(c)}}),zT=qr(function(n,o){return zt(o,function(c){c=pr(c),Er(n,c,vl(n[c],n))}),n});function BT(n){var o=n==null?0:n.length,c=ge();return n=o?Ye(n,function(b){if(typeof b[1]!="function")throw new Qt(u);return[c(b[0]),b[1]]}):[],Ae(function(b){for(var _=-1;++_<o;){var A=n[_];if(jt(A[0],this,b))return jt(A[1],this,b)}})}function WT(n){return hx(tr(n,g))}function Tl(n){return function(){return n}}function HT(n,o){return n==null||n!==n?o:n}var UT=Fp(),qT=Fp(!0);function Mt(n){return n}function Ol(n){return hp(typeof n=="function"?n:tr(n,g))}function GT(n){return mp(tr(n,g))}function ZT(n,o){return vp(n,tr(o,g))}var VT=Ae(function(n,o){return function(c){return Gi(c,n,o)}}),KT=Ae(function(n,o){return function(c){return Gi(n,c,o)}});function Al(n,o,c){var b=pt(o),_=As(o,b);c==null&&!(et(o)&&(_.length||!b.length))&&(c=o,o=n,n=this,_=As(o,pt(o)));var A=!(et(c)&&"chain"in c)||!!c.chain,P=Zr(n);return zt(_,function(L){var B=o[L];n[L]=B,P&&(n.prototype[L]=function(){var K=this.__chain__;if(A||K){var Y=n(this.__wrapped__),ee=Y.__actions__=It(this.__actions__);return ee.push({func:B,args:arguments,thisArg:n}),Y.__chain__=K,Y}return B.apply(n,cn([this.value()],arguments))})}),n}function YT(){return gt._===this&&(gt._=E1),this}function Rl(){}function XT(n){return n=Ee(n),Ae(function(o){return yp(o,n)})}var JT=il(Ye),QT=il(jd),eO=il(Pu);function Nh(n){return fl(n)?Cu(pr(n)):kx(n)}function tO(n){return function(o){return n==null?r:Dn(n,o)}}var rO=zp(),nO=zp(!0);function Pl(){return[]}function Cl(){return!1}function iO(){return{}}function oO(){return""}function sO(){return!0}function aO(n,o){if(n=Ee(n),n<1||n>ce)return[];var c=ne,b=Et(n,ne);o=ge(o),n-=ne;for(var _=$u(b,o);++c<n;)o(c);return _}function uO(n){return Se(n)?Ye(n,pr):Ht(n)?[n]:It(rh(Ne(n)))}function lO(n){var o=++x1;return Ne(n)+o}var cO=$s(function(n,o){return n+o},0),fO=ol("ceil"),dO=$s(function(n,o){return n/o},1),pO=ol("floor");function hO(n){return n&&n.length?Os(n,Mt,Uu):r}function gO(n,o){return n&&n.length?Os(n,ge(o,2),Uu):r}function mO(n){return Wd(n,Mt)}function vO(n,o){return Wd(n,ge(o,2))}function yO(n){return n&&n.length?Os(n,Mt,Vu):r}function bO(n,o){return n&&n.length?Os(n,ge(o,2),Vu):r}var wO=$s(function(n,o){return n*o},1),xO=ol("round"),SO=$s(function(n,o){return n-o},0);function EO(n){return n&&n.length?Iu(n,Mt):0}function _O(n,o){return n&&n.length?Iu(n,ge(o,2)):0}return O.after=ZE,O.ary=ph,O.assign=L_,O.assignIn=Ah,O.assignInWith=Rh,O.assignWith=xl,O.at=M_,O.before=hh,O.bind=vl,O.bindAll=zT,O.bindKey=gh,O.castArray=o_,O.chain=ch,O.chunk=hS,O.compact=gS,O.concat=mS,O.cond=BT,O.conforms=WT,O.constant=Tl,O.countBy=_E,O.create=D_,O.curry=mh,O.curryRight=vh,O.debounce=yh,O.defaults=N_,O.defaultsDeep=F_,O.defer=VE,O.delay=KE,O.difference=vS,O.differenceBy=yS,O.differenceWith=bS,O.drop=wS,O.dropRight=xS,O.dropRightWhile=SS,O.dropWhile=ES,O.fill=_S,O.filter=OE,O.flatMap=PE,O.flatMapDeep=CE,O.flatMapDepth=kE,O.flatten=sh,O.flattenDeep=TS,O.flattenDepth=OS,O.flip=YE,O.flow=UT,O.flowRight=qT,O.fromPairs=AS,O.functions=q_,O.functionsIn=G_,O.groupBy=IE,O.initial=PS,O.intersection=CS,O.intersectionBy=kS,O.intersectionWith=IS,O.invert=V_,O.invertBy=K_,O.invokeMap=LE,O.iteratee=Ol,O.keyBy=ME,O.keys=pt,O.keysIn=Lt,O.map=zs,O.mapKeys=X_,O.mapValues=J_,O.matches=GT,O.matchesProperty=ZT,O.memoize=Ws,O.merge=Q_,O.mergeWith=Ph,O.method=VT,O.methodOf=KT,O.mixin=Al,O.negate=Hs,O.nthArg=XT,O.omit=eT,O.omitBy=tT,O.once=XE,O.orderBy=DE,O.over=JT,O.overArgs=JE,O.overEvery=QT,O.overSome=eO,O.partial=yl,O.partialRight=bh,O.partition=NE,O.pick=rT,O.pickBy=Ch,O.property=Nh,O.propertyOf=tO,O.pull=DS,O.pullAll=uh,O.pullAllBy=NS,O.pullAllWith=FS,O.pullAt=jS,O.range=rO,O.rangeRight=nO,O.rearg=QE,O.reject=zE,O.remove=zS,O.rest=e_,O.reverse=gl,O.sampleSize=WE,O.set=iT,O.setWith=oT,O.shuffle=HE,O.slice=BS,O.sortBy=GE,O.sortedUniq=VS,O.sortedUniqBy=KS,O.split=RT,O.spread=t_,O.tail=YS,O.take=XS,O.takeRight=JS,O.takeRightWhile=QS,O.takeWhile=eE,O.tap=gE,O.throttle=r_,O.thru=js,O.toArray=_h,O.toPairs=kh,O.toPairsIn=Ih,O.toPath=uO,O.toPlainObject=Oh,O.transform=sT,O.unary=n_,O.union=tE,O.unionBy=rE,O.unionWith=nE,O.uniq=iE,O.uniqBy=oE,O.uniqWith=sE,O.unset=aT,O.unzip=ml,O.unzipWith=lh,O.update=uT,O.updateWith=lT,O.values=vi,O.valuesIn=cT,O.without=aE,O.words=Mh,O.wrap=i_,O.xor=uE,O.xorBy=lE,O.xorWith=cE,O.zip=fE,O.zipObject=dE,O.zipObjectDeep=pE,O.zipWith=hE,O.entries=kh,O.entriesIn=Ih,O.extend=Ah,O.extendWith=Rh,Al(O,O),O.add=cO,O.attempt=Dh,O.camelCase=hT,O.capitalize=$h,O.ceil=fO,O.clamp=fT,O.clone=s_,O.cloneDeep=u_,O.cloneDeepWith=l_,O.cloneWith=a_,O.conformsTo=c_,O.deburr=Lh,O.defaultTo=HT,O.divide=dO,O.endsWith=gT,O.eq=hr,O.escape=mT,O.escapeRegExp=vT,O.every=TE,O.find=AE,O.findIndex=ih,O.findKey=j_,O.findLast=RE,O.findLastIndex=oh,O.findLastKey=z_,O.floor=pO,O.forEach=fh,O.forEachRight=dh,O.forIn=B_,O.forInRight=W_,O.forOwn=H_,O.forOwnRight=U_,O.get=Sl,O.gt=f_,O.gte=d_,O.has=Z_,O.hasIn=El,O.head=ah,O.identity=Mt,O.includes=$E,O.indexOf=RS,O.inRange=dT,O.invoke=Y_,O.isArguments=jn,O.isArray=Se,O.isArrayBuffer=p_,O.isArrayLike=$t,O.isArrayLikeObject=it,O.isBoolean=h_,O.isBuffer=vn,O.isDate=g_,O.isElement=m_,O.isEmpty=v_,O.isEqual=y_,O.isEqualWith=b_,O.isError=bl,O.isFinite=w_,O.isFunction=Zr,O.isInteger=wh,O.isLength=Us,O.isMap=xh,O.isMatch=x_,O.isMatchWith=S_,O.isNaN=E_,O.isNative=__,O.isNil=O_,O.isNull=T_,O.isNumber=Sh,O.isObject=et,O.isObjectLike=nt,O.isPlainObject=Ji,O.isRegExp=wl,O.isSafeInteger=A_,O.isSet=Eh,O.isString=qs,O.isSymbol=Ht,O.isTypedArray=mi,O.isUndefined=R_,O.isWeakMap=P_,O.isWeakSet=C_,O.join=$S,O.kebabCase=yT,O.last=nr,O.lastIndexOf=LS,O.lowerCase=bT,O.lowerFirst=wT,O.lt=k_,O.lte=I_,O.max=hO,O.maxBy=gO,O.mean=mO,O.meanBy=vO,O.min=yO,O.minBy=bO,O.stubArray=Pl,O.stubFalse=Cl,O.stubObject=iO,O.stubString=oO,O.stubTrue=sO,O.multiply=wO,O.nth=MS,O.noConflict=YT,O.noop=Rl,O.now=Bs,O.pad=xT,O.padEnd=ST,O.padStart=ET,O.parseInt=_T,O.random=pT,O.reduce=FE,O.reduceRight=jE,O.repeat=TT,O.replace=OT,O.result=nT,O.round=xO,O.runInContext=z,O.sample=BE,O.size=UE,O.snakeCase=AT,O.some=qE,O.sortedIndex=WS,O.sortedIndexBy=HS,O.sortedIndexOf=US,O.sortedLastIndex=qS,O.sortedLastIndexBy=GS,O.sortedLastIndexOf=ZS,O.startCase=PT,O.startsWith=CT,O.subtract=SO,O.sum=EO,O.sumBy=_O,O.template=kT,O.times=aO,O.toFinite=Vr,O.toInteger=Ee,O.toLength=Th,O.toLower=IT,O.toNumber=ir,O.toSafeInteger=$_,O.toString=Ne,O.toUpper=$T,O.trim=LT,O.trimEnd=MT,O.trimStart=DT,O.truncate=NT,O.unescape=FT,O.uniqueId=lO,O.upperCase=jT,O.upperFirst=_l,O.each=fh,O.eachRight=dh,O.first=ah,Al(O,(function(){var n={};return _r(O,function(o,c){De.call(O.prototype,c)||(n[c]=o)}),n})(),{chain:!1}),O.VERSION=i,zt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){O[n].placeholder=O}),zt(["drop","take"],function(n,o){Pe.prototype[n]=function(c){c=c===r?1:ft(Ee(c),0);var b=this.__filtered__&&!o?new Pe(this):this.clone();return b.__filtered__?b.__takeCount__=Et(c,b.__takeCount__):b.__views__.push({size:Et(c,ne),type:n+(b.__dir__<0?"Right":"")}),b},Pe.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),zt(["filter","map","takeWhile"],function(n,o){var c=o+1,b=c==k||c==J;Pe.prototype[n]=function(_){var A=this.clone();return A.__iteratees__.push({iteratee:ge(_,3),type:c}),A.__filtered__=A.__filtered__||b,A}}),zt(["head","last"],function(n,o){var c="take"+(o?"Right":"");Pe.prototype[n]=function(){return this[c](1).value()[0]}}),zt(["initial","tail"],function(n,o){var c="drop"+(o?"":"Right");Pe.prototype[n]=function(){return this.__filtered__?new Pe(this):this[c](1)}}),Pe.prototype.compact=function(){return this.filter(Mt)},Pe.prototype.find=function(n){return this.filter(n).head()},Pe.prototype.findLast=function(n){return this.reverse().find(n)},Pe.prototype.invokeMap=Ae(function(n,o){return typeof n=="function"?new Pe(this):this.map(function(c){return Gi(c,n,o)})}),Pe.prototype.reject=function(n){return this.filter(Hs(ge(n)))},Pe.prototype.slice=function(n,o){n=Ee(n);var c=this;return c.__filtered__&&(n>0||o<0)?new Pe(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),o!==r&&(o=Ee(o),c=o<0?c.dropRight(-o):c.take(o-n)),c)},Pe.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Pe.prototype.toArray=function(){return this.take(ne)},_r(Pe.prototype,function(n,o){var c=/^(?:filter|find|map|reject)|While$/.test(o),b=/^(?:head|last)$/.test(o),_=O[b?"take"+(o=="last"?"Right":""):o],A=b||/^find/.test(o);_&&(O.prototype[o]=function(){var P=this.__wrapped__,L=b?[1]:arguments,B=P instanceof Pe,K=L[0],Y=B||Se(P),ee=function(Re){var Ce=_.apply(O,cn([Re],L));return b&&se?Ce[0]:Ce};Y&&c&&typeof K=="function"&&K.length!=1&&(B=Y=!1);var se=this.__chain__,le=!!this.__actions__.length,me=A&&!se,Te=B&&!le;if(!A&&Y){P=Te?P:new Pe(this);var pe=n.apply(P,L);return pe.__actions__.push({func:js,args:[ee],thisArg:r}),new er(pe,se)}return me&&Te?n.apply(this,L):(pe=this.thru(ee),me?b?pe.value()[0]:pe.value():pe)})}),zt(["pop","push","shift","sort","splice","unshift"],function(n){var o=fs[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",b=/^(?:pop|shift)$/.test(n);O.prototype[n]=function(){var _=arguments;if(b&&!this.__chain__){var A=this.value();return o.apply(Se(A)?A:[],_)}return this[c](function(P){return o.apply(Se(P)?P:[],_)})}}),_r(Pe.prototype,function(n,o){var c=O[o];if(c){var b=c.name+"";De.call(fi,b)||(fi[b]=[]),fi[b].push({name:o,func:c})}}),fi[Is(r,S).name]=[{name:"wrapper",func:r}],Pe.prototype.clone=j1,Pe.prototype.reverse=z1,Pe.prototype.value=B1,O.prototype.at=mE,O.prototype.chain=vE,O.prototype.commit=yE,O.prototype.next=bE,O.prototype.plant=xE,O.prototype.reverse=SE,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=EE,O.prototype.first=O.prototype.head,ji&&(O.prototype[ji]=wE),O}),ui=y1();kn?((kn.exports=ui)._=ui,Tu._=ui):gt._=ui}).call(o$)})(Oo,Oo.exports)),Oo.exports}var Ie=s$();const Fc={FdSave:Qe.FdSave,FdWarningDanger:Qe.FdWarningDanger,FdInfoCircle:Qe.FdInfoCircle,FdInfoBold:Qe.FdInfoBold};var $f=(e=>(e.ALERT="alert",e.CONFIRM="confirm",e))($f||{}),Vn=(e=>(e.PRIMARY="primary",e.WARNING="warning",e.DANGER="danger",e))(Vn||{}),Ei=(e=>(e.CONFIRMED="confirmed",e.CANCELED="canceled",e))(Ei||{});const c0={[Vn.PRIMARY]:{icon:"blue-500",button:"primary-dark"},[Vn.DANGER]:{icon:"red-500",button:"primary-dark"},[Vn.WARNING]:{icon:"yellow-400",button:"primary-dark"}},lc=({color:e=Vn.PRIMARY,variant:t="solid",children:r,autoFocus:i,...s})=>{const a=c0[e].button,u=t==="outlined"?`bg-transparent text-white border border-white hover:border-white hover:bg-white hover:text-${a}`:`text-white bg-${a} border border-${a} hover:border-white hover:bg-primary-hover hover:text-white`;return I.jsx("button",{autoFocus:i,className:Be("w-16 rounded px-2 py-1 text-xs font-medium hover:font-bold focus:outline-none",u),...s,children:r})},a$=({name:e,color:t=Vn.PRIMARY,className:r="w-8 h-8"})=>{const i=Fc[e]||Fc.FdInfoCircle,s=`text-${c0[t].icon}`;return I.jsx(i,{className:Be(r,s)})},u$=({id:e,title:t,message:r,icon:i,type:s,color:a,zIndex:u=3e3,views:l,width:f=520,hasOverlay:p=!0,container:m,onClose:d,onEdit:g})=>{const y=w=>{d({id:e,reason:w})};M.useEffect(()=>{function w(v){v.key==="Escape"&&y(Ei.CANCELED)}return window.addEventListener("keyup",w),()=>{window.removeEventListener("keyup",w)}},[]);const x=Ie.merge(Ie.values(l==null?void 0:l.toggles).flatMap(w=>w.value?w.warnings||[]:[]),l==null?void 0:l.tips),h=(w,v)=>{var E;if(!(l!=null&&l.toggles))return;const S=Ie.cloneDeep(l);(E=S.toggles)!=null&&E[w]&&(S.toggles[w].value=v),g({id:e,views:S})};return Qn.createPortal(I.jsx(Ca,{appear:!0,show:!0,as:M.Fragment,children:I.jsx("div",{className:Be("absolute inset-0 flex h-full w-full items-center justify-center overflow-y-auto",{"bg-black bg-opacity-80":p}),style:{zIndex:u},onClick:()=>y(Ei.CANCELED),children:I.jsx(Ca.Child,{as:M.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:I.jsx("div",{"data-cy":"confirmation-modal-cy",className:"relative rounded-md border border-grey-50 bg-grey-900",style:{width:f},onClick:w=>w.stopPropagation(),children:I.jsxs("div",{className:"flex flex-col items-center gap-3 p-6 px-12",children:[i?I.jsx("div",{className:"flex items-center justify-center",children:I.jsx(a$,{name:i,color:a,className:"w-6 h-6"})}):null,I.jsx(l$,{condition:t,children:I.jsx("h4",{className:"w-full text-wrap text-lg font-bold leading-6 text-white text-center",children:t})}),I.jsx("p",{className:"w-full text-wrap text-center text-sm font-medium text-white",children:r}),I.jsx("div",{className:"text-xs text-white",children:Ie.values(l==null?void 0:l.toggles).map(w=>I.jsx("div",{children:I.jsxs("label",{htmlFor:w.key,className:"flex items-center",children:[I.jsx(Vy,{size:"xs",value:w.value,onChange:v=>h(w.key,v)}),I.jsx("span",{className:"ml-1",children:w.title})]})},w.key))}),I.jsx(c$,{warnings:x}),I.jsx("div",{className:"flex items-center gap-4",children:s===$f.CONFIRM?I.jsxs(I.Fragment,{children:[I.jsx(lc,{autoFocus:!0,color:a,onClick:()=>y(Ei.CONFIRMED),children:"Confirm"}),I.jsx(lc,{color:a,variant:"outlined",onClick:()=>y(Ei.CANCELED),children:"Cancel"})]}):I.jsx(lc,{autoFocus:!0,onClick:()=>y(),children:"OK"})})]})})})})}),m||document.body)},l$=e=>e.condition?I.jsx(I.Fragment,{children:e.children}):null,c$=e=>e.warnings?I.jsx(Ca,{appear:!0,show:!!e.warnings.length,as:M.Fragment,children:I.jsx("div",{className:"flex flex-col gap-1 rounded-sm bg-grey-600 p-2 text-xs text-white",children:e.warnings.map((t,r)=>I.jsx(Ca.Child,{as:M.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:I.jsxs("div",{className:"flex flex-1 items-center gap-1 rounded-sm px-2 py-1",children:[I.jsx(Qe.FdWarningDanger,{className:Be({"h-3 w-3":!0,"text-yellow-500":t.type==="warning","text-red-400":t.type==="error","text-primary-dark":t.type==="info"},"mr-3")}),I.jsx("div",{className:"flex-1",children:t.message})]})},`modal-warnings-${r}`))})}):null;var f0=(e=>(e[e.MIN=.5]="MIN",e[e.MAX=10]="MAX",e[e.STEP=.5]="STEP",e[e.INIT=1]="INIT",e[e.TRANSITION=200]="TRANSITION",e))(f0||{});const f$=({zoom:e,minZoom:t=.5,maxZoom:r=10,handleZoomIn:i,handleZoomOut:s})=>I.jsxs("div",{className:"flex items-center rounded bg-grey-300 p-1",children:[I.jsx(Qe.FdMinusNaked,{onClick:s,className:Be("h-5 w-5 p-1",{"text-grey-200":e<=t,"cursor-pointer rounded hover:bg-purple-800":e>t})}),I.jsxs("span",{className:"mx-1 w-10 select-none text-center text-xs",children:[(e*100).toFixed(0),"%"]}),I.jsx(Qe.FdPlusNaked,{onClick:i,className:Be("h-5 w-5 p-1",{"text-grey-200":e>=r,"cursor-pointer rounded hover:bg-purple-800":e<r})})]}),d$=$.forwardRef(((e,t)=>$.createElement(Pn.span,rt({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})))),p$=d$;function Um(e){const t=$.useRef({value:e,previous:e});return $.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}const[d0]=hf("Tooltip",[Ka]),Lf=Ka(),h$=700,[k2,g$]=d0("TooltipProvider",{isOpenDelayed:!0,delayDuration:h$,onOpen:()=>{},onClose:()=>{}}),[m$,tu]=d0("Tooltip"),v$=e=>{const{__scopeTooltip:t,children:r,open:i,defaultOpen:s=!1,onOpenChange:a,delayDuration:u}=e,l=g$("Tooltip",t),f=Lf(t),[p,m]=$.useState(null),d=fy(),g=$.useRef(0),y=u??l.delayDuration,x=$.useRef(!1),{onOpen:h,onClose:w}=l,[v=!1,S]=Ey({prop:i,defaultProp:s,onChange:C=>{C&&(document.dispatchEvent(new CustomEvent("tooltip.open")),h()),a==null||a(C)}}),E=$.useMemo((()=>v?x.current?"delayed-open":"instant-open":"closed"),[v]),R=$.useCallback((()=>{window.clearTimeout(g.current),x.current=!1,S(!0)}),[S]),T=$.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{x.current=!0,S(!0)}),y)}),[y,S]);return $.useEffect((()=>()=>window.clearTimeout(g.current)),[]),$.createElement(wy,f,$.createElement(m$,{scope:t,contentId:d,open:v,stateAttribute:E,trigger:p,onTriggerChange:m,onTriggerEnter:$.useCallback((()=>{l.isOpenDelayed?T():R()}),[l.isOpenDelayed,T,R]),onOpen:$.useCallback(R,[R]),onClose:$.useCallback((()=>{window.clearTimeout(g.current),S(!1),w()}),[S,w])},r))},y$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,...i}=e,s=tu("TooltipTrigger",r),a=Lf(r),u=Rn(t,s.onTriggerChange),l=$.useRef(!1),f=$.useCallback((()=>l.current=!1),[]);return $.useEffect((()=>()=>document.removeEventListener("mouseup",f)),[f]),$.createElement(xy,rt({asChild:!0},a),$.createElement(Pn.button,rt({"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute},i,{ref:u,onMouseEnter:Zt(e.onMouseEnter,s.onTriggerEnter),onMouseLeave:Zt(e.onMouseLeave,s.onClose),onMouseDown:Zt(e.onMouseDown,(()=>{s.onClose(),l.current=!0,document.addEventListener("mouseup",f,{once:!0})})),onFocus:Zt(e.onFocus,(()=>{l.current||s.onOpen()})),onBlur:Zt(e.onBlur,s.onClose),onClick:Zt(e.onClick,(p=>{p.detail===0&&s.onClose()}))})))})),b$=$.forwardRef(((e,t)=>{const{forceMount:r,...i}=e,s=tu("TooltipContent",e.__scopeTooltip);return $.createElement(df,{present:r||s.open},$.createElement(w$,rt({ref:t},i)))})),w$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,children:i,"aria-label":s,portalled:a=!0,...u}=e,l=tu("TooltipContent",r),f=Lf(r),p=a?pf:$.Fragment,{onClose:m}=l;return gy((()=>m())),$.useEffect((()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m))),[m]),$.createElement(p,null,$.createElement(x$,{__scopeTooltip:r}),$.createElement(Sy,rt({"data-state":l.stateAttribute},f,u,{ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),$.createElement(hy,null,i),$.createElement(p$,{id:l.contentId,role:"tooltip"},s||i)))}));function x$(e){const{__scopeTooltip:t}=e,r=tu("CheckTriggerMoved",t),i=vy(r.trigger),s=i==null?void 0:i.left,a=Um(s),u=i==null?void 0:i.top,l=Um(u),f=r.onClose;return $.useEffect((()=>{(a!==void 0&&a!==s||l!==void 0&&l!==u)&&f()}),[f,a,l,s,u]),null}const S$=v$,E$=y$,_$=b$;function T$(e){const t=M.isValidElement(e.children)?M.Children.only(e.children):I.jsx("span",{className:"inline-flex",children:e.children});return I.jsxs(S$,{delayDuration:e.delayDuration,open:e.open,children:[I.jsx(E$,{tabIndex:-1,asChild:!0,children:t}),I.jsxs(_$,{portalled:!0,side:e.side,sideOffset:e.sideOffset,alignOffset:e.alignOffset,className:Be("z-[1000] max-w-[240px] rounded-md bg-primary-light px-2 py-1 text-s font-semibold text-primary-dark shadow-md"),children:[typeof e.message=="string"&&I.jsx("p",{children:e.message}),typeof e.message!="string"&&e.message]})]})}const Pr=30,p0=.3,h0=.6,O$=()=>typeof window>"u"?400:Math.round(window.innerHeight*p0),g0=()=>typeof window>"u"?600:Math.round(window.innerHeight*h0),qm=e=>{const t=g0();return Math.min(Math.max(e,Pr),t)},A$=()=>I.jsx("div",{className:"h-2 w-full bg-opacity-40 hover:bg-primary-hover"}),R$=e=>{const[t,r]=M.useState(Pr),i=M.useRef(),s=M.useRef(null),a=g0(),u=O$(),l=t>Pr;M.useEffect(()=>{r(e.isOpen?u:Pr)},[e.isOpen,u]),M.useEffect(()=>{const p=()=>{r(m=>m<=Pr?Pr:qm(m))};return window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p),s.current&&cancelAnimationFrame(s.current)}},[]);const f=()=>{if(l){r(Pr),e.onClose();return}r(u),e.onOpen()};return I.jsx("div",{className:"relative w-full select-none isolate",style:{zIndex:49},children:I.jsx(AO.Resizable,{enable:{top:!0,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},className:"w-full select-none border-t border-grey-900 bg-grey-800",size:{height:t,width:"100%"},maxHeight:a,minHeight:Pr,onResizeStart:()=>{i.current&&Date.now()-i.current<200?r(l?Pr:u):i.current=Date.now()},onResize:(p,m,d)=>{s.current&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{var g;(g=e.onResize)==null||g.call(e),s.current=null})},onResizeStop:(p,m,d,g)=>{r(y=>qm(y+g.height))},handleComponent:{top:I.jsx(A$,{})},children:I.jsxs("div",{"data-cy":"contextualPanel",className:"absolute inset-0 flex flex-col overflow-hidden",id:`__cp-${Ie.kebabCase(e.path)}`,children:[I.jsxs("div",{className:Be("flex justify-between items-center px-3 py-0.5",{"flex-1":!l}),children:[I.jsxs("div",{className:"group flex items-center justify-start",children:[I.jsx("span",{className:"mr-2 text-sm text-fd-gray-lighter",children:"Contextual panel"}),e.tipKey?I.jsx(Dy,{tipKey:e.tipKey,alwaysOn:!0,asButton:!0}):null,I.jsx("button",{"data-cy":`contextualPanel-toggle-button-${l?"close":"open"}`,className:"rounded p-1 text-white hover:bg-primary-hover focus:outline-none",onClick:f,children:l?I.jsx(Qe.FdDoubleArrowDown,{className:"h-4 w-4 text-white"}):I.jsx(Qe.FdDoubleArrowUp,{className:"h-4 w-4 text-white"})})]}),e.headerRightSide]}),I.jsxs(va,{of:l,children:[I.jsx(va,{of:e.render,children:e.render}),I.jsx(va,{of:!e.render,children:e.children})]})]})})})};function m0({children:e,viewBox:t="0 0 24 24",...r}){return I.jsx("svg",{viewBox:t,width:"1em",height:"1em",fill:"none",className:"base-icon",...Ie.omit(r,"isIndeterminate","isChecked"),children:e})}function v0(e){const t=e.isIndeterminate?"M2 12h20":"M4 11.5L9 17L20 6";return I.jsx(m0,{viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",d:t})})}function P$({isChecked:e,isIndeterminate:t,isInvalid:r,icon:i,label:s,className:a="",style:u,...l}){const f=M.useRef(null),p=i||I.jsx(v0,{}),m=l.checked??e;M.useEffect(()=>{f.current&&(f.current.indeterminate=!!t)},[t]);const d=m||t,g=["base-checkbox-container",a].join(" ");return I.jsxs("label",{className:g,style:u,"data-invalid":r,children:[I.jsx("input",{ref:f,type:"checkbox",className:"base-checkbox-input",checked:m,...l,"aria-invalid":r||void 0}),I.jsx("span",{className:"base-checkbox-control",children:d&&p&&M.cloneElement(p,{isChecked:m,isIndeterminate:t,className:"base-checkbox-icon"})}),s&&I.jsx("span",{className:"base-checkbox-label",children:s})]})}const C$=M.forwardRef(({label:e,Icon:t,as:r="button",className:i="",disableHover:s=!1,iconClassname:a,...u},l)=>{const[f,p]=M.useState(null),[m,d]=M.useState(!1);return M.useImperativeHandle(l,()=>f,[f]),I.jsxs(I.Fragment,{children:[I.jsx(r,{ref:p,className:Be("rounded p-1 text-white focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",{"hover:bg-primary-hover":!s},i),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseDown:()=>d(!1),...u,children:I.jsx(t,{className:Be("h-4 w-4",a)})}),m&&Qn.createPortal(I.jsx(u0,{label:e,referenceElement:f}),document.body)]})}),k$=({onChange:e,value:t,delay:r,placeholder:i,containerClassName:s,onFocusInput:a,icon:u,"data-cy":l})=>{const[f,p]=M.useState(t),m=M.useRef(null);return I.jsxs("div",{className:"w-full flex gap-x-1",children:[u&&I.jsx("button",{className:"mr-1 flex h-6 w-7 items-center justify-center text-xs rounded bg-grey-300 hover:bg-primary-hover",onClick:()=>{var d;return(d=m.current)==null?void 0:d.focus()},children:I.jsx("span",{className:`text-base fa ${u}`})}),I.jsxs("div",{className:Be("flex h-6 w-full rounded bg-grey-300 pl-1.5 pr-1 focus-within:outline-none focus-within:ring-[1px] focus-within:ring-primary-dark mb-1",s),children:[I.jsx("span",{className:"flex items-center justify-center",children:!u&&I.jsx(Qe.FdSearch,{className:"text-grey-100"})}),I.jsx("input",{ref:m,"data-cy":l||"search-cy",type:"text",className:"w-full rounded bg-grey-300 py-1.5 pl-1 pr-1 text-xs placeholder-grey-200 focus:outline-none focus:ring-0",placeholder:i||"Search",onChange:d=>{p(d.currentTarget.value);const g=Ie.escapeRegExp(d.target.value);if(!r)return e(g);Ie.debounce(e,r)(g)},value:f,onFocus:()=>a&&a(),onDrop:d=>d.preventDefault()}),t&&I.jsx("span",{onClick:()=>{e(""),p("")},className:"flex cursor-pointer items-center justify-center",children:I.jsx(Qe.FdCloseNaked,{})})]})]})},I$=({title:e="Invalid page structure",error:t,onClose:r,onOpenInTextEditor:i,onReset:s,resetButtonLabel:a="Reset Page"})=>I.jsx("div",{className:"flex h-full w-full items-center justify-center",children:I.jsxs("div",{className:"flex flex-col items-center rounded bg-grey-300 px-10 py-6 text-center shadow-md",children:[I.jsxs("div",{className:"relative",children:[I.jsx(Qe.FdSanityCheckDefault,{className:"relative z-20 h-12 w-12 text-red-500 rounded-full"}),I.jsx("div",{className:"w-1/2 h-1/2 absolute z-0 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white"})]}),I.jsx("p",{className:"mb-2 mt-4 text-2xl text-white",children:e}),I.jsx("p",{className:"text-md mb-4 font-extralight text-grey-100",children:t}),I.jsxs("div",{className:"flex gap-4",children:[i&&I.jsx("button",{className:"text-md rounded border border-primary-dark hover:border-primary-hover bg-primary-dark hover:bg-primary-hover px-3 py-1 text-white focus:outline-none",onClick:i,children:"Open in Text Editor"}),s&&I.jsx("button",{className:"text-md rounded border border-red-500 bg-red-500 hover:bg-red-400 focus:ring-red-500 px-3 py-1 text-white focus:outline-none",onClick:s,children:a}),r&&I.jsx("button",{className:"text-md rounded border border-grey-50 bg-transparent hover:bg-grey-50 text-white hover:text-primary-dark px-3 py-1 focus:outline-none",onClick:r,children:"Close"})]})]})});function _i(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function $$({rowGap:e,columnGap:t,templateColumns:r,templateRows:i,height:s,width:a,style:u,...l}){return I.jsx("div",{...l,style:{display:"grid",rowGap:_i(e),columnGap:_i(t),gridTemplateColumns:r,gridTemplateRows:i,height:_i(s),width:_i(a),...u}})}function L$({colStart:e,colSpan:t,rowStart:r,rowSpan:i,sx:s,style:a,...u}){return I.jsx("div",{...u,style:{gridColumnStart:e,gridColumnEnd:t?`span ${t}`:void 0,gridRowStart:r,gridRowEnd:i?`span ${i}`:void 0,...s,...a}})}function M$({columns:e=1,spacingX:t,spacingY:r,style:i,...s}){return I.jsx("div",{...s,style:{display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,columnGap:_i(t),rowGap:_i(r),...i}})}const y0=M.forwardRef(({fallback:e=null,onError:t,onLoad:r,src:i,style:s,...a},u)=>{const[l,f]=M.useState(!1);return M.useEffect(()=>{f(!1)},[i]),!i||l?I.jsx(I.Fragment,{children:e}):I.jsx("img",{...a,ref:u,src:i,style:s,onLoad:p=>{f(!1),r==null||r(p)},onError:p=>{f(!0),t==null||t(p)}})});y0.displayName="Image";function D$(e,t){const r=M.useRef(!1);M.useEffect(()=>{if(r.current)return e();r.current=!0},t)}const cc=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function fc(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),r)}function Eo(e,t,r,i){e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent&&e.detachEvent("on".concat(t),r)}function b0(e,t){const r=t.slice(0,t.length-1);for(let i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function w0(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function N$(e,t){const r=e.length>=t.length?e:t,i=e.length>=t.length?t:e;let s=!0;for(let a=0;a<r.length;a++)i.indexOf(r[a])===-1&&(s=!1);return s}const zo={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":cc?173:189,"=":cc?61:187,";":cc?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},xr={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},Ao={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},bt={16:!1,18:!1,17:!1,91:!1},tt={};for(let e=1;e<20;e++)zo["f".concat(e)]=111+e;let Je=[],Do=null,x0="all";const Xr=new Map,Di=e=>zo[e.toLowerCase()]||xr[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),F$=e=>Object.keys(zo).find(t=>zo[t]===e),j$=e=>Object.keys(xr).find(t=>xr[t]===e);function S0(e){x0=e||"all"}function Bo(){return x0||"all"}function z$(){return Je.slice(0)}function B$(){return Je.map(e=>F$(e)||j$(e)||String.fromCharCode(e))}function W$(){const e=[];return Object.keys(tt).forEach(t=>{tt[t].forEach(r=>{let{key:i,scope:s,mods:a,shortcut:u}=r;e.push({scope:s,shortcut:u,mods:a,keys:i.split("+").map(l=>Di(l))})})}),e}function H$(e){const t=e.target||e.srcElement,{tagName:r}=t;let i=!0;const s=r==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(s||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function U$(e){return typeof e=="string"&&(e=Di(e)),Je.indexOf(e)!==-1}function q$(e,t){let r,i;e||(e=Bo());for(const s in tt)if(Object.prototype.hasOwnProperty.call(tt,s))for(r=tt[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1).forEach(u=>{let{element:l}=u;return Mf(l)}):i++;Bo()===e&&S0(t||"all")}function G$(e){let t=e.keyCode||e.which||e.charCode;e.key&&e.key.toLowerCase()==="capslock"&&(t=Di(e.key));const r=Je.indexOf(t);if(r>=0&&Je.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&Je.splice(0,Je.length),(t===93||t===224)&&(t=91),t in bt){bt[t]=!1;for(const i in xr)xr[i]===t&&(br[i]=!1)}}function E0(e){if(typeof e>"u")Object.keys(tt).forEach(s=>{Array.isArray(tt[s])&&tt[s].forEach(a=>la(a)),delete tt[s]}),Mf(null);else if(Array.isArray(e))e.forEach(s=>{s.key&&la(s)});else if(typeof e=="object")e.key&&la(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];let[s,a]=r;typeof s=="function"&&(a=s,s=""),la({key:e,scope:s,method:a,splitKey:"+"})}}const la=e=>{let{key:t,scope:r,method:i,splitKey:s="+"}=e;w0(t).forEach(u=>{const l=u.split(s),f=l.length,p=l[f-1],m=p==="*"?"*":Di(p);if(!tt[m])return;r||(r=Bo());const d=f>1?b0(xr,l):[],g=[];tt[m]=tt[m].filter(y=>{const h=(i?y.method===i:!0)&&y.scope===r&&N$(y.mods,d);return h&&g.push(y.element),!h}),g.forEach(y=>Mf(y))})};function Gm(e,t,r,i){if(t.element!==i)return;let s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(const a in bt)Object.prototype.hasOwnProperty.call(bt,a)&&(!bt[a]&&t.mods.indexOf(+a)>-1||bt[a]&&t.mods.indexOf(+a)===-1)&&(s=!1);(t.mods.length===0&&!bt[16]&&!bt[18]&&!bt[17]&&!bt[91]||s||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(Je),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Zm(e,t){const r=tt["*"];let i=e.keyCode||e.which||e.charCode;if(e.key&&e.key.toLowerCase()==="capslock"||!br.filter.call(this,e))return;if((i===93||i===224)&&(i=91),Je.indexOf(i)===-1&&i!==229&&Je.push(i),["metaKey","ctrlKey","altKey","shiftKey"].forEach(l=>{const f=Ao[l];e[l]&&Je.indexOf(f)===-1?Je.push(f):!e[l]&&Je.indexOf(f)>-1?Je.splice(Je.indexOf(f),1):l==="metaKey"&&e[l]&&(Je=Je.filter(p=>p in Ao||p===i))}),i in bt){bt[i]=!0;for(const l in xr)if(Object.prototype.hasOwnProperty.call(xr,l)){const f=Ao[xr[l]];br[l]=e[f]}if(!r)return}for(const l in bt)Object.prototype.hasOwnProperty.call(bt,l)&&(bt[l]=e[Ao[l]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Je.indexOf(17)===-1&&Je.push(17),Je.indexOf(18)===-1&&Je.push(18),bt[17]=!0,bt[18]=!0);const s=Bo();if(r)for(let l=0;l<r.length;l++)r[l].scope===s&&(e.type==="keydown"&&r[l].keydown||e.type==="keyup"&&r[l].keyup)&&Gm(e,r[l],s,t);if(!(i in tt))return;const a=tt[i],u=a.length;for(let l=0;l<u;l++)if((e.type==="keydown"&&a[l].keydown||e.type==="keyup"&&a[l].keyup)&&a[l].key){const f=a[l],{splitKey:p}=f,m=f.key.split(p),d=[];for(let g=0;g<m.length;g++)d.push(Di(m[g]));d.sort().join("")===Je.sort().join("")&&Gm(e,f,s,t)}}function br(e,t,r){Je=[];const i=w0(e);let s=[],a="all",u=document,l=0,f=!1,p=!0,m="+",d=!1,g=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(u=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(p=t.keydown),t.capture!==void 0&&(d=t.capture),typeof t.splitKey=="string"&&(m=t.splitKey),t.single===!0&&(g=!0)),typeof t=="string"&&(a=t),g&&E0(e,a);l<i.length;l++)e=i[l].split(m),s=[],e.length>1&&(s=b0(xr,e)),e=e[e.length-1],e=e==="*"?"*":Di(e),e in tt||(tt[e]=[]),tt[e].push({keyup:f,keydown:p,scope:a,mods:s,shortcut:i[l],method:r,key:i[l],splitKey:m,element:u});if(typeof u<"u"&&window){if(!Xr.has(u)){const y=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Zm(h,u)},x=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Zm(h,u),G$(h)};Xr.set(u,{keydownListener:y,keyupListenr:x,capture:d}),fc(u,"keydown",y,d),fc(u,"keyup",x,d)}if(!Do){const y=()=>{Je=[]};Do={listener:y,capture:d},fc(window,"focus",y,d)}}}function Z$(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(tt).forEach(r=>{tt[r].filter(s=>s.scope===t&&s.shortcut===e).forEach(s=>{s&&s.method&&s.method()})})}function Mf(e){const t=Object.values(tt).flat();if(t.findIndex(i=>{let{element:s}=i;return s===e})<0){const{keydownListener:i,keyupListenr:s,capture:a}=Xr.get(e)||{};i&&s&&(Eo(e,"keyup",s,a),Eo(e,"keydown",i,a),Xr.delete(e))}if((t.length<=0||Xr.size<=0)&&(Object.keys(Xr).forEach(s=>{const{keydownListener:a,keyupListenr:u,capture:l}=Xr.get(s)||{};a&&u&&(Eo(s,"keyup",u,l),Eo(s,"keydown",a,l),Xr.delete(s))}),Xr.clear(),Object.keys(tt).forEach(s=>delete tt[s]),Do)){const{listener:s,capture:a}=Do;Eo(window,"focus",s,a),Do=null}}const dc={getPressedKeyString:B$,setScope:S0,getScope:Bo,deleteScope:q$,getPressedKeyCodes:z$,getAllKeyCodes:W$,isPressed:U$,filter:H$,trigger:Z$,unbind:E0,keyMap:zo,modifier:xr,modifierMap:Ao};for(const e in dc)Object.prototype.hasOwnProperty.call(dc,e)&&(br[e]=dc[e]);if(typeof window<"u"){const e=window.hotkeys;br.noConflict=t=>(t&&window.hotkeys===br&&(window.hotkeys=e),br),window.hotkeys=br}br.filter=()=>!0;function V$(e,t,r,i){r instanceof Array&&(i=r,r=void 0),i=i||[],r=r||{};const{preventDefault:s=!0}=r,a=M.useCallback((l,f)=>{s&&l.preventDefault(),setTimeout(()=>t(l,f))},i),u=()=>{br.unbind(e,a)};M.useEffect(()=>(br(e,r,a),u),[e,r,a])}const K$=(e,t="click")=>{const r=M.useRef(null);return M.useEffect(()=>{const i=s=>{r.current&&!r.current.contains(s.target)&&e(s)};return document.addEventListener(t,i,!0),()=>{document.removeEventListener(t,i,!0)}},[e,t]),r};function Y$(e){const t=M.useRef();return M.useEffect(()=>{t.current=e},[e]),t.current}function X$(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e},[e]),t}function J$(e){const t=M.useRef(null);return M.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t}function Q$(e){const[t,r]=M.useState(e),i=(a,u)=>{r(l=>({...l,features:{...l.features,[a]:{enabled:u}}}))},s=M.useCallback((...a)=>a.every(u=>{var l;return(l=t.features[u])==null?void 0:l.enabled}),[t.features]);return{setFeature:i,isFeatureEnabled:s}}const _0=M.createContext(""),eL=e=>I.jsx(_0.Provider,{value:e.value,children:e.children}),tL=()=>{const e=M.useContext(_0);if(typeof e!="string")throw new Error("Error while calling useIdentity! Context has incorrect type (expected string)");return e};function rL(e){const[t,r]=M.useState(e),i=M.useMemo(()=>nL(t,r),[]);return{state:t,actions:{...i,set:s=>{r(typeof s=="function"?s:a=>({...a,...s}))}}}}function nL(e,t=()=>{}){return Object.keys(e).reduce((i,s)=>({...i,[`set${Ie.upperFirst(s)}`]:a=>t(u=>({...u,[s]:a}))}),{})}const iL=(e,t,r={})=>{r={timeout:200,...r};const i=M.useRef(),s=()=>{i.current&&(clearTimeout(i.current),i.current=null)};return M.useCallback((a,...u)=>{s(),t&&a.detail===1&&(i.current=setTimeout(()=>{t(a,...u)},r.timeout)),a.detail%2===0&&e(a,...u)},[t,e,r.timeout])};function wt(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(process.env.NODE_ENV!=="production"){var s=fL[e],a=s?typeof s=="function"?s.apply(null,r):s:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(u){return"'"+u+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Li(e){return!!e&&!!e[Yt]}function Jn(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var i=Object.getPrototypeOf(r);if(i===null)return!0;var s=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return s===Object||typeof s=="function"&&Function.toString.call(s)===dL})(e)||Array.isArray(e)||!!e[tv]||!!(!((t=e.constructor)===null||t===void 0)&&t[tv])||Df(e)||Nf(e))}function Wo(e,t,r){r===void 0&&(r=!1),Ni(e)===0?(r?Object.keys:Bf)(e).forEach((function(i){r&&typeof i=="symbol"||t(i,e[i],e)})):e.forEach((function(i,s){return t(s,i,e)}))}function Ni(e){var t=e[Yt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Df(e)?2:Nf(e)?3:0}function jc(e,t){return Ni(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function oL(e,t){return Ni(e)===2?e.get(t):e[t]}function T0(e,t,r){var i=Ni(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function sL(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Df(e){return lL&&e instanceof Map}function Nf(e){return cL&&e instanceof Set}function Hn(e){return e.o||e.t}function Ff(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pL(e);delete t[Yt];for(var r=Bf(t),i=0;i<r.length;i++){var s=r[i],a=t[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Object.getPrototypeOf(e),t)}function Ho(e,t){return t===void 0&&(t=!1),jf(e)||Li(e)||!Jn(e)||(Ni(e)>1&&(e.set=e.add=e.clear=e.delete=aL),Object.freeze(e),t&&Wo(e,(function(r,i){return Ho(i,!0)}),!0)),e}function aL(){wt(2)}function jf(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Dr(e){var t=hL[e];return t||wt(18,e),t}function Vm(){return process.env.NODE_ENV==="production"||Mi||wt(0),Mi}function pc(e,t){t&&(Dr("Patches"),e.u=[],e.s=[],e.v=t)}function La(e){zc(e),e.p.forEach(uL),e.p=null}function zc(e){e===Mi&&(Mi=e.l)}function Km(e){return Mi={p:[],l:Mi,h:e,m:!0,_:0}}function uL(e){var t=e[Yt];t.i===0||t.i===1?t.j():t.g=!0}function hc(e,t){t._=t.p.length;var r=t.p[0],i=e!==void 0&&e!==r;return t.h.O||Dr("ES5").S(t,e,i),i?(r[Yt].P&&(La(t),wt(4)),Jn(e)&&(e=Ma(t,e),t.l||Da(t,e)),t.u&&Dr("Patches").M(r[Yt].t,e,t.u,t.s)):e=Ma(t,r,[]),La(t),t.u&&t.v(t.u,t.s),e!==A0?e:void 0}function Ma(e,t,r){if(jf(t))return t;var i=t[Yt];if(!i)return Wo(t,(function(l,f){return Ym(e,i,t,l,f,r)}),!0),t;if(i.A!==e)return t;if(!i.P)return Da(e,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var s=i.i===4||i.i===5?i.o=Ff(i.k):i.o,a=s,u=!1;i.i===3&&(a=new Set(s),s.clear(),u=!0),Wo(a,(function(l,f){return Ym(e,i,s,l,f,r,u)})),Da(e,s,!1),r&&e.u&&Dr("Patches").N(i,r,e.u,e.s)}return i.o}function Ym(e,t,r,i,s,a,u){if(process.env.NODE_ENV!=="production"&&s===r&&wt(5),Li(s)){var l=Ma(e,s,a&&t&&t.i!==3&&!jc(t.R,i)?a.concat(i):void 0);if(T0(r,i,l),!Li(l))return;e.m=!1}else u&&r.add(s);if(Jn(s)&&!jf(s)){if(!e.h.D&&e._<1)return;Ma(e,s),t&&t.A.l||Da(e,s)}}function Da(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Ho(t,r)}function gc(e,t){var r=e[Yt];return(r?Hn(r):e)[t]}function Xm(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Object.getPrototypeOf(r)}}function Bc(e){e.P||(e.P=!0,e.l&&Bc(e.l))}function mc(e){e.o||(e.o=Ff(e.t))}function Wc(e,t,r){var i=Df(t)?Dr("MapSet").F(t,r):Nf(t)?Dr("MapSet").T(t,r):e.O?(function(s,a){var u=Array.isArray(s),l={i:u?1:0,A:a?a.A:Vm(),P:!1,I:!1,R:{},l:a,t:s,k:null,o:null,j:null,C:!1},f=l,p=Hc;u&&(f=[l],p=Ro);var m=Proxy.revocable(f,p),d=m.revoke,g=m.proxy;return l.k=g,l.j=d,g})(t,r):Dr("ES5").J(t,r);return(r?r.A:Vm()).p.push(i),i}function O0(e){return Li(e)||wt(22,e),(function t(r){if(!Jn(r))return r;var i,s=r[Yt],a=Ni(r);if(s){if(!s.P&&(s.i<4||!Dr("ES5").K(s)))return s.t;s.I=!0,i=Jm(r,a),s.I=!1}else i=Jm(r,a);return Wo(i,(function(u,l){s&&oL(s.t,u)===l||T0(i,u,t(l))})),a===3?new Set(i):i})(e)}function Jm(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Ff(e)}var Qm,Mi,zf=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",lL=typeof Map<"u",cL=typeof Set<"u",ev=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",A0=zf?Symbol.for("immer-nothing"):((Qm={})["immer-nothing"]=!0,Qm),tv=zf?Symbol.for("immer-draftable"):"__$immer_draftable",Yt=zf?Symbol.for("immer-state"):"__$immer_state",fL={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},dL=""+Object.prototype.constructor,Bf=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pL=Object.getOwnPropertyDescriptors||function(e){var t={};return Bf(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},hL={},Hc={get:function(e,t){if(t===Yt)return e;var r=Hn(e);if(!jc(r,t))return(function(s,a,u){var l,f=Xm(a,u);return f?"value"in f?f.value:(l=f.get)===null||l===void 0?void 0:l.call(s.k):void 0})(e,r,t);var i=r[t];return e.I||!Jn(i)?i:i===gc(e.t,t)?(mc(e),e.o[t]=Wc(e.A.h,i,e)):i},has:function(e,t){return t in Hn(e)},ownKeys:function(e){return Reflect.ownKeys(Hn(e))},set:function(e,t,r){var i=Xm(Hn(e),t);if(i!=null&&i.set)return i.set.call(e.k,r),!0;if(!e.P){var s=gc(Hn(e),t),a=s==null?void 0:s[Yt];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(sL(r,s)&&(r!==void 0||jc(e.t,t)))return!0;mc(e),Bc(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return gc(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,mc(e),Bc(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Hn(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty:function(){wt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){wt(12)}},Ro={};Wo(Hc,(function(e,t){Ro[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ro.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&wt(13),Ro.set.call(this,e,t,void 0)},Ro.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&wt(14),Hc.set.call(this,e[0],t,r,e[0])};var gL=(function(){function e(r){var i=this;this.O=ev,this.D=!0,this.produce=function(s,a,u){if(typeof s=="function"&&typeof a!="function"){var l=a;a=s;var f=i;return function(h){var w=this;h===void 0&&(h=l);for(var v=arguments.length,S=Array(v>1?v-1:0),E=1;E<v;E++)S[E-1]=arguments[E];return f.produce(h,(function(R){var T;return(T=a).call.apply(T,[w,R].concat(S))}))}}var p;if(typeof a!="function"&&wt(6),u!==void 0&&typeof u!="function"&&wt(7),Jn(s)){var m=Km(i),d=Wc(i,s,void 0),g=!0;try{p=a(d),g=!1}finally{g?La(m):zc(m)}return typeof Promise<"u"&&p instanceof Promise?p.then((function(h){return pc(m,u),hc(h,m)}),(function(h){throw La(m),h})):(pc(m,u),hc(p,m))}if(!s||typeof s!="object"){if((p=a(s))===void 0&&(p=s),p===A0&&(p=void 0),i.D&&Ho(p,!0),u){var y=[],x=[];Dr("Patches").M(s,p,y,x),u(y,x)}return p}wt(21,s)},this.produceWithPatches=function(s,a){if(typeof s=="function")return function(p){for(var m=arguments.length,d=Array(m>1?m-1:0),g=1;g<m;g++)d[g-1]=arguments[g];return i.produceWithPatches(p,(function(y){return s.apply(void 0,[y].concat(d))}))};var u,l,f=i.produce(s,a,(function(p,m){u=p,l=m}));return typeof Promise<"u"&&f instanceof Promise?f.then((function(p){return[p,u,l]})):[f,u,l]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){Jn(r)||wt(8),Li(r)&&(r=O0(r));var i=Km(this),s=Wc(this,r,void 0);return s[Yt].C=!0,zc(i),s},t.finishDraft=function(r,i){var s=r&&r[Yt];process.env.NODE_ENV!=="production"&&(s&&s.C||wt(9),s.I&&wt(10));var a=s.A;return pc(a,i),hc(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!ev&&wt(20),this.O=r},t.applyPatches=function(r,i){var s;for(s=i.length-1;s>=0;s--){var a=i[s];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}s>-1&&(i=i.slice(s+1));var u=Dr("Patches").$;return Li(r)?u(r,i):this.produce(r,(function(l){return u(l,i)}))},e})(),Xt=new gL,mL=Xt.produce;Xt.produceWithPatches.bind(Xt);Xt.setAutoFreeze.bind(Xt);Xt.setUseProxies.bind(Xt);Xt.applyPatches.bind(Xt);Xt.createDraft.bind(Xt);Xt.finishDraft.bind(Xt);function vL(e){var t=M.useState(function(){return Ho(typeof e=="function"?e():e,!0)}),r=t[1];return[t[0],M.useCallback(function(i){r(typeof i=="function"?mL(i):Ho(i))},[])]}const yL=process.env.NODE_ENV==="development",vc=yL&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:null,bL=(e,t,r)=>{const[i,s]=vL(e),a=M.useRef(null);M.useEffect(()=>{var f;return r&&(a.current=vc==null?void 0:vc.connect({name:r,trace:!0}),(f=a.current)==null||f.init(e)),()=>{var p,m;(m=(p=a.current)==null?void 0:p.disconnect)==null||m.call(p)}},[]);const u=t&&typeof t=="object"?t:{},l=M.useMemo(()=>Object.keys(u).reduce((f,p)=>({...f,[p]:m=>(s(d=>{var g;u[p](d,m),(g=a.current)==null||g.send({type:u[p].name},O0(d))}),l)}),{}),[s]);return{state:i,dispatch:l}},wL=e=>{const t=td(e),r=()=>{const{id:i,namespace:s}=t,a=window.DataSource.spaces[s];if(a&&a.sources)return a.sources[i]};return{actions:{setProperty:(i,s)=>{try{const a=r();a&&a.setValue(i,s)}catch{}},getValue:()=>r()}}},xL=({datasourceId:e,isDsBuild:t=!1,onChange:r})=>{const{id:i,namespace:s}=td(e),[a,u]=M.useState(!1),l=M.useCallback(()=>{try{return window.DataSource.getSource(i,s)}catch{return}},[s,i]),f=(d,g)=>{const y=l();y&&y.setValue(d,g)},p=async()=>{const d=l();if(!d)return;const g=await(d==null?void 0:d.getValue());r==null||r(g)},m=d=>{const{id:g}=d;!a&&g&&g.startsWith(i)&&u(!0)};return M.useEffect(()=>{if(a){const d=l();return d?(d==null||d.addListener("changed",p),()=>d==null?void 0:d.removeListener("changed",p)):void 0}},[a]),M.useEffect(()=>{if(t)return window.addEventListener("datasource:created",m),()=>window.removeEventListener("datasource:created",m)},[t]),{loaded:a,setCurrentSource:f}};function SL(e=!1){const[t,r]=M.useState(e),i=M.useMemo(()=>({on:()=>r(!0),off:()=>r(!1),toggle:()=>r(s=>!s)}),[]);return[t,i]}function EL(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useCallback((...r)=>{var i;return(i=t.current)==null?void 0:i.call(t,...r)},[])}function R0(e,t){const r=e!==void 0;return[r,r?e:t]}function _L({value:e,defaultValue:t,onChange:r}){const[i,s]=M.useState(t),[a,u]=R0(e,i),l=M.useCallback(f=>{const p=typeof f=="function"?f(u):f;a||s(p),p!==u&&(r==null||r(p))},[u,a,r]);return[u,l]}const TL=typeof window<"u"?M.useLayoutEffect:M.useEffect;function OL(e,t){const r=M.useRef(!1);M.useEffect(()=>{if(!r.current){r.current=!0;return}return e()},t)}function AL(e){return{...e,isDisabled:e.isDisabled??e.disabled,isReadOnly:e.isReadOnly??e.readOnly,isRequired:e.isRequired??e.required}}function en(e){return typeof e=="function"}function P0(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var yc=P0(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
201
|
+
}`;var Te=Dh(function(){return Le(A,le+"return "+ee).apply(r,P)});if(Te.source=ee,bl(Te))throw Te;return Te}function IT(n){return Ne(n).toLowerCase()}function $T(n){return Ne(n).toUpperCase()}function LT(n,o,c){if(n=Ne(n),n&&(c||o===r))return Ud(n);if(!n||!(o=Wt(o)))return n;var b=fr(n),_=fr(o),A=qd(b,_),P=Gd(b,_)+1;return mn(b,A,P).join("")}function MT(n,o,c){if(n=Ne(n),n&&(c||o===r))return n.slice(0,Vd(n)+1);if(!n||!(o=Wt(o)))return n;var b=fr(n),_=Gd(b,fr(o))+1;return mn(b,0,_).join("")}function DT(n,o,c){if(n=Ne(n),n&&(c||o===r))return n.replace(bu,"");if(!n||!(o=Wt(o)))return n;var b=fr(n),_=qd(b,fr(o));return mn(b,_).join("")}function NT(n,o){var c=j,b=D;if(et(o)){var _="separator"in o?o.separator:_;c="length"in o?Ee(o.length):c,b="omission"in o?Wt(o.omission):b}n=Ne(n);var A=n.length;if(si(n)){var P=fr(n);A=P.length}if(c>=A)return n;var L=c-ai(b);if(L<1)return b;var B=P?mn(P,0,L).join(""):n.slice(0,L);if(_===r)return B+b;if(P&&(L+=B.length-L),wl(_)){if(n.slice(L).search(_)){var K,Y=B;for(_.global||(_=Du(_.source,Ne(dd.exec(_))+"g")),_.lastIndex=0;K=_.exec(Y);)var ee=K.index;B=B.slice(0,ee===r?L:ee)}}else if(n.indexOf(Wt(_),L)!=L){var se=B.lastIndexOf(_);se>-1&&(B=B.slice(0,se))}return B+b}function FT(n){return n=Ne(n),n&&Xb.test(n)?n.replace(ud,h1):n}var jT=hi(function(n,o,c){return n+(c?" ":"")+o.toUpperCase()}),_l=Dp("toUpperCase");function Mh(n,o,c){return n=Ne(n),o=c?r:o,o===r?l1(n)?v1(n):e1(n):n.match(o)||[]}var Dh=Ae(function(n,o){try{return jt(n,r,o)}catch(c){return bl(c)?c:new be(c)}}),zT=qr(function(n,o){return zt(o,function(c){c=pr(c),Er(n,c,vl(n[c],n))}),n});function BT(n){var o=n==null?0:n.length,c=ge();return n=o?Ye(n,function(b){if(typeof b[1]!="function")throw new Qt(u);return[c(b[0]),b[1]]}):[],Ae(function(b){for(var _=-1;++_<o;){var A=n[_];if(jt(A[0],this,b))return jt(A[1],this,b)}})}function WT(n){return hx(tr(n,g))}function Tl(n){return function(){return n}}function HT(n,o){return n==null||n!==n?o:n}var UT=Fp(),qT=Fp(!0);function Mt(n){return n}function Ol(n){return hp(typeof n=="function"?n:tr(n,g))}function GT(n){return mp(tr(n,g))}function ZT(n,o){return vp(n,tr(o,g))}var VT=Ae(function(n,o){return function(c){return Gi(c,n,o)}}),KT=Ae(function(n,o){return function(c){return Gi(n,c,o)}});function Al(n,o,c){var b=pt(o),_=As(o,b);c==null&&!(et(o)&&(_.length||!b.length))&&(c=o,o=n,n=this,_=As(o,pt(o)));var A=!(et(c)&&"chain"in c)||!!c.chain,P=Zr(n);return zt(_,function(L){var B=o[L];n[L]=B,P&&(n.prototype[L]=function(){var K=this.__chain__;if(A||K){var Y=n(this.__wrapped__),ee=Y.__actions__=It(this.__actions__);return ee.push({func:B,args:arguments,thisArg:n}),Y.__chain__=K,Y}return B.apply(n,cn([this.value()],arguments))})}),n}function YT(){return gt._===this&&(gt._=E1),this}function Rl(){}function XT(n){return n=Ee(n),Ae(function(o){return yp(o,n)})}var JT=il(Ye),QT=il(jd),eO=il(Pu);function Nh(n){return fl(n)?Cu(pr(n)):kx(n)}function tO(n){return function(o){return n==null?r:Dn(n,o)}}var rO=zp(),nO=zp(!0);function Pl(){return[]}function Cl(){return!1}function iO(){return{}}function oO(){return""}function sO(){return!0}function aO(n,o){if(n=Ee(n),n<1||n>ce)return[];var c=ne,b=Et(n,ne);o=ge(o),n-=ne;for(var _=$u(b,o);++c<n;)o(c);return _}function uO(n){return Se(n)?Ye(n,pr):Ht(n)?[n]:It(rh(Ne(n)))}function lO(n){var o=++x1;return Ne(n)+o}var cO=$s(function(n,o){return n+o},0),fO=ol("ceil"),dO=$s(function(n,o){return n/o},1),pO=ol("floor");function hO(n){return n&&n.length?Os(n,Mt,Uu):r}function gO(n,o){return n&&n.length?Os(n,ge(o,2),Uu):r}function mO(n){return Wd(n,Mt)}function vO(n,o){return Wd(n,ge(o,2))}function yO(n){return n&&n.length?Os(n,Mt,Vu):r}function bO(n,o){return n&&n.length?Os(n,ge(o,2),Vu):r}var wO=$s(function(n,o){return n*o},1),xO=ol("round"),SO=$s(function(n,o){return n-o},0);function EO(n){return n&&n.length?Iu(n,Mt):0}function _O(n,o){return n&&n.length?Iu(n,ge(o,2)):0}return O.after=ZE,O.ary=ph,O.assign=L_,O.assignIn=Ah,O.assignInWith=Rh,O.assignWith=xl,O.at=M_,O.before=hh,O.bind=vl,O.bindAll=zT,O.bindKey=gh,O.castArray=o_,O.chain=ch,O.chunk=hS,O.compact=gS,O.concat=mS,O.cond=BT,O.conforms=WT,O.constant=Tl,O.countBy=_E,O.create=D_,O.curry=mh,O.curryRight=vh,O.debounce=yh,O.defaults=N_,O.defaultsDeep=F_,O.defer=VE,O.delay=KE,O.difference=vS,O.differenceBy=yS,O.differenceWith=bS,O.drop=wS,O.dropRight=xS,O.dropRightWhile=SS,O.dropWhile=ES,O.fill=_S,O.filter=OE,O.flatMap=PE,O.flatMapDeep=CE,O.flatMapDepth=kE,O.flatten=sh,O.flattenDeep=TS,O.flattenDepth=OS,O.flip=YE,O.flow=UT,O.flowRight=qT,O.fromPairs=AS,O.functions=q_,O.functionsIn=G_,O.groupBy=IE,O.initial=PS,O.intersection=CS,O.intersectionBy=kS,O.intersectionWith=IS,O.invert=V_,O.invertBy=K_,O.invokeMap=LE,O.iteratee=Ol,O.keyBy=ME,O.keys=pt,O.keysIn=Lt,O.map=zs,O.mapKeys=X_,O.mapValues=J_,O.matches=GT,O.matchesProperty=ZT,O.memoize=Ws,O.merge=Q_,O.mergeWith=Ph,O.method=VT,O.methodOf=KT,O.mixin=Al,O.negate=Hs,O.nthArg=XT,O.omit=eT,O.omitBy=tT,O.once=XE,O.orderBy=DE,O.over=JT,O.overArgs=JE,O.overEvery=QT,O.overSome=eO,O.partial=yl,O.partialRight=bh,O.partition=NE,O.pick=rT,O.pickBy=Ch,O.property=Nh,O.propertyOf=tO,O.pull=DS,O.pullAll=uh,O.pullAllBy=NS,O.pullAllWith=FS,O.pullAt=jS,O.range=rO,O.rangeRight=nO,O.rearg=QE,O.reject=zE,O.remove=zS,O.rest=e_,O.reverse=gl,O.sampleSize=WE,O.set=iT,O.setWith=oT,O.shuffle=HE,O.slice=BS,O.sortBy=GE,O.sortedUniq=VS,O.sortedUniqBy=KS,O.split=RT,O.spread=t_,O.tail=YS,O.take=XS,O.takeRight=JS,O.takeRightWhile=QS,O.takeWhile=eE,O.tap=gE,O.throttle=r_,O.thru=js,O.toArray=_h,O.toPairs=kh,O.toPairsIn=Ih,O.toPath=uO,O.toPlainObject=Oh,O.transform=sT,O.unary=n_,O.union=tE,O.unionBy=rE,O.unionWith=nE,O.uniq=iE,O.uniqBy=oE,O.uniqWith=sE,O.unset=aT,O.unzip=ml,O.unzipWith=lh,O.update=uT,O.updateWith=lT,O.values=vi,O.valuesIn=cT,O.without=aE,O.words=Mh,O.wrap=i_,O.xor=uE,O.xorBy=lE,O.xorWith=cE,O.zip=fE,O.zipObject=dE,O.zipObjectDeep=pE,O.zipWith=hE,O.entries=kh,O.entriesIn=Ih,O.extend=Ah,O.extendWith=Rh,Al(O,O),O.add=cO,O.attempt=Dh,O.camelCase=hT,O.capitalize=$h,O.ceil=fO,O.clamp=fT,O.clone=s_,O.cloneDeep=u_,O.cloneDeepWith=l_,O.cloneWith=a_,O.conformsTo=c_,O.deburr=Lh,O.defaultTo=HT,O.divide=dO,O.endsWith=gT,O.eq=hr,O.escape=mT,O.escapeRegExp=vT,O.every=TE,O.find=AE,O.findIndex=ih,O.findKey=j_,O.findLast=RE,O.findLastIndex=oh,O.findLastKey=z_,O.floor=pO,O.forEach=fh,O.forEachRight=dh,O.forIn=B_,O.forInRight=W_,O.forOwn=H_,O.forOwnRight=U_,O.get=Sl,O.gt=f_,O.gte=d_,O.has=Z_,O.hasIn=El,O.head=ah,O.identity=Mt,O.includes=$E,O.indexOf=RS,O.inRange=dT,O.invoke=Y_,O.isArguments=jn,O.isArray=Se,O.isArrayBuffer=p_,O.isArrayLike=$t,O.isArrayLikeObject=it,O.isBoolean=h_,O.isBuffer=vn,O.isDate=g_,O.isElement=m_,O.isEmpty=v_,O.isEqual=y_,O.isEqualWith=b_,O.isError=bl,O.isFinite=w_,O.isFunction=Zr,O.isInteger=wh,O.isLength=Us,O.isMap=xh,O.isMatch=x_,O.isMatchWith=S_,O.isNaN=E_,O.isNative=__,O.isNil=O_,O.isNull=T_,O.isNumber=Sh,O.isObject=et,O.isObjectLike=nt,O.isPlainObject=Ji,O.isRegExp=wl,O.isSafeInteger=A_,O.isSet=Eh,O.isString=qs,O.isSymbol=Ht,O.isTypedArray=mi,O.isUndefined=R_,O.isWeakMap=P_,O.isWeakSet=C_,O.join=$S,O.kebabCase=yT,O.last=nr,O.lastIndexOf=LS,O.lowerCase=bT,O.lowerFirst=wT,O.lt=k_,O.lte=I_,O.max=hO,O.maxBy=gO,O.mean=mO,O.meanBy=vO,O.min=yO,O.minBy=bO,O.stubArray=Pl,O.stubFalse=Cl,O.stubObject=iO,O.stubString=oO,O.stubTrue=sO,O.multiply=wO,O.nth=MS,O.noConflict=YT,O.noop=Rl,O.now=Bs,O.pad=xT,O.padEnd=ST,O.padStart=ET,O.parseInt=_T,O.random=pT,O.reduce=FE,O.reduceRight=jE,O.repeat=TT,O.replace=OT,O.result=nT,O.round=xO,O.runInContext=z,O.sample=BE,O.size=UE,O.snakeCase=AT,O.some=qE,O.sortedIndex=WS,O.sortedIndexBy=HS,O.sortedIndexOf=US,O.sortedLastIndex=qS,O.sortedLastIndexBy=GS,O.sortedLastIndexOf=ZS,O.startCase=PT,O.startsWith=CT,O.subtract=SO,O.sum=EO,O.sumBy=_O,O.template=kT,O.times=aO,O.toFinite=Vr,O.toInteger=Ee,O.toLength=Th,O.toLower=IT,O.toNumber=ir,O.toSafeInteger=$_,O.toString=Ne,O.toUpper=$T,O.trim=LT,O.trimEnd=MT,O.trimStart=DT,O.truncate=NT,O.unescape=FT,O.uniqueId=lO,O.upperCase=jT,O.upperFirst=_l,O.each=fh,O.eachRight=dh,O.first=ah,Al(O,(function(){var n={};return _r(O,function(o,c){De.call(O.prototype,c)||(n[c]=o)}),n})(),{chain:!1}),O.VERSION=i,zt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){O[n].placeholder=O}),zt(["drop","take"],function(n,o){Pe.prototype[n]=function(c){c=c===r?1:ft(Ee(c),0);var b=this.__filtered__&&!o?new Pe(this):this.clone();return b.__filtered__?b.__takeCount__=Et(c,b.__takeCount__):b.__views__.push({size:Et(c,ne),type:n+(b.__dir__<0?"Right":"")}),b},Pe.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),zt(["filter","map","takeWhile"],function(n,o){var c=o+1,b=c==k||c==J;Pe.prototype[n]=function(_){var A=this.clone();return A.__iteratees__.push({iteratee:ge(_,3),type:c}),A.__filtered__=A.__filtered__||b,A}}),zt(["head","last"],function(n,o){var c="take"+(o?"Right":"");Pe.prototype[n]=function(){return this[c](1).value()[0]}}),zt(["initial","tail"],function(n,o){var c="drop"+(o?"":"Right");Pe.prototype[n]=function(){return this.__filtered__?new Pe(this):this[c](1)}}),Pe.prototype.compact=function(){return this.filter(Mt)},Pe.prototype.find=function(n){return this.filter(n).head()},Pe.prototype.findLast=function(n){return this.reverse().find(n)},Pe.prototype.invokeMap=Ae(function(n,o){return typeof n=="function"?new Pe(this):this.map(function(c){return Gi(c,n,o)})}),Pe.prototype.reject=function(n){return this.filter(Hs(ge(n)))},Pe.prototype.slice=function(n,o){n=Ee(n);var c=this;return c.__filtered__&&(n>0||o<0)?new Pe(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),o!==r&&(o=Ee(o),c=o<0?c.dropRight(-o):c.take(o-n)),c)},Pe.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Pe.prototype.toArray=function(){return this.take(ne)},_r(Pe.prototype,function(n,o){var c=/^(?:filter|find|map|reject)|While$/.test(o),b=/^(?:head|last)$/.test(o),_=O[b?"take"+(o=="last"?"Right":""):o],A=b||/^find/.test(o);_&&(O.prototype[o]=function(){var P=this.__wrapped__,L=b?[1]:arguments,B=P instanceof Pe,K=L[0],Y=B||Se(P),ee=function(Re){var Ce=_.apply(O,cn([Re],L));return b&&se?Ce[0]:Ce};Y&&c&&typeof K=="function"&&K.length!=1&&(B=Y=!1);var se=this.__chain__,le=!!this.__actions__.length,me=A&&!se,Te=B&&!le;if(!A&&Y){P=Te?P:new Pe(this);var pe=n.apply(P,L);return pe.__actions__.push({func:js,args:[ee],thisArg:r}),new er(pe,se)}return me&&Te?n.apply(this,L):(pe=this.thru(ee),me?b?pe.value()[0]:pe.value():pe)})}),zt(["pop","push","shift","sort","splice","unshift"],function(n){var o=fs[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",b=/^(?:pop|shift)$/.test(n);O.prototype[n]=function(){var _=arguments;if(b&&!this.__chain__){var A=this.value();return o.apply(Se(A)?A:[],_)}return this[c](function(P){return o.apply(Se(P)?P:[],_)})}}),_r(Pe.prototype,function(n,o){var c=O[o];if(c){var b=c.name+"";De.call(fi,b)||(fi[b]=[]),fi[b].push({name:o,func:c})}}),fi[Is(r,S).name]=[{name:"wrapper",func:r}],Pe.prototype.clone=j1,Pe.prototype.reverse=z1,Pe.prototype.value=B1,O.prototype.at=mE,O.prototype.chain=vE,O.prototype.commit=yE,O.prototype.next=bE,O.prototype.plant=xE,O.prototype.reverse=SE,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=EE,O.prototype.first=O.prototype.head,ji&&(O.prototype[ji]=wE),O}),ui=y1();kn?((kn.exports=ui)._=ui,Tu._=ui):gt._=ui}).call(o$)})(Oo,Oo.exports)),Oo.exports}var Ie=s$();const Fc={FdSave:Qe.FdSave,FdWarningDanger:Qe.FdWarningDanger,FdInfoCircle:Qe.FdInfoCircle,FdInfoBold:Qe.FdInfoBold};var $f=(e=>(e.ALERT="alert",e.CONFIRM="confirm",e))($f||{}),Vn=(e=>(e.PRIMARY="primary",e.WARNING="warning",e.DANGER="danger",e))(Vn||{}),Ei=(e=>(e.CONFIRMED="confirmed",e.CANCELED="canceled",e))(Ei||{});const c0={[Vn.PRIMARY]:{icon:"blue-500",button:"primary-dark"},[Vn.DANGER]:{icon:"red-500",button:"primary-dark"},[Vn.WARNING]:{icon:"yellow-400",button:"primary-dark"}},lc=({color:e=Vn.PRIMARY,variant:t="solid",children:r,autoFocus:i,...s})=>{const a=c0[e].button,u=t==="outlined"?`bg-transparent text-white border border-white hover:border-white hover:bg-white hover:text-${a}`:`text-white bg-${a} border border-${a} hover:border-white hover:bg-primary-hover hover:text-white`;return I.jsx("button",{autoFocus:i,className:Be("w-16 rounded px-2 py-1 text-xs font-medium hover:font-bold focus:outline-none",u),...s,children:r})},a$=({name:e,color:t=Vn.PRIMARY,className:r="w-8 h-8"})=>{const i=Fc[e]||Fc.FdInfoCircle,s=`text-${c0[t].icon}`;return I.jsx(i,{className:Be(r,s)})},u$=({id:e,title:t,message:r,icon:i,type:s,color:a,zIndex:u=3e3,views:l,width:f=520,hasOverlay:p=!0,container:m,onClose:d,onEdit:g})=>{const y=w=>{d({id:e,reason:w})};M.useEffect(()=>{function w(v){v.key==="Escape"&&y(Ei.CANCELED)}return window.addEventListener("keyup",w),()=>{window.removeEventListener("keyup",w)}},[]);const x=Ie.merge(Ie.values(l==null?void 0:l.toggles).flatMap(w=>w.value?w.warnings||[]:[]),l==null?void 0:l.tips),h=(w,v)=>{var E;if(!(l!=null&&l.toggles))return;const S=Ie.cloneDeep(l);(E=S.toggles)!=null&&E[w]&&(S.toggles[w].value=v),g({id:e,views:S})};return Qn.createPortal(I.jsx(Ca,{appear:!0,show:!0,as:M.Fragment,children:I.jsx("div",{className:Be("absolute inset-0 flex h-full w-full items-center justify-center overflow-y-auto",{"bg-black bg-opacity-80":p}),style:{zIndex:u},onClick:()=>y(Ei.CANCELED),children:I.jsx(Ca.Child,{as:M.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:I.jsx("div",{"data-cy":"confirmation-modal-cy",className:"relative rounded-md border border-grey-50 bg-grey-900",style:{width:f},onClick:w=>w.stopPropagation(),children:I.jsxs("div",{className:"flex flex-col items-center gap-3 p-6 px-12",children:[i?I.jsx("div",{className:"flex items-center justify-center",children:I.jsx(a$,{name:i,color:a,className:"w-6 h-6"})}):null,I.jsx(l$,{condition:t,children:I.jsx("h4",{className:"w-full text-wrap text-lg font-bold leading-6 text-white text-center",children:t})}),I.jsx("p",{className:"w-full text-wrap text-center text-sm font-medium text-white",children:r}),I.jsx("div",{className:"text-xs text-white",children:Ie.values(l==null?void 0:l.toggles).map(w=>I.jsx("div",{children:I.jsxs("label",{htmlFor:w.key,className:"flex items-center",children:[I.jsx(Vy,{size:"xs",value:w.value,onChange:v=>h(w.key,v)}),I.jsx("span",{className:"ml-1",children:w.title})]})},w.key))}),I.jsx(c$,{warnings:x}),I.jsx("div",{className:"flex items-center gap-4",children:s===$f.CONFIRM?I.jsxs(I.Fragment,{children:[I.jsx(lc,{autoFocus:!0,color:a,onClick:()=>y(Ei.CONFIRMED),children:"Confirm"}),I.jsx(lc,{color:a,variant:"outlined",onClick:()=>y(Ei.CANCELED),children:"Cancel"})]}):I.jsx(lc,{autoFocus:!0,onClick:()=>y(),children:"OK"})})]})})})})}),m||document.body)},l$=e=>e.condition?I.jsx(I.Fragment,{children:e.children}):null,c$=e=>e.warnings?I.jsx(Ca,{appear:!0,show:!!e.warnings.length,as:M.Fragment,children:I.jsx("div",{className:"flex flex-col gap-1 rounded-sm bg-grey-600 p-2 text-xs text-white",children:e.warnings.map((t,r)=>I.jsx(Ca.Child,{as:M.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:I.jsxs("div",{className:"flex flex-1 items-center gap-1 rounded-sm px-2 py-1",children:[I.jsx(Qe.FdWarningDanger,{className:Be({"h-3 w-3":!0,"text-yellow-500":t.type==="warning","text-red-400":t.type==="error","text-primary-dark":t.type==="info"},"mr-3")}),I.jsx("div",{className:"flex-1",children:t.message})]})},`modal-warnings-${r}`))})}):null;var f0=(e=>(e[e.MIN=.5]="MIN",e[e.MAX=10]="MAX",e[e.STEP=.5]="STEP",e[e.INIT=1]="INIT",e[e.TRANSITION=200]="TRANSITION",e))(f0||{});const f$=({zoom:e,minZoom:t=.5,maxZoom:r=10,handleZoomIn:i,handleZoomOut:s})=>I.jsxs("div",{className:"flex items-center rounded bg-grey-300 p-1",children:[I.jsx(Qe.FdMinusNaked,{onClick:s,className:Be("h-5 w-5 p-1",{"text-grey-200":e<=t,"cursor-pointer rounded hover:bg-purple-800":e>t})}),I.jsxs("span",{className:"mx-1 w-10 select-none text-center text-xs",children:[(e*100).toFixed(0),"%"]}),I.jsx(Qe.FdPlusNaked,{onClick:i,className:Be("h-5 w-5 p-1",{"text-grey-200":e>=r,"cursor-pointer rounded hover:bg-purple-800":e<r})})]}),d$=$.forwardRef(((e,t)=>$.createElement(Pn.span,rt({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})))),p$=d$;function Um(e){const t=$.useRef({value:e,previous:e});return $.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}const[d0]=hf("Tooltip",[Ka]),Lf=Ka(),h$=700,[$F,g$]=d0("TooltipProvider",{isOpenDelayed:!0,delayDuration:h$,onOpen:()=>{},onClose:()=>{}}),[m$,tu]=d0("Tooltip"),v$=e=>{const{__scopeTooltip:t,children:r,open:i,defaultOpen:s=!1,onOpenChange:a,delayDuration:u}=e,l=g$("Tooltip",t),f=Lf(t),[p,m]=$.useState(null),d=fy(),g=$.useRef(0),y=u??l.delayDuration,x=$.useRef(!1),{onOpen:h,onClose:w}=l,[v=!1,S]=Ey({prop:i,defaultProp:s,onChange:C=>{C&&(document.dispatchEvent(new CustomEvent("tooltip.open")),h()),a==null||a(C)}}),E=$.useMemo((()=>v?x.current?"delayed-open":"instant-open":"closed"),[v]),R=$.useCallback((()=>{window.clearTimeout(g.current),x.current=!1,S(!0)}),[S]),T=$.useCallback((()=>{window.clearTimeout(g.current),g.current=window.setTimeout((()=>{x.current=!0,S(!0)}),y)}),[y,S]);return $.useEffect((()=>()=>window.clearTimeout(g.current)),[]),$.createElement(wy,f,$.createElement(m$,{scope:t,contentId:d,open:v,stateAttribute:E,trigger:p,onTriggerChange:m,onTriggerEnter:$.useCallback((()=>{l.isOpenDelayed?T():R()}),[l.isOpenDelayed,T,R]),onOpen:$.useCallback(R,[R]),onClose:$.useCallback((()=>{window.clearTimeout(g.current),S(!1),w()}),[S,w])},r))},y$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,...i}=e,s=tu("TooltipTrigger",r),a=Lf(r),u=Rn(t,s.onTriggerChange),l=$.useRef(!1),f=$.useCallback((()=>l.current=!1),[]);return $.useEffect((()=>()=>document.removeEventListener("mouseup",f)),[f]),$.createElement(xy,rt({asChild:!0},a),$.createElement(Pn.button,rt({"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute},i,{ref:u,onMouseEnter:Zt(e.onMouseEnter,s.onTriggerEnter),onMouseLeave:Zt(e.onMouseLeave,s.onClose),onMouseDown:Zt(e.onMouseDown,(()=>{s.onClose(),l.current=!0,document.addEventListener("mouseup",f,{once:!0})})),onFocus:Zt(e.onFocus,(()=>{l.current||s.onOpen()})),onBlur:Zt(e.onBlur,s.onClose),onClick:Zt(e.onClick,(p=>{p.detail===0&&s.onClose()}))})))})),b$=$.forwardRef(((e,t)=>{const{forceMount:r,...i}=e,s=tu("TooltipContent",e.__scopeTooltip);return $.createElement(df,{present:r||s.open},$.createElement(w$,rt({ref:t},i)))})),w$=$.forwardRef(((e,t)=>{const{__scopeTooltip:r,children:i,"aria-label":s,portalled:a=!0,...u}=e,l=tu("TooltipContent",r),f=Lf(r),p=a?pf:$.Fragment,{onClose:m}=l;return gy((()=>m())),$.useEffect((()=>(document.addEventListener("tooltip.open",m),()=>document.removeEventListener("tooltip.open",m))),[m]),$.createElement(p,null,$.createElement(x$,{__scopeTooltip:r}),$.createElement(Sy,rt({"data-state":l.stateAttribute},f,u,{ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),$.createElement(hy,null,i),$.createElement(p$,{id:l.contentId,role:"tooltip"},s||i)))}));function x$(e){const{__scopeTooltip:t}=e,r=tu("CheckTriggerMoved",t),i=vy(r.trigger),s=i==null?void 0:i.left,a=Um(s),u=i==null?void 0:i.top,l=Um(u),f=r.onClose;return $.useEffect((()=>{(a!==void 0&&a!==s||l!==void 0&&l!==u)&&f()}),[f,a,l,s,u]),null}const S$=v$,E$=y$,_$=b$;function T$(e){const t=M.isValidElement(e.children)?M.Children.only(e.children):I.jsx("span",{className:"inline-flex",children:e.children});return I.jsxs(S$,{delayDuration:e.delayDuration,open:e.open,children:[I.jsx(E$,{tabIndex:-1,asChild:!0,children:t}),I.jsxs(_$,{portalled:!0,side:e.side,sideOffset:e.sideOffset,alignOffset:e.alignOffset,className:Be("z-[1000] max-w-[240px] rounded-md bg-primary-light px-2 py-1 text-s font-semibold text-primary-dark shadow-md"),children:[typeof e.message=="string"&&I.jsx("p",{children:e.message}),typeof e.message!="string"&&e.message]})]})}const Pr=30,p0=.3,h0=.6,O$=()=>typeof window>"u"?400:Math.round(window.innerHeight*p0),g0=()=>typeof window>"u"?600:Math.round(window.innerHeight*h0),qm=e=>{const t=g0();return Math.min(Math.max(e,Pr),t)},A$=()=>I.jsx("div",{className:"h-2 w-full bg-opacity-40 hover:bg-primary-hover"}),R$=e=>{const[t,r]=M.useState(Pr),i=M.useRef(),s=M.useRef(null),a=g0(),u=O$(),l=t>Pr;M.useEffect(()=>{r(e.isOpen?u:Pr)},[e.isOpen,u]),M.useEffect(()=>{const p=()=>{r(m=>m<=Pr?Pr:qm(m))};return window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p),s.current&&cancelAnimationFrame(s.current)}},[]);const f=()=>{if(l){r(Pr),e.onClose();return}r(u),e.onOpen()};return I.jsx("div",{className:"relative w-full select-none isolate",style:{zIndex:49},children:I.jsx(AO.Resizable,{enable:{top:!0,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},className:"w-full select-none border-t border-grey-900 bg-grey-800",size:{height:t,width:"100%"},maxHeight:a,minHeight:Pr,onResizeStart:()=>{i.current&&Date.now()-i.current<200?r(l?Pr:u):i.current=Date.now()},onResize:(p,m,d)=>{s.current&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{var g;(g=e.onResize)==null||g.call(e),s.current=null})},onResizeStop:(p,m,d,g)=>{r(y=>qm(y+g.height))},handleComponent:{top:I.jsx(A$,{})},children:I.jsxs("div",{"data-cy":"contextualPanel",className:"absolute inset-0 flex flex-col overflow-hidden",id:`__cp-${Ie.kebabCase(e.path)}`,children:[I.jsxs("div",{className:Be("flex justify-between items-center px-3 py-0.5",{"flex-1":!l}),children:[I.jsxs("div",{className:"group flex items-center justify-start",children:[I.jsx("span",{className:"mr-2 text-sm text-fd-gray-lighter",children:"Contextual panel"}),e.tipKey?I.jsx(Dy,{tipKey:e.tipKey,alwaysOn:!0,asButton:!0}):null,I.jsx("button",{"data-cy":`contextualPanel-toggle-button-${l?"close":"open"}`,className:"rounded p-1 text-white hover:bg-primary-hover focus:outline-none",onClick:f,children:l?I.jsx(Qe.FdDoubleArrowDown,{className:"h-4 w-4 text-white"}):I.jsx(Qe.FdDoubleArrowUp,{className:"h-4 w-4 text-white"})})]}),e.headerRightSide]}),I.jsxs(va,{of:l,children:[I.jsx(va,{of:e.render,children:e.render}),I.jsx(va,{of:!e.render,children:e.children})]})]})})})};function m0({children:e,viewBox:t="0 0 24 24",...r}){return I.jsx("svg",{viewBox:t,width:"1em",height:"1em",fill:"none",className:"base-icon",...Ie.omit(r,"isIndeterminate","isChecked"),children:e})}function v0(e){const t=e.isIndeterminate?"M2 12h20":"M4 11.5L9 17L20 6";return I.jsx(m0,{viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",d:t})})}function P$({isChecked:e,isIndeterminate:t,isInvalid:r,icon:i,label:s,className:a="",style:u,...l}){const f=M.useRef(null),p=i||I.jsx(v0,{}),m=l.checked??e;M.useEffect(()=>{f.current&&(f.current.indeterminate=!!t)},[t]);const d=m||t,g=["base-checkbox-container",a].join(" ");return I.jsxs("label",{className:g,style:u,"data-invalid":r,children:[I.jsx("input",{ref:f,type:"checkbox",className:"base-checkbox-input",checked:m,...l,"aria-invalid":r||void 0}),I.jsx("span",{className:"base-checkbox-control",children:d&&p&&M.cloneElement(p,{isChecked:m,isIndeterminate:t,className:"base-checkbox-icon"})}),s&&I.jsx("span",{className:"base-checkbox-label",children:s})]})}const C$=M.forwardRef(({label:e,Icon:t,as:r="button",className:i="",disableHover:s=!1,iconClassname:a,...u},l)=>{const[f,p]=M.useState(null),[m,d]=M.useState(!1);return M.useImperativeHandle(l,()=>f,[f]),I.jsxs(I.Fragment,{children:[I.jsx(r,{ref:p,className:Be("rounded p-1 text-white focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",{"hover:bg-primary-hover":!s},i),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseDown:()=>d(!1),...u,children:I.jsx(t,{className:Be("h-4 w-4",a)})}),m&&Qn.createPortal(I.jsx(u0,{label:e,referenceElement:f}),document.body)]})}),k$=({onChange:e,value:t,delay:r,placeholder:i,containerClassName:s,onFocusInput:a,icon:u,"data-cy":l})=>{const[f,p]=M.useState(t),m=M.useRef(null);return I.jsxs("div",{className:"w-full flex gap-x-1",children:[u&&I.jsx("button",{className:"mr-1 flex h-6 w-7 items-center justify-center text-xs rounded bg-grey-300 hover:bg-primary-hover",onClick:()=>{var d;return(d=m.current)==null?void 0:d.focus()},children:I.jsx("span",{className:`text-base fa ${u}`})}),I.jsxs("div",{className:Be("flex h-6 w-full rounded bg-grey-300 pl-1.5 pr-1 focus-within:outline-none focus-within:ring-[1px] focus-within:ring-primary-dark mb-1",s),children:[I.jsx("span",{className:"flex items-center justify-center",children:!u&&I.jsx(Qe.FdSearch,{className:"text-grey-100"})}),I.jsx("input",{ref:m,"data-cy":l||"search-cy",type:"text",className:"w-full rounded bg-grey-300 py-1.5 pl-1 pr-1 text-xs placeholder-grey-200 focus:outline-none focus:ring-0",placeholder:i||"Search",onChange:d=>{p(d.currentTarget.value);const g=Ie.escapeRegExp(d.target.value);if(!r)return e(g);Ie.debounce(e,r)(g)},value:f,onFocus:()=>a&&a(),onDrop:d=>d.preventDefault()}),t&&I.jsx("span",{onClick:()=>{e(""),p("")},className:"flex cursor-pointer items-center justify-center",children:I.jsx(Qe.FdCloseNaked,{})})]})]})},I$=({title:e="Invalid page structure",error:t,onClose:r,onOpenInTextEditor:i,onReset:s,resetButtonLabel:a="Reset Page"})=>I.jsx("div",{className:"flex h-full w-full items-center justify-center",children:I.jsxs("div",{className:"flex flex-col items-center rounded bg-grey-300 px-10 py-6 text-center shadow-md",children:[I.jsxs("div",{className:"relative",children:[I.jsx(Qe.FdSanityCheckDefault,{className:"relative z-20 h-12 w-12 text-red-500 rounded-full"}),I.jsx("div",{className:"w-1/2 h-1/2 absolute z-0 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white"})]}),I.jsx("p",{className:"mb-2 mt-4 text-2xl text-white",children:e}),I.jsx("p",{className:"text-md mb-4 font-extralight text-grey-100",children:t}),I.jsxs("div",{className:"flex gap-4",children:[i&&I.jsx("button",{className:"text-md rounded border border-primary-dark hover:border-primary-hover bg-primary-dark hover:bg-primary-hover px-3 py-1 text-white focus:outline-none",onClick:i,children:"Open in Text Editor"}),s&&I.jsx("button",{className:"text-md rounded border border-red-500 bg-red-500 hover:bg-red-400 focus:ring-red-500 px-3 py-1 text-white focus:outline-none",onClick:s,children:a}),r&&I.jsx("button",{className:"text-md rounded border border-grey-50 bg-transparent hover:bg-grey-50 text-white hover:text-primary-dark px-3 py-1 focus:outline-none",onClick:r,children:"Close"})]})]})});function _i(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function $$({rowGap:e,columnGap:t,templateColumns:r,templateRows:i,height:s,width:a,style:u,...l}){return I.jsx("div",{...l,style:{display:"grid",rowGap:_i(e),columnGap:_i(t),gridTemplateColumns:r,gridTemplateRows:i,height:_i(s),width:_i(a),...u}})}function L$({colStart:e,colSpan:t,rowStart:r,rowSpan:i,sx:s,style:a,...u}){return I.jsx("div",{...u,style:{gridColumnStart:e,gridColumnEnd:t?`span ${t}`:void 0,gridRowStart:r,gridRowEnd:i?`span ${i}`:void 0,...s,...a}})}function M$({columns:e=1,spacingX:t,spacingY:r,style:i,...s}){return I.jsx("div",{...s,style:{display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,columnGap:_i(t),rowGap:_i(r),...i}})}const y0=M.forwardRef(({fallback:e=null,onError:t,onLoad:r,src:i,style:s,...a},u)=>{const[l,f]=M.useState(!1);return M.useEffect(()=>{f(!1)},[i]),!i||l?I.jsx(I.Fragment,{children:e}):I.jsx("img",{...a,ref:u,src:i,style:s,onLoad:p=>{f(!1),r==null||r(p)},onError:p=>{f(!0),t==null||t(p)}})});y0.displayName="Image";function D$(e,t){const r=M.useRef(!1);M.useEffect(()=>{if(r.current)return e();r.current=!0},t)}const cc=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function fc(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),r)}function Eo(e,t,r,i){e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent&&e.detachEvent("on".concat(t),r)}function b0(e,t){const r=t.slice(0,t.length-1);for(let i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function w0(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function N$(e,t){const r=e.length>=t.length?e:t,i=e.length>=t.length?t:e;let s=!0;for(let a=0;a<r.length;a++)i.indexOf(r[a])===-1&&(s=!1);return s}const zo={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":cc?173:189,"=":cc?61:187,";":cc?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},xr={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},Ao={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},bt={16:!1,18:!1,17:!1,91:!1},tt={};for(let e=1;e<20;e++)zo["f".concat(e)]=111+e;let Je=[],Do=null,x0="all";const Xr=new Map,Di=e=>zo[e.toLowerCase()]||xr[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),F$=e=>Object.keys(zo).find(t=>zo[t]===e),j$=e=>Object.keys(xr).find(t=>xr[t]===e);function S0(e){x0=e||"all"}function Bo(){return x0||"all"}function z$(){return Je.slice(0)}function B$(){return Je.map(e=>F$(e)||j$(e)||String.fromCharCode(e))}function W$(){const e=[];return Object.keys(tt).forEach(t=>{tt[t].forEach(r=>{let{key:i,scope:s,mods:a,shortcut:u}=r;e.push({scope:s,shortcut:u,mods:a,keys:i.split("+").map(l=>Di(l))})})}),e}function H$(e){const t=e.target||e.srcElement,{tagName:r}=t;let i=!0;const s=r==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(s||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function U$(e){return typeof e=="string"&&(e=Di(e)),Je.indexOf(e)!==-1}function q$(e,t){let r,i;e||(e=Bo());for(const s in tt)if(Object.prototype.hasOwnProperty.call(tt,s))for(r=tt[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1).forEach(u=>{let{element:l}=u;return Mf(l)}):i++;Bo()===e&&S0(t||"all")}function G$(e){let t=e.keyCode||e.which||e.charCode;e.key&&e.key.toLowerCase()==="capslock"&&(t=Di(e.key));const r=Je.indexOf(t);if(r>=0&&Je.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&Je.splice(0,Je.length),(t===93||t===224)&&(t=91),t in bt){bt[t]=!1;for(const i in xr)xr[i]===t&&(br[i]=!1)}}function E0(e){if(typeof e>"u")Object.keys(tt).forEach(s=>{Array.isArray(tt[s])&&tt[s].forEach(a=>la(a)),delete tt[s]}),Mf(null);else if(Array.isArray(e))e.forEach(s=>{s.key&&la(s)});else if(typeof e=="object")e.key&&la(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];let[s,a]=r;typeof s=="function"&&(a=s,s=""),la({key:e,scope:s,method:a,splitKey:"+"})}}const la=e=>{let{key:t,scope:r,method:i,splitKey:s="+"}=e;w0(t).forEach(u=>{const l=u.split(s),f=l.length,p=l[f-1],m=p==="*"?"*":Di(p);if(!tt[m])return;r||(r=Bo());const d=f>1?b0(xr,l):[],g=[];tt[m]=tt[m].filter(y=>{const h=(i?y.method===i:!0)&&y.scope===r&&N$(y.mods,d);return h&&g.push(y.element),!h}),g.forEach(y=>Mf(y))})};function Gm(e,t,r,i){if(t.element!==i)return;let s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(const a in bt)Object.prototype.hasOwnProperty.call(bt,a)&&(!bt[a]&&t.mods.indexOf(+a)>-1||bt[a]&&t.mods.indexOf(+a)===-1)&&(s=!1);(t.mods.length===0&&!bt[16]&&!bt[18]&&!bt[17]&&!bt[91]||s||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(Je),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function Zm(e,t){const r=tt["*"];let i=e.keyCode||e.which||e.charCode;if(e.key&&e.key.toLowerCase()==="capslock"||!br.filter.call(this,e))return;if((i===93||i===224)&&(i=91),Je.indexOf(i)===-1&&i!==229&&Je.push(i),["metaKey","ctrlKey","altKey","shiftKey"].forEach(l=>{const f=Ao[l];e[l]&&Je.indexOf(f)===-1?Je.push(f):!e[l]&&Je.indexOf(f)>-1?Je.splice(Je.indexOf(f),1):l==="metaKey"&&e[l]&&(Je=Je.filter(p=>p in Ao||p===i))}),i in bt){bt[i]=!0;for(const l in xr)if(Object.prototype.hasOwnProperty.call(xr,l)){const f=Ao[xr[l]];br[l]=e[f]}if(!r)return}for(const l in bt)Object.prototype.hasOwnProperty.call(bt,l)&&(bt[l]=e[Ao[l]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Je.indexOf(17)===-1&&Je.push(17),Je.indexOf(18)===-1&&Je.push(18),bt[17]=!0,bt[18]=!0);const s=Bo();if(r)for(let l=0;l<r.length;l++)r[l].scope===s&&(e.type==="keydown"&&r[l].keydown||e.type==="keyup"&&r[l].keyup)&&Gm(e,r[l],s,t);if(!(i in tt))return;const a=tt[i],u=a.length;for(let l=0;l<u;l++)if((e.type==="keydown"&&a[l].keydown||e.type==="keyup"&&a[l].keyup)&&a[l].key){const f=a[l],{splitKey:p}=f,m=f.key.split(p),d=[];for(let g=0;g<m.length;g++)d.push(Di(m[g]));d.sort().join("")===Je.sort().join("")&&Gm(e,f,s,t)}}function br(e,t,r){Je=[];const i=w0(e);let s=[],a="all",u=document,l=0,f=!1,p=!0,m="+",d=!1,g=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(u=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(p=t.keydown),t.capture!==void 0&&(d=t.capture),typeof t.splitKey=="string"&&(m=t.splitKey),t.single===!0&&(g=!0)),typeof t=="string"&&(a=t),g&&E0(e,a);l<i.length;l++)e=i[l].split(m),s=[],e.length>1&&(s=b0(xr,e)),e=e[e.length-1],e=e==="*"?"*":Di(e),e in tt||(tt[e]=[]),tt[e].push({keyup:f,keydown:p,scope:a,mods:s,shortcut:i[l],method:r,key:i[l],splitKey:m,element:u});if(typeof u<"u"&&window){if(!Xr.has(u)){const y=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return Zm(h,u)},x=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;Zm(h,u),G$(h)};Xr.set(u,{keydownListener:y,keyupListenr:x,capture:d}),fc(u,"keydown",y,d),fc(u,"keyup",x,d)}if(!Do){const y=()=>{Je=[]};Do={listener:y,capture:d},fc(window,"focus",y,d)}}}function Z$(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(tt).forEach(r=>{tt[r].filter(s=>s.scope===t&&s.shortcut===e).forEach(s=>{s&&s.method&&s.method()})})}function Mf(e){const t=Object.values(tt).flat();if(t.findIndex(i=>{let{element:s}=i;return s===e})<0){const{keydownListener:i,keyupListenr:s,capture:a}=Xr.get(e)||{};i&&s&&(Eo(e,"keyup",s,a),Eo(e,"keydown",i,a),Xr.delete(e))}if((t.length<=0||Xr.size<=0)&&(Object.keys(Xr).forEach(s=>{const{keydownListener:a,keyupListenr:u,capture:l}=Xr.get(s)||{};a&&u&&(Eo(s,"keyup",u,l),Eo(s,"keydown",a,l),Xr.delete(s))}),Xr.clear(),Object.keys(tt).forEach(s=>delete tt[s]),Do)){const{listener:s,capture:a}=Do;Eo(window,"focus",s,a),Do=null}}const dc={getPressedKeyString:B$,setScope:S0,getScope:Bo,deleteScope:q$,getPressedKeyCodes:z$,getAllKeyCodes:W$,isPressed:U$,filter:H$,trigger:Z$,unbind:E0,keyMap:zo,modifier:xr,modifierMap:Ao};for(const e in dc)Object.prototype.hasOwnProperty.call(dc,e)&&(br[e]=dc[e]);if(typeof window<"u"){const e=window.hotkeys;br.noConflict=t=>(t&&window.hotkeys===br&&(window.hotkeys=e),br),window.hotkeys=br}br.filter=()=>!0;function V$(e,t,r,i){r instanceof Array&&(i=r,r=void 0),i=i||[],r=r||{};const{preventDefault:s=!0}=r,a=M.useCallback((l,f)=>{s&&l.preventDefault(),setTimeout(()=>t(l,f))},i),u=()=>{br.unbind(e,a)};M.useEffect(()=>(br(e,r,a),u),[e,r,a])}const K$=(e,t="click")=>{const r=M.useRef(null);return M.useEffect(()=>{const i=s=>{r.current&&!r.current.contains(s.target)&&e(s)};return document.addEventListener(t,i,!0),()=>{document.removeEventListener(t,i,!0)}},[e,t]),r};function Y$(e){const t=M.useRef();return M.useEffect(()=>{t.current=e},[e]),t.current}function X$(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e},[e]),t}function J$(e){const t=M.useRef(null);return M.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t}function Q$(e){const[t,r]=M.useState(e),i=(a,u)=>{r(l=>({...l,features:{...l.features,[a]:{enabled:u}}}))},s=M.useCallback((...a)=>a.every(u=>{var l;return(l=t.features[u])==null?void 0:l.enabled}),[t.features]);return{setFeature:i,isFeatureEnabled:s}}const _0=M.createContext(""),eL=e=>I.jsx(_0.Provider,{value:e.value,children:e.children}),tL=()=>{const e=M.useContext(_0);if(typeof e!="string")throw new Error("Error while calling useIdentity! Context has incorrect type (expected string)");return e};function rL(e){const[t,r]=M.useState(e),i=M.useMemo(()=>nL(t,r),[]);return{state:t,actions:{...i,set:s=>{r(typeof s=="function"?s:a=>({...a,...s}))}}}}function nL(e,t=()=>{}){return Object.keys(e).reduce((i,s)=>({...i,[`set${Ie.upperFirst(s)}`]:a=>t(u=>({...u,[s]:a}))}),{})}const iL=(e,t,r={})=>{r={timeout:200,...r};const i=M.useRef(),s=()=>{i.current&&(clearTimeout(i.current),i.current=null)};return M.useCallback((a,...u)=>{s(),t&&a.detail===1&&(i.current=setTimeout(()=>{t(a,...u)},r.timeout)),a.detail%2===0&&e(a,...u)},[t,e,r.timeout])};function wt(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(process.env.NODE_ENV!=="production"){var s=fL[e],a=s?typeof s=="function"?s.apply(null,r):s:"unknown error nr: "+e;throw Error("[Immer] "+a)}throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(u){return"'"+u+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Li(e){return!!e&&!!e[Yt]}function Jn(e){var t;return!!e&&((function(r){if(!r||typeof r!="object")return!1;var i=Object.getPrototypeOf(r);if(i===null)return!0;var s=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return s===Object||typeof s=="function"&&Function.toString.call(s)===dL})(e)||Array.isArray(e)||!!e[tv]||!!(!((t=e.constructor)===null||t===void 0)&&t[tv])||Df(e)||Nf(e))}function Wo(e,t,r){r===void 0&&(r=!1),Ni(e)===0?(r?Object.keys:Bf)(e).forEach((function(i){r&&typeof i=="symbol"||t(i,e[i],e)})):e.forEach((function(i,s){return t(s,i,e)}))}function Ni(e){var t=e[Yt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Df(e)?2:Nf(e)?3:0}function jc(e,t){return Ni(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function oL(e,t){return Ni(e)===2?e.get(t):e[t]}function T0(e,t,r){var i=Ni(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function sL(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Df(e){return lL&&e instanceof Map}function Nf(e){return cL&&e instanceof Set}function Hn(e){return e.o||e.t}function Ff(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pL(e);delete t[Yt];for(var r=Bf(t),i=0;i<r.length;i++){var s=r[i],a=t[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Object.getPrototypeOf(e),t)}function Ho(e,t){return t===void 0&&(t=!1),jf(e)||Li(e)||!Jn(e)||(Ni(e)>1&&(e.set=e.add=e.clear=e.delete=aL),Object.freeze(e),t&&Wo(e,(function(r,i){return Ho(i,!0)}),!0)),e}function aL(){wt(2)}function jf(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Dr(e){var t=hL[e];return t||wt(18,e),t}function Vm(){return process.env.NODE_ENV==="production"||Mi||wt(0),Mi}function pc(e,t){t&&(Dr("Patches"),e.u=[],e.s=[],e.v=t)}function La(e){zc(e),e.p.forEach(uL),e.p=null}function zc(e){e===Mi&&(Mi=e.l)}function Km(e){return Mi={p:[],l:Mi,h:e,m:!0,_:0}}function uL(e){var t=e[Yt];t.i===0||t.i===1?t.j():t.g=!0}function hc(e,t){t._=t.p.length;var r=t.p[0],i=e!==void 0&&e!==r;return t.h.O||Dr("ES5").S(t,e,i),i?(r[Yt].P&&(La(t),wt(4)),Jn(e)&&(e=Ma(t,e),t.l||Da(t,e)),t.u&&Dr("Patches").M(r[Yt].t,e,t.u,t.s)):e=Ma(t,r,[]),La(t),t.u&&t.v(t.u,t.s),e!==A0?e:void 0}function Ma(e,t,r){if(jf(t))return t;var i=t[Yt];if(!i)return Wo(t,(function(l,f){return Ym(e,i,t,l,f,r)}),!0),t;if(i.A!==e)return t;if(!i.P)return Da(e,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var s=i.i===4||i.i===5?i.o=Ff(i.k):i.o,a=s,u=!1;i.i===3&&(a=new Set(s),s.clear(),u=!0),Wo(a,(function(l,f){return Ym(e,i,s,l,f,r,u)})),Da(e,s,!1),r&&e.u&&Dr("Patches").N(i,r,e.u,e.s)}return i.o}function Ym(e,t,r,i,s,a,u){if(process.env.NODE_ENV!=="production"&&s===r&&wt(5),Li(s)){var l=Ma(e,s,a&&t&&t.i!==3&&!jc(t.R,i)?a.concat(i):void 0);if(T0(r,i,l),!Li(l))return;e.m=!1}else u&&r.add(s);if(Jn(s)&&!jf(s)){if(!e.h.D&&e._<1)return;Ma(e,s),t&&t.A.l||Da(e,s)}}function Da(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Ho(t,r)}function gc(e,t){var r=e[Yt];return(r?Hn(r):e)[t]}function Xm(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Object.getPrototypeOf(r)}}function Bc(e){e.P||(e.P=!0,e.l&&Bc(e.l))}function mc(e){e.o||(e.o=Ff(e.t))}function Wc(e,t,r){var i=Df(t)?Dr("MapSet").F(t,r):Nf(t)?Dr("MapSet").T(t,r):e.O?(function(s,a){var u=Array.isArray(s),l={i:u?1:0,A:a?a.A:Vm(),P:!1,I:!1,R:{},l:a,t:s,k:null,o:null,j:null,C:!1},f=l,p=Hc;u&&(f=[l],p=Ro);var m=Proxy.revocable(f,p),d=m.revoke,g=m.proxy;return l.k=g,l.j=d,g})(t,r):Dr("ES5").J(t,r);return(r?r.A:Vm()).p.push(i),i}function O0(e){return Li(e)||wt(22,e),(function t(r){if(!Jn(r))return r;var i,s=r[Yt],a=Ni(r);if(s){if(!s.P&&(s.i<4||!Dr("ES5").K(s)))return s.t;s.I=!0,i=Jm(r,a),s.I=!1}else i=Jm(r,a);return Wo(i,(function(u,l){s&&oL(s.t,u)===l||T0(i,u,t(l))})),a===3?new Set(i):i})(e)}function Jm(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Ff(e)}var Qm,Mi,zf=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",lL=typeof Map<"u",cL=typeof Set<"u",ev=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",A0=zf?Symbol.for("immer-nothing"):((Qm={})["immer-nothing"]=!0,Qm),tv=zf?Symbol.for("immer-draftable"):"__$immer_draftable",Yt=zf?Symbol.for("immer-state"):"__$immer_state",fL={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},dL=""+Object.prototype.constructor,Bf=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pL=Object.getOwnPropertyDescriptors||function(e){var t={};return Bf(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},hL={},Hc={get:function(e,t){if(t===Yt)return e;var r=Hn(e);if(!jc(r,t))return(function(s,a,u){var l,f=Xm(a,u);return f?"value"in f?f.value:(l=f.get)===null||l===void 0?void 0:l.call(s.k):void 0})(e,r,t);var i=r[t];return e.I||!Jn(i)?i:i===gc(e.t,t)?(mc(e),e.o[t]=Wc(e.A.h,i,e)):i},has:function(e,t){return t in Hn(e)},ownKeys:function(e){return Reflect.ownKeys(Hn(e))},set:function(e,t,r){var i=Xm(Hn(e),t);if(i!=null&&i.set)return i.set.call(e.k,r),!0;if(!e.P){var s=gc(Hn(e),t),a=s==null?void 0:s[Yt];if(a&&a.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(sL(r,s)&&(r!==void 0||jc(e.t,t)))return!0;mc(e),Bc(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return gc(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,mc(e),Bc(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=Hn(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty:function(){wt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){wt(12)}},Ro={};Wo(Hc,(function(e,t){Ro[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ro.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&wt(13),Ro.set.call(this,e,t,void 0)},Ro.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&wt(14),Hc.set.call(this,e[0],t,r,e[0])};var gL=(function(){function e(r){var i=this;this.O=ev,this.D=!0,this.produce=function(s,a,u){if(typeof s=="function"&&typeof a!="function"){var l=a;a=s;var f=i;return function(h){var w=this;h===void 0&&(h=l);for(var v=arguments.length,S=Array(v>1?v-1:0),E=1;E<v;E++)S[E-1]=arguments[E];return f.produce(h,(function(R){var T;return(T=a).call.apply(T,[w,R].concat(S))}))}}var p;if(typeof a!="function"&&wt(6),u!==void 0&&typeof u!="function"&&wt(7),Jn(s)){var m=Km(i),d=Wc(i,s,void 0),g=!0;try{p=a(d),g=!1}finally{g?La(m):zc(m)}return typeof Promise<"u"&&p instanceof Promise?p.then((function(h){return pc(m,u),hc(h,m)}),(function(h){throw La(m),h})):(pc(m,u),hc(p,m))}if(!s||typeof s!="object"){if((p=a(s))===void 0&&(p=s),p===A0&&(p=void 0),i.D&&Ho(p,!0),u){var y=[],x=[];Dr("Patches").M(s,p,y,x),u(y,x)}return p}wt(21,s)},this.produceWithPatches=function(s,a){if(typeof s=="function")return function(p){for(var m=arguments.length,d=Array(m>1?m-1:0),g=1;g<m;g++)d[g-1]=arguments[g];return i.produceWithPatches(p,(function(y){return s.apply(void 0,[y].concat(d))}))};var u,l,f=i.produce(s,a,(function(p,m){u=p,l=m}));return typeof Promise<"u"&&f instanceof Promise?f.then((function(p){return[p,u,l]})):[f,u,l]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var t=e.prototype;return t.createDraft=function(r){Jn(r)||wt(8),Li(r)&&(r=O0(r));var i=Km(this),s=Wc(this,r,void 0);return s[Yt].C=!0,zc(i),s},t.finishDraft=function(r,i){var s=r&&r[Yt];process.env.NODE_ENV!=="production"&&(s&&s.C||wt(9),s.I&&wt(10));var a=s.A;return pc(a,i),hc(void 0,a)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!ev&&wt(20),this.O=r},t.applyPatches=function(r,i){var s;for(s=i.length-1;s>=0;s--){var a=i[s];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}s>-1&&(i=i.slice(s+1));var u=Dr("Patches").$;return Li(r)?u(r,i):this.produce(r,(function(l){return u(l,i)}))},e})(),Xt=new gL,mL=Xt.produce;Xt.produceWithPatches.bind(Xt);Xt.setAutoFreeze.bind(Xt);Xt.setUseProxies.bind(Xt);Xt.applyPatches.bind(Xt);Xt.createDraft.bind(Xt);Xt.finishDraft.bind(Xt);function vL(e){var t=M.useState(function(){return Ho(typeof e=="function"?e():e,!0)}),r=t[1];return[t[0],M.useCallback(function(i){r(typeof i=="function"?mL(i):Ho(i))},[])]}const yL=process.env.NODE_ENV==="development",vc=yL&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:null,bL=(e,t,r)=>{const[i,s]=vL(e),a=M.useRef(null);M.useEffect(()=>{var f;return r&&(a.current=vc==null?void 0:vc.connect({name:r,trace:!0}),(f=a.current)==null||f.init(e)),()=>{var p,m;(m=(p=a.current)==null?void 0:p.disconnect)==null||m.call(p)}},[]);const u=t&&typeof t=="object"?t:{},l=M.useMemo(()=>Object.keys(u).reduce((f,p)=>({...f,[p]:m=>(s(d=>{var g;u[p](d,m),(g=a.current)==null||g.send({type:u[p].name},O0(d))}),l)}),{}),[s]);return{state:i,dispatch:l}},wL=e=>{const t=td(e),r=()=>{const{id:i,namespace:s}=t,a=window.DataSource.spaces[s];if(a&&a.sources)return a.sources[i]};return{actions:{setProperty:(i,s)=>{try{const a=r();a&&a.setValue(i,s)}catch{}},getValue:()=>r()}}},xL=({datasourceId:e,isDsBuild:t=!1,onChange:r})=>{const{id:i,namespace:s}=td(e),[a,u]=M.useState(!1),l=M.useCallback(()=>{try{return window.DataSource.getSource(i,s)}catch{return}},[s,i]),f=(d,g)=>{const y=l();y&&y.setValue(d,g)},p=async()=>{const d=l();if(!d)return;const g=await(d==null?void 0:d.getValue());r==null||r(g)},m=d=>{const{id:g}=d;!a&&g&&g.startsWith(i)&&u(!0)};return M.useEffect(()=>{if(a){const d=l();return d?(d==null||d.addListener("changed",p),()=>d==null?void 0:d.removeListener("changed",p)):void 0}},[a]),M.useEffect(()=>{if(t)return window.addEventListener("datasource:created",m),()=>window.removeEventListener("datasource:created",m)},[t]),{loaded:a,setCurrentSource:f}};function SL(e=!1){const[t,r]=M.useState(e),i=M.useMemo(()=>({on:()=>r(!0),off:()=>r(!1),toggle:()=>r(s=>!s)}),[]);return[t,i]}function EL(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useCallback((...r)=>{var i;return(i=t.current)==null?void 0:i.call(t,...r)},[])}function R0(e,t){const r=e!==void 0;return[r,r?e:t]}function _L({value:e,defaultValue:t,onChange:r}){const[i,s]=M.useState(t),[a,u]=R0(e,i),l=M.useCallback(f=>{const p=typeof f=="function"?f(u):f;a||s(p),p!==u&&(r==null||r(p))},[u,a,r]);return[u,l]}const TL=typeof window<"u"?M.useLayoutEffect:M.useEffect;function OL(e,t){const r=M.useRef(!1);M.useEffect(()=>{if(!r.current){r.current=!0;return}return e()},t)}function AL(e){return{...e,isDisabled:e.isDisabled??e.disabled,isReadOnly:e.isReadOnly??e.readOnly,isRequired:e.isRequired??e.required}}function en(e){return typeof e=="function"}function P0(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var yc=P0(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
202
202
|
`+r.map(function(i,s){return s+1+") "+i.toString()}).join(`
|
|
203
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function Uc(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ru=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,s,a;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=Oc(u),f=l.next();!f.done;f=l.next()){var p=f.value;p.remove(this)}}catch(h){t={error:h}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else u.remove(this);var m=this.initialTeardown;if(en(m))try{m()}catch(h){a=h instanceof yc?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var g=Oc(d),y=g.next();!y.done;y=g.next()){var x=y.value;try{rv(x)}catch(h){a=a??[],h instanceof yc?a=Ra(Ra([],Ac(a)),Ac(h.errors)):a.push(h)}}}catch(h){i={error:h}}finally{try{y&&!y.done&&(s=g.return)&&s.call(g)}finally{if(i)throw i.error}}}if(a)throw new yc(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)rv(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Uc(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Uc(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),C0=ru.EMPTY;function k0(e){return e instanceof ru||e&&"closed"in e&&en(e.remove)&&en(e.add)&&en(e.unsubscribe)}function rv(e){en(e)?e():e.unsubscribe()}var RL={Promise:void 0},PL={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Ra([e,t],Ac(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function CL(e){PL.setTimeout(function(){throw e})}function nv(){}function xa(e){e()}var I0=(function(e){Za(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,k0(r)&&r.add(i)):i.destination=$L,i}return t.create=function(r,i,s){return new qc(r,i,s)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(ru),kL=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){ca(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){ca(i)}else ca(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){ca(r)}},e})(),qc=(function(e){Za(t,e);function t(r,i,s){var a=e.call(this)||this,u;return en(r)||!r?u={next:r??void 0,error:i??void 0,complete:s??void 0}:u=r,a.destination=new kL(u),a}return t})(I0);function ca(e){CL(e)}function IL(e){throw e}var $L={closed:!0,next:nv,error:IL,complete:nv},LL=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ML(e){return e}function DL(e){return e.length===0?ML:e.length===1?e[0]:function(r){return e.reduce(function(i,s){return s(i)},r)}}var iv=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var s=this,a=FL(t)?t:new qc(t,r,i);return xa(function(){var u=s,l=u.operator,f=u.source;a.add(l?l.call(a,f):f?s._subscribe(a):s._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=ov(r),new r(function(s,a){var u=new qc({next:function(l){try{t(l)}catch(f){a(f),u.unsubscribe()}},error:a,complete:s});i.subscribe(u)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[LL]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return DL(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=ov(t),new t(function(i,s){var a;r.subscribe(function(u){return a=u},function(u){return s(u)},function(){return i(a)})})},e.create=function(t){return new e(t)},e})();function ov(e){var t;return(t=e??RL.Promise)!==null&&t!==void 0?t:Promise}function NL(e){return e&&en(e.next)&&en(e.error)&&en(e.complete)}function FL(e){return e&&e instanceof I0||NL(e)&&k0(e)}var jL=P0(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),jr=(function(e){Za(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new sv(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new jL},t.prototype.next=function(r){var i=this;xa(function(){var s,a;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var u=Oc(i.currentObservers),l=u.next();!l.done;l=u.next()){var f=l.value;f.next(r)}}catch(p){s={error:p}}finally{try{l&&!l.done&&(a=u.return)&&a.call(u)}finally{if(s)throw s.error}}}})},t.prototype.error=function(r){var i=this;xa(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var s=i.observers;s.length;)s.shift().error(r)}})},t.prototype.complete=function(){var r=this;xa(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,s=this,a=s.hasError,u=s.isStopped,l=s.observers;return a||u?C0:(this.currentObservers=null,l.push(r),new ru(function(){i.currentObservers=null,Uc(l,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,s=i.hasError,a=i.thrownError,u=i.isStopped;s?r.error(a):u&&r.complete()},t.prototype.asObservable=function(){var r=new iv;return r.source=this,r},t.create=function(r,i){return new sv(r,i)},t})(iv),sv=(function(e){Za(t,e);function t(r,i){var s=e.call(this)||this;return s.destination=r,s.source=i,s}return t.prototype.next=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,r)},t.prototype.error=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&s!==void 0?s:C0},t})(jr),$0=(e=>(e.RELOAD="reload",e.RECOMPUTE="recompute",e))($0||{}),L0=(e=>(e.RENAME="rename",e.TYPE_CHANGE="type-change",e))(L0||{});const zL=new jr,BL=new jr,Wf=new jr;var M0=(e=>(e.SAVE_ALL="save-all",e))(M0||{});const WL=new jr;var D0=(e=>(e.WILL_SAVE="will-save",e.DID_SAVE="did-save",e.WILL_CREATE="will-create",e.WILL_RENAME="will-rename",e.WILL_DELETE="will-delete",e.DID_CREATE="did-create",e.DID_RENAME="did-rename",e.DID_DELETE="did-delete",e.DIAGNOSTIC_REFRESH="diagnostic-refresh",e))(D0||{});const HL=new jr;var N0=(e=>(e.RESEND_BREAKPOINTS="resend-breakpoints",e))(N0||{});const UL=new jr,qL=new jr;var Uo=(e=>(e.EVENT_STARTED="event-started",e.EVENT_ENDED="event-ended",e.EVENT_EMITED="event-emited",e.REQUEST_SENT="request-sent",e))(Uo||{});const Na=new jr,GL=new jr,Hf=255;var Uf=(e=>(e.EMPTY="Please enter a valid name",e.LENGTH_EXCEEDED=`The name is too long, it should not exceed ${Hf} characters (including extension)`,e.SHOULD_START_WITH_LETTER="The name can only start with a letter or a Japanese character",e.INVALID="Invalid name",e))(Uf||{});function nu(e,t){const r=t?e.replace(/\.[^.]+$/,""):e;if(e==="")throw new Error("Please enter a valid name");if(e.length>Hf)throw new Error(Uf.LENGTH_EXCEEDED);if(!/^[a-zA-Z\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF]/.test(r))throw new Error("The name can only start with a letter or a Japanese character");if(!/^[\w\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF-]+$/i.test(r))throw new Error("Invalid name");return!0}function ZL(e){if(!e)return null;if(typeof e=="string")try{nu(e)}catch(t){return t.message}}function VL(e,t){let r="";if(["array","object"].includes(t))try{const i=JSON.parse(e);t==="array"&&(!Array.isArray(i)||!Ie.isObject(i))&&(r=`Invalid value for type ${t}`),t==="object"&&(!Ie.isObject(i)||Array.isArray(i))&&(r=`Invalid value for type ${t}`)}catch{r=`Invalid value for type ${t}`}return t==="date"&&(new RegExp(/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/).test(e)||(r=`Invalid value for type ${t}`)),t==="number"&&isNaN(+e)&&(r=`Invalid value for type ${t}`),["boolean","bool"].includes(t)&&typeof e!="boolean"&&!["true","false"].includes(e)&&(r=`Invalid value for type ${t}`),r}function KL(){return{PLACEHOLDER_PREFIX:`@!MASK_${Date.now().toString(36)+Math.random().toString(36).substring(2,8)}_`,counter:0}}function iu(e){const{PLACEHOLDER_PREFIX:t,counter:r}=KL();let i=r;const s=[],a="@!",u=m=>(s.push(m),`${t}${i++}${a}`);let l=e.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g,u);l=l.replace(/([\{\s]\s*\w+\s*)(:\s*\d+)/g,(m,d,g)=>d+u(g)),l=l.replace(/:\d{2}:\d{2}/g,u);const f=new RegExp(":(?!4D\\.\\w+)[CPK]?\\d+","g");let p=l.replace(f,"");for(let m=0;m<s.length;m++){const g=`${t}${m}${a}`.replace(/([.*+?^${}()|[\]\\])/g,"\\$1"),y=new RegExp(g,"g");p=p.replace(y,s[m])}return p}const F0=(e,t,r)=>{const i=e instanceof RegExp?av(e,r):e,s=t instanceof RegExp?av(t,r):t,a=i!==null&&s!=null&&YL(i,s,r);return a&&{start:a[0],end:a[1],pre:r.slice(0,a[0]),body:r.slice(a[0]+i.length,a[1]),post:r.slice(a[1]+s.length)}},av=(e,t)=>{const r=t.match(e);return r?r[0]:null},YL=(e,t,r)=>{let i,s,a,u,l,f=r.indexOf(e),p=r.indexOf(t,f+1),m=f;if(f>=0&&p>0){if(e===t)return[f,p];for(i=[],a=r.length;m>=0&&!l;){if(m===f)i.push(m),f=r.indexOf(e,m+1);else if(i.length===1){const d=i.pop();d!==void 0&&(l=[d,p])}else s=i.pop(),s!==void 0&&s<a&&(a=s,u=p),p=r.indexOf(t,m+1);m=f<p&&f>=0?f:p}i.length&&u!==void 0&&(l=[a,u])}return l},j0="\0SLASH"+Math.random()+"\0",z0="\0OPEN"+Math.random()+"\0",qf="\0CLOSE"+Math.random()+"\0",B0="\0COMMA"+Math.random()+"\0",W0="\0PERIOD"+Math.random()+"\0",XL=new RegExp(j0,"g"),JL=new RegExp(z0,"g"),QL=new RegExp(qf,"g"),eM=new RegExp(B0,"g"),tM=new RegExp(W0,"g"),rM=/\\\\/g,nM=/\\{/g,iM=/\\}/g,oM=/\\,/g,sM=/\\\./g,aM=1e5;function bc(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function uM(e){return e.replace(rM,j0).replace(nM,z0).replace(iM,qf).replace(oM,B0).replace(sM,W0)}function lM(e){return e.replace(XL,"\\").replace(JL,"{").replace(QL,"}").replace(eM,",").replace(tM,".")}function H0(e){if(!e)return[""];const t=[],r=F0("{","}",e);if(!r)return e.split(",");const{pre:i,body:s,post:a}=r,u=i.split(",");u[u.length-1]+="{"+s+"}";const l=H0(a);return a.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l)),t.push.apply(t,u),t}function cM(e,t={}){if(!e)return[];const{max:r=aM}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Po(uM(e),r,!0).map(lM)}function fM(e){return"{"+e+"}"}function dM(e){return/^-?0\d/.test(e)}function pM(e,t){return e<=t}function hM(e,t){return e>=t}function Po(e,t,r){const i=[],s=F0("{","}",e);if(!s)return[e];const a=s.pre,u=s.post.length?Po(s.post,t,!1):[""];if(/\$$/.test(s.pre))for(let l=0;l<u.length&&l<t;l++){const f=a+"{"+s.body+"}"+u[l];i.push(f)}else{const l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),p=l||f,m=s.body.indexOf(",")>=0;if(!p&&!m)return s.post.match(/,(?!,).*\}/)?(e=s.pre+"{"+s.body+qf+s.post,Po(e,t,!0)):[e];let d;if(p)d=s.body.split(/\.\./);else if(d=H0(s.body),d.length===1&&d[0]!==void 0&&(d=Po(d[0],t,!1).map(fM),d.length===1))return u.map(y=>s.pre+d[0]+y);let g;if(p&&d[0]!==void 0&&d[1]!==void 0){const y=bc(d[0]),x=bc(d[1]),h=Math.max(d[0].length,d[1].length);let w=d.length===3&&d[2]!==void 0?Math.max(Math.abs(bc(d[2])),1):1,v=pM;x<y&&(w*=-1,v=hM);const E=d.some(dM);g=[];for(let R=y;v(R,x);R+=w){let T;if(f)T=String.fromCharCode(R),T==="\\"&&(T="");else if(T=String(R),E){const C=h-T.length;if(C>0){const W=new Array(C+1).join("0");R<0?T="-"+W+T.slice(1):T=W+T}}g.push(T)}}else{g=[];for(let y=0;y<d.length;y++)g.push.apply(g,Po(d[y],t,!1))}for(let y=0;y<g.length;y++)for(let x=0;x<u.length&&i.length<t;x++){const h=a+g[y]+u[x];(!r||p||h)&&i.push(h)}}return i}const gM=1024*64,Fa=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>gM)throw new TypeError("pattern is too long")},mM={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},_o=e=>e.replace(/[[\]\\-]/g,"\\$&"),vM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),uv=e=>e.join(""),yM=(e,t)=>{const r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");const i=[],s=[];let a=r+1,u=!1,l=!1,f=!1,p=!1,m=r,d="";e:for(;a<e.length;){const h=e.charAt(a);if((h==="!"||h==="^")&&a===r+1){p=!0,a++;continue}if(h==="]"&&u&&!f){m=a+1;break}if(u=!0,h==="\\"&&!f){f=!0,a++;continue}if(h==="["&&!f){for(const[w,[v,S,E]]of Object.entries(mM))if(e.startsWith(w,a)){if(d)return["$.",!1,e.length-r,!0];a+=w.length,E?s.push(v):i.push(v),l=l||S;continue e}}if(f=!1,d){h>d?i.push(_o(d)+"-"+_o(h)):h===d&&i.push(_o(h)),d="",a++;continue}if(e.startsWith("-]",a+1)){i.push(_o(h+"-")),a+=2;continue}if(e.startsWith("-",a+1)){d=h,a+=2;continue}i.push(_o(h)),a++}if(m<a)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,e.length-r,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!p){const h=i[0].length===2?i[0].slice(-1):i[0];return[vM(h),!1,m-r,!1]}const g="["+(p?"^":"")+uv(i)+"]",y="["+(p?"":"^")+uv(s)+"]";return[i.length&&s.length?"("+g+"|"+y+")":i.length?g:y,l,m-r,!0]},Co=(e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var Dt;const bM=new Set(["!","?","+","*","@"]),Gc=e=>bM.has(e),lv=e=>Gc(e.type),wM=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),xM=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),SM=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),cv=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),EM="(?!(?:^|/)\\.\\.?(?:$|/))",fa="(?!\\.)",_M=new Set(["[","."]),TM=new Set(["..","."]),OM=new Set("().*{}+?[]^$\\!"),AM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Gf="[^/]",fv=Gf+"*?",dv=Gf+"+?";let RM=0;var ut,ht,Qr,we,Xe,Sn,Gn,En,Cr,kr,Ri,Me,U0,Tn,Sa,q0,Zc,Ea,G0,Vc,Z0,V0,K0,_a,Kc,Y0;class ou{constructor(t,r,i={}){vt(this,Me);ye(this,"type");vt(this,ut);vt(this,ht);vt(this,Qr,!1);vt(this,we,[]);vt(this,Xe);vt(this,Sn);vt(this,Gn);vt(this,En,!1);vt(this,Cr);vt(this,kr);vt(this,Ri,!1);ye(this,"id",++RM);this.type=t,t&&He(this,ht,!0),He(this,Xe,r),He(this,ut,X(this,Xe)?X(X(this,Xe),ut):this),He(this,Cr,X(this,ut)===this?i:X(X(this,ut),Cr)),He(this,Gn,X(this,ut)===this?[]:X(X(this,ut),Gn)),t==="!"&&!X(X(this,ut),En)&&X(this,Gn).push(this),He(this,Sn,X(this,Xe)?X(X(this,Xe),we).length:0)}get depth(){var t;return(((t=X(this,Xe))==null?void 0:t.depth)??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){var t;return{"@@type":"AST",id:this.id,type:this.type,root:X(this,ut).id,parent:(t=X(this,Xe))==null?void 0:t.id,depth:this.depth,partsLength:X(this,we).length,parts:X(this,we)}}get hasMagic(){if(X(this,ht)!==void 0)return X(this,ht);for(const t of X(this,we))if(typeof t!="string"&&(t.type||t.hasMagic))return He(this,ht,!0);return X(this,ht)}toString(){return X(this,kr)!==void 0?X(this,kr):this.type?He(this,kr,this.type+"("+X(this,we).map(t=>String(t)).join("|")+")"):He(this,kr,X(this,we).map(t=>String(t)).join(""))}push(...t){for(const r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Dt&&X(r,Xe)===this))throw new Error("invalid part: "+r);X(this,we).push(r)}}toJSON(){var r;const t=this.type===null?X(this,we).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...X(this,we).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===X(this,ut)||X(X(this,ut),En)&&((r=X(this,Xe))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(X(this,ut)===this)return!0;if(!((r=X(this,Xe))!=null&&r.isStart()))return!1;if(X(this,Sn)===0)return!0;const t=X(this,Xe);for(let i=0;i<X(this,Sn);i++){const s=X(t,we)[i];if(!(s instanceof Dt&&s.type==="!"))return!1}return!0}isEnd(){var r,i,s;if(X(this,ut)===this||((r=X(this,Xe))==null?void 0:r.type)==="!")return!0;if(!((i=X(this,Xe))!=null&&i.isEnd()))return!1;if(!this.type)return(s=X(this,Xe))==null?void 0:s.isEnd();const t=X(this,Xe)?X(X(this,Xe),we).length:0;return X(this,Sn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const r=new Dt(this.type,t);for(const i of X(this,we))r.copyIn(i);return r}static fromGlob(t,r={}){var s;const i=new Dt(null,void 0,r);return de(s=Dt,Tn,Sa).call(s,t,i,0,r,0),i}toMMPattern(){if(this!==X(this,ut))return X(this,ut).toMMPattern();const t=this.toString(),[r,i,s,a]=this.toRegExpSource();if(!(s||X(this,ht)||X(this,Cr).nocase&&!X(this,Cr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;const l=(X(this,Cr).nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,l),{_src:r,_glob:t})}get options(){return X(this,Cr)}toRegExpSource(t){var f;const r=t??!!X(this,Cr).dot;if(X(this,ut)===this&&(de(this,Me,_a).call(this),de(this,Me,U0).call(this)),!lv(this)){const p=this.isStart()&&this.isEnd()&&!X(this,we).some(x=>typeof x!="string"),m=X(this,we).map(x=>{var E;const[h,w,v,S]=typeof x=="string"?de(E=Dt,Tn,Y0).call(E,x,X(this,ht),p):x.toRegExpSource(t);return He(this,ht,X(this,ht)||v),He(this,Qr,X(this,Qr)||S),h}).join("");let d="";if(this.isStart()&&typeof X(this,we)[0]=="string"&&!(X(this,we).length===1&&TM.has(X(this,we)[0]))){const h=_M,w=r&&h.has(m.charAt(0))||m.startsWith("\\.")&&h.has(m.charAt(2))||m.startsWith("\\.\\.")&&h.has(m.charAt(4)),v=!r&&!t&&h.has(m.charAt(0));d=w?EM:v?fa:""}let g="";return this.isEnd()&&X(X(this,ut),En)&&((f=X(this,Xe))==null?void 0:f.type)==="!"&&(g="(?:$|\\/)"),[d+m+g,Co(m),He(this,ht,!!X(this,ht)),X(this,Qr)]}const i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let a=de(this,Me,Kc).call(this,r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){const p=this.toString(),m=this;return He(m,we,[p]),m.type=null,He(m,ht,void 0),[p,Co(this.toString()),!1,!1]}let u=!i||t||r||!fa?"":de(this,Me,Kc).call(this,!0);u===a&&(u=""),u&&(a=`(?:${a})(?:${u})*?`);let l="";if(this.type==="!"&&X(this,Ri))l=(this.isStart()&&!r?fa:"")+dv;else{const p=this.type==="!"?"))"+(this.isStart()&&!r&&!t?fa:"")+fv+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`;l=s+a+p}return[l,Co(a),He(this,ht,!!X(this,ht)),X(this,Qr)]}}ut=new WeakMap,ht=new WeakMap,Qr=new WeakMap,we=new WeakMap,Xe=new WeakMap,Sn=new WeakMap,Gn=new WeakMap,En=new WeakMap,Cr=new WeakMap,kr=new WeakMap,Ri=new WeakMap,Me=new WeakSet,U0=function(){if(this!==X(this,ut))throw new Error("should only call on root");if(X(this,En))return this;this.toString(),He(this,En,!0);let t;for(;t=X(this,Gn).pop();){if(t.type!=="!")continue;let r=t,i=X(r,Xe);for(;i;){for(let s=X(r,Sn)+1;!i.type&&s<X(i,we).length;s++)for(const a of X(t,we)){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(X(i,we)[s])}r=i,i=X(r,Xe)}}return this},Tn=new WeakSet,Sa=function(t,r,i,s,a){var h,w,v,S;const u=s.maxExtglobRecursion??2;let l=!1,f=!1,p=-1,m=!1;if(r.type===null){let E=i,R="";for(;E<t.length;){const T=t.charAt(E++);if(l||T==="\\"){l=!l,R+=T;continue}if(f){E===p+1?(T==="^"||T==="!")&&(m=!0):T==="]"&&!(E===p+2&&m)&&(f=!1),R+=T;continue}else if(T==="["){f=!0,p=E,m=!1,R+=T;continue}if(!s.noext&&Gc(T)&&t.charAt(E)==="("&&a<=u){r.push(R),R="";const W=new Dt(T,r);E=de(h=Dt,Tn,Sa).call(h,t,W,E,s,a+1),r.push(W);continue}R+=T}return r.push(R),E}let d=i+1,g=new Dt(null,r);const y=[];let x="";for(;d<t.length;){const E=t.charAt(d++);if(l||E==="\\"){l=!l,x+=E;continue}if(f){d===p+1?(E==="^"||E==="!")&&(m=!0):E==="]"&&!(d===p+2&&m)&&(f=!1),x+=E;continue}else if(E==="["){f=!0,p=d,m=!1,x+=E;continue}if(!s.noext&&Gc(E)&&t.charAt(d)==="("&&(a<=u||r&&de(w=r,Me,Ea).call(w,E))){const T=r&&de(v=r,Me,Ea).call(v,E)?0:1;g.push(x),x="";const C=new Dt(E,g);g.push(C),d=de(S=Dt,Tn,Sa).call(S,t,C,d,s,a+T);continue}if(E==="|"){g.push(x),x="",y.push(g),g=new Dt(null,r);continue}if(E===")")return x===""&&X(r,we).length===0&&He(r,Ri,!0),g.push(x),x="",r.push(...y,g),d;x+=E}return r.type=null,He(r,ht,void 0),He(r,we,[t.substring(i-1)]),d},q0=function(t){return de(this,Me,Zc).call(this,t,xM)},Zc=function(t,r=wM){if(!t||typeof t!="object"||t.type!==null||X(t,we).length!==1||this.type===null)return!1;const i=X(t,we)[0];return!i||typeof i!="object"||i.type===null?!1:de(this,Me,Ea).call(this,i.type,r)},Ea=function(t,r=SM){var i;return!!((i=r.get(this.type))!=null&&i.includes(t))},G0=function(t,r){const i=X(t,we)[0],s=new Dt(null,i,this.options);X(s,we).push(""),i.push(s),de(this,Me,Vc).call(this,t,r)},Vc=function(t,r){const i=X(t,we)[0];X(this,we).splice(r,1,...X(i,we));for(const s of X(i,we))typeof s=="object"&&He(s,Xe,this);He(this,kr,void 0)},Z0=function(t){const r=cv.get(this.type);return!!(r!=null&&r.has(t))},V0=function(t){if(!t||typeof t!="object"||t.type!==null||X(t,we).length!==1||this.type===null||X(this,we).length!==1)return!1;const r=X(t,we)[0];return!r||typeof r!="object"||r.type===null?!1:de(this,Me,Z0).call(this,r.type)},K0=function(t){const r=cv.get(this.type),i=X(t,we)[0],s=r==null?void 0:r.get(i.type);if(!s)return!1;He(this,we,X(i,we));for(const a of X(this,we))typeof a=="object"&&He(a,Xe,this);this.type=s,He(this,kr,void 0),He(this,Ri,!1)},_a=function(){var t,r;if(lv(this)){let i=0,s=!1;do{s=!0;for(let a=0;a<X(this,we).length;a++){const u=X(this,we)[a];typeof u=="object"&&(de(r=u,Me,_a).call(r),de(this,Me,Zc).call(this,u)?(s=!1,de(this,Me,Vc).call(this,u,a)):de(this,Me,q0).call(this,u)?(s=!1,de(this,Me,G0).call(this,u,a)):de(this,Me,V0).call(this,u)&&(s=!1,de(this,Me,K0).call(this,u)))}}while(!s&&++i<10)}else for(const i of X(this,we))typeof i=="object"&&de(t=i,Me,_a).call(t);He(this,kr,void 0)},Kc=function(t){return X(this,we).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[i,s,a,u]=r.toRegExpSource(t);return He(this,Qr,X(this,Qr)||u),i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},Y0=function(t,r,i=!1){let s=!1,a="",u=!1,l=!1;for(let f=0;f<t.length;f++){const p=t.charAt(f);if(s){s=!1,a+=(OM.has(p)?"\\":"")+p;continue}if(p==="*"){if(l)continue;l=!0,a+=i&&/^[*]+$/.test(t)?dv:fv,r=!0;continue}else l=!1;if(p==="\\"){f===t.length-1?a+="\\\\":s=!0;continue}if(p==="["){const[m,d,g,y]=yM(t,f);if(g){a+=m,u=u||d,f+=g-1,r=r||y;continue}}if(p==="?"){a+=Gf,r=!0;continue}a+=AM(p)}return[a,Co(t),!!r,u]},vt(ou,Tn);Dt=ou;const PM=(e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),xt=(e,t,r={})=>(Fa(t),!r.nocomment&&t.charAt(0)==="#"?!1:new su(t,r).match(e)),CM=/^\*+([^+@!?*[(]*)$/,kM=e=>t=>!t.startsWith(".")&&t.endsWith(e),IM=e=>t=>t.endsWith(e),$M=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),LM=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),MM=/^\*+\.\*+$/,DM=e=>!e.startsWith(".")&&e.includes("."),NM=e=>e!=="."&&e!==".."&&e.includes("."),FM=/^\.\*+$/,jM=e=>e!=="."&&e!==".."&&e.startsWith("."),zM=/^\*+$/,BM=e=>e.length!==0&&!e.startsWith("."),WM=e=>e.length!==0&&e!=="."&&e!=="..",HM=/^\?+([^+@!?*[(]*)?$/,UM=([e,t=""])=>{const r=X0([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},qM=([e,t=""])=>{const r=J0([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},GM=([e,t=""])=>{const r=J0([e]);return t?i=>r(i)&&i.endsWith(t):r},ZM=([e,t=""])=>{const r=X0([e]);return t?i=>r(i)&&i.endsWith(t):r},X0=([e])=>{const t=e.length;return r=>r.length===t&&!r.startsWith(".")},J0=([e])=>{const t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},Q0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",pv={win32:{sep:"\\"},posix:{sep:"/"}},VM=Q0==="win32"?pv.win32.sep:pv.posix.sep;xt.sep=VM;const Tt=Symbol("globstar **");xt.GLOBSTAR=Tt;const KM="[^/]",YM=KM+"*?",XM="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",JM="(?:(?!(?:\\/|^)\\.).)*?",QM=(e,t={})=>r=>xt(r,e,t);xt.filter=QM;const or=(e,t={})=>Object.assign({},e,t),eD=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return xt;const t=xt;return Object.assign((i,s,a={})=>t(i,s,or(e,a)),{Minimatch:class extends t.Minimatch{constructor(s,a={}){super(s,or(e,a))}static defaults(s){return t.defaults(or(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,a,u={}){super(s,a,or(e,u))}static fromGlob(s,a={}){return t.AST.fromGlob(s,or(e,a))}},unescape:(i,s={})=>t.unescape(i,or(e,s)),escape:(i,s={})=>t.escape(i,or(e,s)),filter:(i,s={})=>t.filter(i,or(e,s)),defaults:i=>t.defaults(or(e,i)),makeRe:(i,s={})=>t.makeRe(i,or(e,s)),braceExpand:(i,s={})=>t.braceExpand(i,or(e,s)),match:(i,s,a={})=>t.match(i,s,or(e,a)),sep:t.sep,GLOBSTAR:Tt})};xt.defaults=eD;const eb=(e,t={})=>(Fa(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:cM(e,{max:t.braceExpandMax}));xt.braceExpand=eb;const tD=(e,t={})=>new su(e,t).makeRe();xt.makeRe=tD;const rD=(e,t,r={})=>{const i=new su(t,r);return e=e.filter(s=>i.match(s)),i.options.nonull&&!e.length&&e.push(t),e};xt.match=rD;const hv=/[?*]|[+@!]\(.*?\)|\[|\]/,nD=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var Vt,tb,Yc,Si;class su{constructor(t,r={}){vt(this,Vt);ye(this,"options");ye(this,"set");ye(this,"pattern");ye(this,"windowsPathsNoEscape");ye(this,"nonegate");ye(this,"negate");ye(this,"comment");ye(this,"empty");ye(this,"preserveMultipleSlashes");ye(this,"partial");ye(this,"globSet");ye(this,"globParts");ye(this,"nocase");ye(this,"isWindows");ye(this,"platform");ye(this,"windowsNoMagicRoot");ye(this,"maxGlobstarRecursion");ye(this,"regexp");Fa(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||Q0,this.isWindows=this.platform==="win32";const i="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);const i=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((a,u,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const f=a[0]===""&&a[1]===""&&(a[2]==="?"||!hv.test(a[2]))&&!hv.test(a[3]),p=/^[a-z]:/i.test(a[0]);if(f)return[...a.slice(0,4),...a.slice(4).map(m=>this.parse(m))];if(p)return[a[0],...a.slice(1).map(m=>this.parse(m))]}return a.map(f=>this.parse(f))});if(this.debug(this.pattern,s),this.set=s.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){const u=this.set[a];u[0]===""&&u[1]===""&&this.globParts[a][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(const i of t)for(let s=0;s<i.length;s++)i[s]==="**"&&(i[s]="*");const{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s!==i&&r.splice(i,s-i)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((i,s)=>{const a=i[i.length-1];return s==="**"&&a==="**"?i:s===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(i.pop(),i):(i.push(s),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const a=t[s];s===1&&a===""&&t[0]===""||(a==="."||a==="")&&(r=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){const s=t[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(s))&&(r=!0,t.splice(i-1,2),i-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let i of t){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let u=s;for(;i[u+1]==="**";)u++;u>s&&i.splice(s+1,u-s);let l=i[s+1];const f=i[s+2],p=i[s+3];if(l!==".."||!f||f==="."||f===".."||!p||p==="."||p==="..")continue;r=!0,i.splice(s,1);const m=i.slice(0);m[s]="**",t.push(m),s--}if(!this.preserveMultipleSlashes){for(let u=1;u<i.length-1;u++){const l=i[u];u===1&&l===""&&i[0]===""||(l==="."||l==="")&&(r=!0,i.splice(u,1),u--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let a=0;for(;(a=i.indexOf("..",a+1))!==-1;){const u=i[a-1];if(u&&u!=="."&&u!==".."&&u!=="**"){r=!0;const f=a===1&&i[a+1]==="**"?["."]:[];i.splice(a-1,2,...f),i.length===0&&i.push(""),a-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let i=r+1;i<t.length;i++){const s=this.partsMatch(t[r],t[i],!this.preserveMultipleSlashes);if(s){t[r]=[],t[i]=s;break}}return t.filter(r=>r.length)}partsMatch(t,r,i=!1){let s=0,a=0,u=[],l="";for(;s<t.length&&a<r.length;)if(t[s]===r[a])u.push(l==="b"?r[a]:t[s]),s++,a++;else if(i&&t[s]==="**"&&r[a]===t[s+1])u.push(t[s]),s++;else if(i&&r[a]==="**"&&t[s]===r[a+1])u.push(r[a]),a++;else if(t[s]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(l==="b")return!1;l="a",u.push(t[s]),s++,a++}else if(r[a]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(l==="a")return!1;l="b",u.push(r[a]),s++,a++}else return!1;return t.length===r.length&&u}parseNegate(){if(this.nonegate)return;const t=this.pattern;let r=!1,i=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)r=!r,i++;i&&(this.pattern=t.slice(i)),this.negate=r}matchOne(t,r,i=!1){let s=0,a=0;if(this.isWindows){const l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),p=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),m=!p&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),d=f?3:l?0:void 0,g=m?3:p?0:void 0;if(typeof d=="number"&&typeof g=="number"){const[y,x]=[t[d],r[g]];y.toLowerCase()===x.toLowerCase()&&(r[g]=y,a=g,s=d)}}const{optimizationLevel:u=1}=this.options;return u>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(Tt)?de(this,Vt,tb).call(this,t,r,i,s,a):de(this,Vt,Si).call(this,t,r,i,s,a)}braceExpand(){return eb(this.pattern,this.options)}parse(t){Fa(t);const r=this.options;if(t==="**")return Tt;if(t==="")return"";let i,s=null;(i=t.match(zM))?s=r.dot?WM:BM:(i=t.match(CM))?s=(r.nocase?r.dot?LM:$M:r.dot?IM:kM)(i[1]):(i=t.match(HM))?s=(r.nocase?r.dot?qM:UM:r.dot?GM:ZM)(i):(i=t.match(MM))?s=r.dot?NM:DM:(i=t.match(FM))&&(s=jM);const a=ou.fromGlob(t,this.options).toMMPattern();return s&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:s}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const r=this.options,i=r.noglobstar?YM:r.dot?XM:JM,s=new Set(r.nocase?["i"]:[]);let a=t.map(f=>{const p=f.map(d=>{if(d instanceof RegExp)for(const g of d.flags.split(""))s.add(g);return typeof d=="string"?nD(d):d===Tt?Tt:d._src});p.forEach((d,g)=>{const y=p[g+1],x=p[g-1];d!==Tt||x===Tt||(x===void 0?y!==void 0&&y!==Tt?p[g+1]="(?:\\/|"+i+"\\/)?"+y:p[g]=i:y===void 0?p[g-1]=x+"(?:\\/|\\/"+i+")?":y!==Tt&&(p[g-1]=x+"(?:\\/|\\/"+i+"\\/)"+y,p[g+1]=Tt))});const m=p.filter(d=>d!==Tt);if(this.partial&&m.length>=1){const d=[];for(let g=1;g<=m.length;g++)d.push(m.slice(0,g).join("/"));return"(?:"+d.join("|")+")"}return m.join("/")}).join("|");const[u,l]=t.length>1?["(?:",")"]:["",""];a="^"+u+a+l+"$",this.partial&&(a="^(?:\\/|"+u+a.slice(1,-1)+l+")$"),this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;const i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const a=this.set;this.debug(this.pattern,"set",a);let u=s[s.length-1];if(!u)for(let l=s.length-2;!u&&l>=0;l--)u=s[l];for(const l of a){let f=s;if(i.matchBase&&l.length===1&&(f=[u]),this.matchOne(f,l,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return xt.defaults(t).Minimatch}}Vt=new WeakSet,tb=function(t,r,i,s,a){const u=r.indexOf(Tt,a),l=r.lastIndexOf(Tt),[f,p,m]=i?[r.slice(a,u),r.slice(u+1),[]]:[r.slice(a,u),r.slice(u+1,l),r.slice(l+1)];if(f.length){const S=t.slice(s,s+f.length);if(!de(this,Vt,Si).call(this,S,f,i,0,0))return!1;s+=f.length,a+=f.length}let d=0;if(m.length){if(m.length+s>t.length)return!1;let S=t.length-m.length;if(de(this,Vt,Si).call(this,t,m,i,S,0))d=m.length;else{if(t[t.length-1]!==""||s+m.length===t.length||(S--,!de(this,Vt,Si).call(this,t,m,i,S,0)))return!1;d=m.length+1}}if(!p.length){let S=!!d;for(let E=s;E<t.length-d;E++){const R=String(t[E]);if(S=!0,R==="."||R===".."||!this.options.dot&&R.startsWith("."))return!1}return i||S}const g=[[[],0]];let y=g[0],x=0;const h=[0];for(const S of p)S===Tt?(h.push(x),y=[[],0],g.push(y)):(y[0].push(S),x++);let w=g.length-1;const v=t.length-d;for(const S of g)S[1]=v-(h[w--]+S[0].length);return!!de(this,Vt,Yc).call(this,t,g,s,0,i,0,!!d)},Yc=function(t,r,i,s,a,u,l){const f=r[s];if(!f){for(let d=i;d<t.length;d++){l=!0;const g=t[d];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return l}const[p,m]=f;for(;i<=m;){if(de(this,Vt,Si).call(this,t.slice(0,i+p.length),p,a,i,0)&&u<this.maxGlobstarRecursion){const y=de(this,Vt,Yc).call(this,t,r,i+p.length,s+1,a,u+1,l);if(y!==!1)return y}const g=t[i];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1;i++}return a||null},Si=function(t,r,i,s,a){let u,l,f,p;for(u=s,l=a,p=t.length,f=r.length;u<p&&l<f;u++,l++){this.debug("matchOne loop");let m=r[l],d=t[u];if(this.debug(r,m,d),m===!1||m===Tt)return!1;let g;if(typeof m=="string"?(g=d===m,this.debug("string match",m,d,g)):(g=m.test(d),this.debug("pattern match",m,d,g)),!g)return!1}if(u===p&&l===f)return!0;if(u===p)return i;if(l===f)return u===p-1&&t[u]==="";throw new Error("wtf?")};xt.AST=ou;xt.Minimatch=su;xt.escape=PM;xt.unescape=Co;var Zf=(e=>(e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.WELCOME="welcome",e.SETTINGS="settings",e.ROOT="root",e.REPORTS="report",e))(Zf||{});const wr={CLASSES:"Classes",METHODS:"Methods",SHARED:"Shared",WEBFORMS:"WebForms",CLASSES_FOLDER:"ClassesFolder",REPORTS:"Reports",DEBUGGER:"Debugger"};var ke=(e=>(e.FOLDER="folder",e.WEBFORM="webform",e.REPORT="report",e.METHOD="method",e.CLASS="class",e.CLASS_FOLDER="classfolder",e.DEBUGGER="debugger",e.WELCOME="welcome",e.SETTINGS="settings",e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.DEBUGGERS="debugger",e.MODELS="models",e.ROLES="roles",e.HTTP_HANDLERS="http-handlers",e.LOCALIZATION="localization",e.MODEL="model",e.DATA_EXPLORER="dataexplorer",e.MOBILE="mobile",e.MOBILEFORM="mform",e.FILE="file",e.TEXT="text",e))(ke||{}),Cn=(e=>(e.GET_FOLDER="getFolder",e.GET="get",e.SAVE="save",e.RENAME="rename",e.DROP="drop",e.ADD_FOLDER="addFolder",e.CREATE_FOLDER="mkdir",e.RENAME_FOLDER="renameFolder",e.DROP_FOLDER="dropFolder",e.REMOVE_ITEM="removeItem",e.MOVE_ITEM="moveItem",e.GET_INFO="getInfo",e.SAVE_CONTENT="save",e.UPDATE_CHECK="update:check",e.UPDATE_INSTALL="update:install",e.GET_APP_SETTINGS="getWebServerInfo",e.GET_FILE_CONTENT="getFileContent",e.SET_FILE_CONTENT="setFileContent",e.GET_FILES_INFO="getFilesInfo",e))(Cn||{}),Vf=(e=>(e[e.DISABLED=0]="DISABLED",e[e.ENABLED=1]="ENABLED",e))(Vf||{});const Kf="roles.json",Yf="qodlyApp.json",rb="model.4DModel",Xf="HTTPHandlers.json",Jf="Shared/i18n.json",nb=[{pattern:Yf,editor:{key:"editors:settings"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:Kf,editor:{key:"editors:roles"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:Xf,editor:{key:"editors:http-handlers"},supportedEditors:[{key:"editors:code",config:{language:"json"}}]},{pattern:Jf,editor:{key:"editors:localization"},supportedEditors:[{key:"editors:code",config:{language:"json"}}]},{pattern:rb,editor:{key:"editors:model"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:"**/*.webform",editor:{key:"editors:webforms"},supportedEditors:[{key:"editors:event-report"},{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:"**/*.qodoc",editor:{key:"editors:reports"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:"Methods/*.4dm",editor:{key:"editors:code:method",config:{theme:"fd-dark",language:"4d"}}},{pattern:"Methods/*.4qs",editor:{key:"editors:code:method",config:{theme:"fd-dark",language:"4d"}}},{pattern:"Classes/*.4dm",editor:{key:"editors:code",config:{theme:"fd-dark",language:"4d"}}},{pattern:"Classes/*.4qs",editor:{key:"editors:code",config:{theme:"fd-dark",language:"4d"}}},{pattern:"**/*.+(json)",editor:{key:"editors:code",config:{language:"json"}}},{pattern:"**/*.+(js)",editor:{key:"editors:code",config:{language:"js"}}},{pattern:"**/*.+(css)",editor:{key:"editors:code",config:{language:"css"}}},{pattern:"**/*.+(txt)",editor:{key:"editors:code",config:{language:""}}},{pattern:"Debugger/*",editor:{key:"editors:code",config:{theme:"fd-dark",language:"4d"}}},{pattern:"**/*.+(png|jpeg|jpg|gif|svg)",editor:{key:"editors:img"}}];function iD(e){const t=Qf(e);switch(t){case ke.SETTINGS:return{filename:"Settings",type:t};case ke.HTTP_HANDLERS:return{filename:"HTTP Handlers",type:t};case ke.ROLES:return{filename:"Roles & Privileges",type:t};case ke.LOCALIZATION:return{filename:"Localization",type:t};case ke.MODEL:return{filename:"Model",type:t};default:{const r=e.split("/"),[i]=r[1].split(".");return{filename:i,type:t}}}}function oD(e){const t=nb.find(({pattern:r})=>xt(e,r,{nocase:!0}));return t||{pattern:"",editor:{key:"editors:unknown",config:{language:"text"}}}}function Qf(e){const t=e.split("."),r=t.pop(),i=t.join(".").split("/")[0];switch(!0){case r==="4DModel":return ke.MODEL;case r==="WebForm":return ke.WEBFORM;case(["4dm","4qs","4qm"].includes(r)&&i===wr.METHODS):return ke.METHOD;case(["4dm","4qs","4qm"].includes(r)&&i===wr.CLASSES):return ke.CLASS;case e===Kf:return ke.ROLES;case e===Xf:return ke.HTTP_HANDLERS;case e===Yf:return ke.SETTINGS;case e===Jf:return ke.LOCALIZATION;default:return ke.TEXT}}function ib(e,t=!1){switch(e){case wr.REPORTS:case"report":return"QoDoc";case wr.WEBFORMS:case"webform":return"WebForm";case"Mobile":case"mform":return"MForm";case"class":case"method":case wr.CLASSES:case wr.METHODS:return t?"4qs":"4dm";default:return""}}function sD(e,t=""){const r=new RegExp("(?<=\\/)(\\w+)(?=\\.)").exec(e);return r?r[1]:t}function aD(e,t,r){switch(t){case ke.MOBILEFORM:return`${e}.MForm`;case ke.WEBFORM:return`${e}.WebForm`;case ke.REPORT:return`${e}.QoDoc`;case ke.METHOD:case ke.CLASS:return`${e}.${r?"4qs":"4dm"}`;default:return e}}class ob{constructor(){this.current=Promise.resolve()}lock(){let t;const r=new Promise(s=>{t=s}),i=this.current.then(()=>t);return this.current=r,i}}function ed(){const e=new ob;return async t=>{const r=await e.lock();try{const i=await t();return r(),i}catch(i){console.error(i),r();return}}}const uD="4DWS_PREFS",sb=Ie.curry((e,t,r)=>e&&Ie.get(r,e)===t),lD=Ie.curry((e,t,r)=>Ie.get(r,e)!==t),cD=Ie.curry((e,t)=>Ie.get(t,"id")!==e),fD=Ie.curry((e,t)=>Ie.get(t,"id")===e),dD=Ie.curry((e,t)=>Ie.get(t,"path")===e);function pD(e="id",t,r){return r.findIndex(sb(e,t))!==-1}function ab(e,t){return e==null?void 0:e.localeCompare(t,void 0,{numeric:!0})}function hD(){try{const e=localStorage.getItem(uD);return{...e?JSON.parse(e):{},"features.experimental.i18n":!0}}catch(e){console.error(e)}}function gD(e){if(!e)return"";const{id:t,namespace:r}=e;return r&&t?`${r}:${t}`:t}function td(e=""){const t=e.trim().split(":")||[];let r="",i="";return t.length>1?(r=t[1],i=t[0]):r=t[0],{id:r,namespace:i,root:r.split(".").filter(Boolean)[0],original:i?`${i}:${r}`:r,parts:t}}function ub(e){return["bool","word","string","text","uuid","short","long","number","long64","duration","object","date","image","blob"].includes(e.type||"")}function mD(e){return e.type==="object"}function lb(e){var t;return e.kind==="relatedEntities"||((t=e.type)==null?void 0:t.includes("Selection"))||e.behavior==="relatedEntities"}function cb(e){return e.kind==="relatedEntity"||e.behavior==="relatedEntity"||!ub(e)}function vD(e){return lb(e)||cb(e)}function yD(e){return e.applyTo==="dataStore"}function bD(e){return e.applyTo==="dataClass"}function wD(e){return e.applyTo==="entity"}function xD(e){return e.applyTo==="entityCollection"}function SD(e){return e.type==="entity"}function ED(e){return e.type==="entitysel"}function fb(e){return e.dataType==="array"}function db(e){return e.dataType==="object"}function pb(e){return e.type==="scalar"}function _D(e){return fb(e)||db(e)||pb(e)}const TD=e=>e!=null&&e.type==="entity",OD=e=>e.type==="entitysel",AD=e=>e.type==="array"||e.type==="scalar"&&e.dataType==="array",RD=e=>e.type==="object"||e.type==="scalar"&&e.dataType==="object",PD=e=>e.type==="scalar"&&e.dataType==="date",CD=(e,t)=>(e||"")===(t||"");function kD(){return new Promise((e,t)=>{window.addEventListener("bundle:ready",r=>r.data?e():t(r.caughtErr))})}function ID(){return new Promise(e=>{window.addEventListener("i18n:ready",()=>e())})}const ko="Qodly",hb="Location",gb="UserLanguage",mb="Title",ja={[ko]:[{id:mb,dataType:"string",type:"scalar",namespace:ko,initialValue:""},{id:hb,dataType:"object",type:"scalar",namespace:ko,initialValue:{urlQuery:[],urlPath:{},Anchor:""},schema:{type:"object",properties:[{name:"urlQuery",type:"object",initialValue:{}},{name:"urlPath",type:"array",initialValue:[]},{name:"Anchor",type:"string",initialValue:""}]}},{id:gb,dataType:"object",type:"scalar",namespace:ko,initialValue:{selected:{},supported:[]},schema:{type:"object",properties:[{name:"selected",type:"object",initialValue:{},attributes:[{name:"isocode",type:"string"},{name:"local",type:"string"},{name:"native",type:"string"},{name:"flag",type:"string"}]},{name:"supported",type:"array",initialValue:[],attributes:[{name:"isocode",type:"string"},{name:"local",type:"string"},{name:"native",type:"string"},{name:"flag",type:"string"}]}]}}]};var qo=(e=>(e.capable="capable",e.incapable="incapable",e.indifferent="indifferent",e))(qo||{}),vb=(e=>(e.soap="soap",e.web="web",e.sql="sql",e.rest="rest",e))(vb||{}),rd=(e=>(e.table="table",e.catalog="catalog",e.currentRecord="currentRecord",e.currentSelection="currentSelection",e))(rd||{});const $D={publishedSoap:"soap",publishedWeb:"web",publishedSql:"sql",publishedRest:"rest"};function LD(e){var a;let t={};try{const u=((a=e.match(/\/\/%attributes = (.*)/))==null?void 0:a[1])||"";t=JSON.parse(u)}catch{}const{published4DMobile:r,...i}=t;return{...{invisible:!1,shared:!1,executedOnServer:!1,preemptive:qo.indifferent,publishedSoap:!1,publishedWsdl:!1,publishedWeb:!1,publishedSql:!1,publishedRest:!!r,publishedRestOptions:r||{table:"",scope:rd.table}},...i}}function yb(e){const t={};return e.invisible&&(t.invisible=!0),e.shared&&(t.shared=!0),e.executedOnServer&&(t.executedOnServer=!0),e.preemptive&&[qo.capable,qo.incapable].includes(e.preemptive)&&(t.preemptive=e.preemptive),e.publishedSoap&&(t.publishedSoap=!0,e.publishedWsdl&&(t.publishedWsdl=!0)),e.publishedWeb&&(t.publishedWeb=!0),e.publishedSql&&(t.publishedSql=!0),e.publishedRest&&e.publishedRestOptions&&(t.published4DMobile=e.publishedRestOptions),JSON.stringify(t).replace(/"(true|false)"/g,"$1")}function MD(e,t,r=!1){const i=Ie.isString(t)?t:yb(t);if(!r&&bb(e))return e;const s=wb(e);return`//%attributes = ${i}\r
|
|
204
|
-
${s}`}function bb(e){return/^\/\/%attributes.*(?:\r\n|\n)?/g.test(e)}function wb(e){return e.replace(/^\/\/%attributes.*(?:\r\n|\n)?/g,"")}const Xc=()=>On.uuid().replaceAll("-","").toUpperCase();function DD(e){var s,a;const t=new Map,r=new Map,i=new Map;return(s=e.singletons)==null||s.forEach(({methods:u=[],...l})=>{i.set(l.name,{...l,methods:u})}),(a=e.dataClasses)==null||a.forEach(({methods:u=[],...l})=>{const f={...l,methods:u};if(f.uuid||(f.uuid=Xc()),f.attributes){const p=["storage","relatedEntity"];f.attributes=f.attributes.map(m=>p.includes(m.kind)&&!m.uuid?{...m,uuid:Xc()}:m)}r.set(f.className,f),t.set(f.collectionName,f)}),{...e,methods:e.methods||[],dataClasses:Object.fromEntries(r.entries()),dataClassByCollectionName:Object.fromEntries(t.entries()),singletons:Object.fromEntries(i.entries())}}const ND=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/_{2,}/g,"_").replace(/^_|_$/g,"");var ze=(e=>(e.DATACLASS="dataclass",e.METHOD="method",e.ATTRIBUTE="attribute",e.DATASTORE="datastore",e.SINGLETON="singleton",e.SINGLETON_METHOD="singletonMethod",e))(ze||{}),Ke=(e=>(e.DS_METHOD="dsMethod",e.DATACLASS_METHOD="dataclassMethod",e.ENTITY_METHOD="entityMethod",e.ENTITY_SEL_METHOD="entityselMethod",e))(Ke||{});const FD=[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE,ze.SINGLETON_METHOD,ze.SINGLETON,ze.METHOD,Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD],gv=e=>[Ke.DS_METHOD,Ke.ENTITY_METHOD,Ke.DATACLASS_METHOD].includes(e)?ze.METHOD:e,za="guest",nd=[{key:"read",label:"Read",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"create",label:"Create",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"update",label:"Update",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"drop",label:"Delete",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"execute",label:"Execute",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.METHOD,Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD,ze.SINGLETON,ze.SINGLETON_METHOD]},{key:"promote",label:"Promote",canApplyTo:[ze.METHOD,Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD,ze.SINGLETON_METHOD]}];function lr(e,...t){return Array.from(new Set([...e,...t]))}function xb(e){const t={},r=new Map;e.forEach(f=>{const p=f.id||On.generate();t[p]={...f,id:p,parents:[],includes:lr(f.includes||[]),resources:[]},r.set(f.privilege,p)}),Object.entries(t).forEach(([f,p])=>{const m=p.includes.map(d=>{const g=r.get(d);return g?(t[g].parents=lr(t[g].parents,g),g):""}).filter(Boolean);t[f]={...p,includes:m}});const i=Sb(t),s=new Set;function a(f){s.add(f.id),f.includes=f.includes.filter(p=>!s.has(p))}if(i.forEach(a),i.forEach(f=>f.parents=[]),i.forEach(f=>{f.includes.forEach(p=>t[p].parents.push(f.id))}),Object.values(t).find(({privilege:f})=>f===za))return t;const l=On.generate();return{[l]:{id:l,privilege:za,includes:[],parents:[],resources:[]},...t}}function Sb(e){return Object.values(e).sort((t,r)=>t.parents.length-r.parents.length)}function au(e,t){const r=t[e];let i=[];return r&&r.parents.forEach(s=>{i=lr(i,...au(s,t),s)}),i}function Ba(e,t){const r=t[e];let i=[];return r&&r.includes.forEach(s=>{i=lr(i,...Ba(s,t),s)}),i}function jD(e,t){const r=t[e];if(!r)return[];const i=[e,...au(e,t),...r.includes];return Object.keys(t).filter(s=>!i.includes(s))}function zD(e,t){return t[e]?Object.keys(t).reduce((i,s)=>s===e?i:{...i,[s]:{...t[s],parents:t[s].parents.filter(a=>a!==e),includes:t[s].includes.filter(a=>a!==e)}},{}):t}function BD(e,t,r){const i=r[e],s=r[t];return!i||!s?r:{...r,[e]:{...r[e],includes:lr(i.includes,t)},[t]:{...r[t],parents:lr(s.parents,e)}}}function WD(e,t,r){const i=r[e],s=r[t];return!i||!s?r:{...r,[e]:{...r[e],includes:r[e].includes.filter(a=>a!==t)},[t]:{...r[t],parents:r[t].parents.filter(a=>a!==e)}}}function HD(e,t){nu(e),Object.entries(t).forEach(([,{privilege:i}])=>{if(e.toLowerCase()===i.toLowerCase())throw new Error(`There's already a Privilege with the name ${e}`)});const r=On.generate();return{[r]:{id:r,privilege:e,includes:[],parents:[],resources:[]},...t}}function UD(e,t,r){if(!e)throw new Error("Please enter a name");if(!r[t])throw new Error("Invalid privilege");return Object.entries(r).forEach(([,{privilege:i,id:s}])=>{if(e.toLowerCase()===i.toLowerCase()&&t!==s)throw new Error(`There's already a Privilege with the name ${e}`)}),{...r,[t]:{...r[t],privilege:e}}}function qD(e,t){return e.map(r=>rn(r,t))}function rn(e,t){return t[e]?t[e]:null}function Eb({applyTo:e,type:t,...r}){return Object.entries(r).reduce((i,[s,a])=>{const u=Ie.find(nd,["key",s]);return!u||!u.canApplyTo.includes(t)||(typeof a=="string"?a.split(","):a).forEach(f=>{i[f]=lr(i[f]||[],s)}),i},{})}const mv=(e,t=!1)=>["read","create","update","delete"].includes(e.toLowerCase())?`All ${t?"dataclasses and ":""}attributes have the '${e.toLowerCase()}' permission`:e.toLowerCase()==="execute"?`All functions defined ${t?"through the model (DataStore, Dataclasses, Entity selections, Entities) have the execute permission":"on this Dataclass, Entity selection class, Entity class have the execute permission"}`:`All ${t?"dataclasses, ":""}attributes and functions have the '${e.toLowerCase()}' permission`;function id(e){return{permissions:nd.filter(({canApplyTo:t})=>t.includes(e.type)).map(({key:t,label:r})=>{const i={name:t,from:[]};switch(e.type){case ze.DATASTORE:return{...i,info:mv(r,!0)};case ze.DATACLASS:return{...i,info:mv(r)};default:return i}}),resource:e.applyTo,type:e.type}}function _b(e,t){const r=Tb(t),i={};return e.filter(({type:s})=>FD.includes(s)).forEach(s=>{const a=Eb(s);Object.entries(a).forEach(([u,l])=>{var m;const f=(m=r[u])==null?void 0:m.id;if(!f)return;i[f]=i[f]||{...t[f]};let p=Ie.find(i[f].resources,{resource:s.applyTo,type:s.type});p||(p=id(s),i[f].resources.push(p)),p.permissions=p.permissions.map(d=>({...d,checked:d.checked||l.includes(d.name)}))})}),{...t,...i}}function Tb(e){return Object.values(e).reduce((t,r)=>({...t,[r.privilege]:r}),{})}function GD(e){var r;if(!e)throw new Error("Invalid roles data");const t=xb(e.privileges||[]);return{forceLogin:(e==null?void 0:e.forceLogin)||!1,restrictedByDefault:(e==null?void 0:e.restrictedByDefault)||!1,privileges:_b(((r=e==null?void 0:e.permissions)==null?void 0:r.allowed)||[],t),roles:((e==null?void 0:e.roles)||[]).map(({id:i=On.generate(),role:s,privileges:a=[]})=>({id:i,role:s,privileges:lr(a).map(u=>{var l;return(l=Object.values(t).find(({privilege:f})=>f===u))==null?void 0:l.id}).filter(Boolean)})).reduce((i,s)=>({...i,[s.id]:{...s}}),{})}}function ZD(e){const t=Object.values(e.privileges).filter(({includes:i})=>i.length===0).map(({id:i})=>i),r=[...t,...t.map(i=>au(i,e.privileges).reverse())].flat().filter((i,s,a)=>a.indexOf(i)===s).map(i=>e.privileges[i]);return{forceLogin:e.forceLogin||!1,restrictedByDefault:e.restrictedByDefault||!1,permissions:{allowed:Object.values(e.privileges).reduce((i,s)=>(s.resources.forEach(({permissions:a,resource:u,type:l})=>{let f=Ie.find(i,{applyTo:u,type:gv(l)});f||(f={applyTo:u,type:gv(l)},i.push(f)),a.forEach(({name:p,checked:m})=>{m&&f&&(f[p]=f[p]||[],f[p].push(s.privilege))})}),i),[])},privileges:r.filter(({privilege:i})=>i!==za).map(({id:i,includes:s,privilege:a})=>({id:i,privilege:a,includes:s.map(u=>e.privileges[u].privilege)})),roles:Object.values(e.roles).map(i=>({...i,privileges:i.privileges.map(s=>{var a;return(a=e.privileges[s])==null?void 0:a.privilege}).filter(Boolean)}))}}function VD(e,t){const r=t[e],i={children:[],links:[],parents:[],selected:e};if(!r)return i;function s(l,f,p=[]){const m=l.reduce((d,g)=>[...d,...t[g][f]],[]);return m.length===0?p:(p.push(m),s(m,f,p))}function a(l){const f=[],p=[];for(let m=l.length-1;m>=0;m-=1){const d=l[m].filter(g=>f.includes(g)?!1:(f.push(g),!0));d.length>0&&p.unshift(lr(d))}return p}function u(l,f){const p=[];return l.reduce((m,d)=>(d.forEach(g=>{t[g][f==="parents"?"includes":"parents"].forEach(x=>{p.includes(x)&&m.push(f==="parents"?{source:g,target:x}:{source:x,target:g})}),p.push(g)}),m),[])}return i.children=s([e],"includes"),i.children=a(i.children),i.parents=s([e],"parents"),i.parents=a(i.parents),i.links=[...u([[e],...i.parents],"parents"),...u([[e],...i.children],"includes")],i}function KD(e,t,r){const i=rn(e,r);if(!i||Ie.find(i.resources,{resource:t.applyTo,type:t.type}))return r;const s={...i,resources:[...i.resources,id(t)]};return{...r,[e]:s}}function YD(e,t,r){const i=rn(e,r);if(!i)return r;const s={...i,resources:i.resources.filter(({resource:a,type:u})=>a!==t.applyTo||u!==t.type)};return{...r,[e]:s}}function XD(e,t){const r=Object.entries(e).map(([i,s])=>{const a=rn(i,t);if(!a)return{[i]:t[i]};const u={...a,resources:a.resources.filter(({resource:l,type:f})=>!s.some(p=>p.applyTo===l&&p.type===f))};return{[i]:u}}).reduce((i,s)=>({...i,...s}),{});return{...t,...r}}function JD(e,t){const r=rn(e,t);if(!r)return t;const i={...r,resources:r.resources.filter(s=>s.permissions.some(a=>a.from.length)).map(s=>({...s,permissions:s.permissions.map(a=>({...a,checked:!1}))}))};return{...t,[e]:i}}function QD(e,t,r,i){const s=rn(e,i);if(!s)return i;const u=Ie.find(s.resources,{type:t.type,resource:t.resource})?{...s,resources:s.resources.map(l=>l.type===t.type&&l.resource===t.resource?{...l,permissions:t.permissions.map(f=>f.name===r.name?{...f,checked:!f.checked,from:[]}:f)}:l)}:{...s,resources:[...s.resources,{...t,permissions:t.permissions.map(l=>({...l,checked:r.name===l.name,from:[]}))}]};return{...i,[e]:u}}function eN(e,t){var f;const r=Ob(e,t)||[],i=((f=rn(e,t))==null?void 0:f.resources)||[],u=([...r,...i].filter(({type:p})=>[Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD].includes(p))||[]).map(({resource:p})=>p);return Object.entries(t).reduce((p,[m,{resources:d}])=>(d.filter(({resource:g,type:y})=>[Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD].includes(y)&&u.includes(g)).forEach(({permissions:g,resource:y})=>{var h;((h=g.find(({name:w})=>w==="promote"))==null?void 0:h.checked)&&(p[y]=lr(p[y]||[],m))}),p),{})}function Ob(e,t){var u;const r=rn(e,t);if(!r)return[];const i=(u=Object.values(t).find(l=>l.privilege===za))==null?void 0:u.id;return(i&&i!==e?lr(Ba(e,t),i):Ba(e,t)).reduce((l,f)=>(t[f].resources.forEach(m=>{if(m.permissions.filter(({checked:y,name:x})=>y&&x!=="promote").length===0)return;const g=Ie.find(l,{type:m.type,resource:m.resource});if(!g){l.push({...m,permissions:m.permissions.map(y=>({...y,from:y.checked?[f]:[],checked:!1}))});return}g.permissions=g.permissions.map((y,x)=>{let{from:h=[]}=y;return m.permissions[x].checked&&!h.includes(f)&&(h=[...h,f]),{...y,from:h,checked:y.checked}})}),l),Ie.clone(r.resources.map(l=>({...l,permissions:l.permissions.map(({checked:f,...p})=>({...p,checked:!!f}))}))))}const tN=(e,t,r)=>{const i={id:e,role:t,privileges:[]};return{...r,[i.id]:i}},rN=(e,t)=>t[e]?Object.values(t).reduce((r,i)=>e===i.id||i.role===""?r:{...r,[i.id]:i},{}):t,nN=(e,t)=>{if(nu(e.role),Object.values(t).find(i=>i.role===e.role))throw new Error(`a role with the name ${e.role} already exists`);return Object.values(t).reduce((i,s)=>e.id===s.id?{...i,[e.id]:e}:{...i,[s.id]:s},{})};function Ab(e){var r;if(!e||typeof e!="object")return[];const t=((r=e.__STATUS)==null?void 0:r.errors)??e.__ERRORS??e.errorStack;return Array.isArray(t)?t:[]}function Rb(e,t){return t?e.filter(r=>r.seriousError===!0):[]}function iN(e,t){const r=Ab(e);return Rb(r,t)}function oN(e){const t=e.map(r=>typeof r.message=="string"?r.message:String(r));return t.length===0?[]:[{messages:t}]}var Pb=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(Pb||{}),Cb=(e=>(e.GROUP="group",e.TEXT_FIELD="textfield",e.COLOR_PICKER="colorpicker",e.LAYOUT="layout",e.RADIOGROUP="radiogroup",e.SELECT="select",e.BORDERS="borders",e.BORDER_RADIUS="borderRadius",e.DIMENSIONS="dimensions",e.COMBOBOX="combobox",e.UNITFIELD="unitfield",e.DATAGRID="datagrid",e.CHECKBOX="checkbox",e.NUMBER_FIELD="number",e.FORMAT_FIELD="format",e.DISPLAY="display",e.BOXSHADOW="boxshadow",e.CSSCLASS_SELECTOR="cssClassSelector",e.CUSTOM_STYLE_PROPS_SELECTOR="customStylePropertiesSelector",e.ICON_PICKER="iconPicker",e.ASYNC_SELECT="asyncSelect",e.DS_AUTO_SUGGEST="dsAutoSuggest",e.POSITION="position",e.BACKGROUND="background",e.SELECTBOXLENGTH="selectBoxLength",e.I18NFIELD="i18nField",e.DATE_INTERVALS="dateIntervals",e))(Cb||{}),kb=(e=>(e.SHOW_AFTER_TIMEOUT="show_after_timeout",e.HIDE_AFTER_TIMEOUT="hide_after_timeout",e))(kb||{}),od=(e=>(e.AIRY="airy",e.COMPACT="neutral",e))(od||{}),Ib=(e=>(e.GRID="grid",e.COMPACT="compact",e))(Ib||{}),$b=(e=>(e[e.METHOD=1]="METHOD",e[e.CLASS=10]="CLASS",e))($b||{}),Lb=(e=>(e.WelCome="WelCome",e.ActionPanel="ActionPanel",e.SideBar="SideBar",e.Settings="Settings",e.Main="Main",e.Explorer="Explorer",e.Header="Header",e.ComponentList="ComponentList",e))(Lb||{});const sN={SIDEBAR_SECTION_RESIZABLE:"sidebar.section.resizable"};var Mb=(e=>(e[e.FILE_NOT_FOUND=1839]="FILE_NOT_FOUND",e[e.JSON_MALFORMED=554]="JSON_MALFORMED",e[e.JSON_MALFORMED_AT_LINE=550]="JSON_MALFORMED_AT_LINE",e))(Mb||{});const Db={label:"Base",id:"root"},aN=["rounded-full","rounded-lg","border-gray-400","border-2","bg-red-500","bg-blue-500","bg-indigo-500","bg-transparent","bg-primary-dark","bg-green-500","bg-yellow-400","text-gray-500","text-4xl","text-white","px-4","py-2","primary","info","secondary","success","warning","danger","w-10","w-20","w-40","w-60","w-80","mb-2","mb-3","shadow","shadow-lg","shadow-xl","shadow-2xl"],uN=e=>e.id===Db.id,sd=(e,t,r="")=>t?e.type==="currentState"&&e.value===t?{...e,value:r}:e.type==="combination"&&e.conditions?{...e,conditions:e.conditions.map(i=>sd(i,t,r))}:e:e;function lN(e,t){const{id:r,label:i}=t;return{...e,components:Object.entries(e.components||{}).reduce((s,[a,u])=>({...s,[a]:{...u,custom:Object.entries(u.custom).reduce((l,[f,p])=>f===`states:${r}`?l:{...l,[f]:p},{}),props:Object.entries(u.props).reduce((l,[f,p])=>{let m=p;return f==="events"&&(m=m.map(d=>{var g,y;return d.type==="simple-action"?{...d,state:{...d.state,states:(y=(g=d.state)==null?void 0:g.states)==null?void 0:y.filter(x=>x!==r)}}:d})),{...l,[f]:m}},{})}}),{}),metadata:{...e.metadata,states:e.metadata.states.filter(s=>(s==null?void 0:s.id)!==r).map(s=>s.conditions?{...s,conditions:sd(s.conditions,i)}:s)}}}const Nb=(e,t,r)=>{switch(e.type){case"datasource":return{...e,path:e.path===t?r:e.path,value:e.valueType==="datasource"&&e.value===t?r:e.value,compareValue:e.compareValueType==="datasource"&&e.compareValue===t?r:e.compareValue};case"privilege":case"currentState":case"parentState":if(e.valueType==="datasource")return{...e,value:e.value===t?r:e.value};break;case"combination":return{...e,conditions:(e.conditions||[]).map(i=>Nb(i,t,r))}}return e},Fb=(e,t)=>{if(e.id===t||e.type==="reference"&&e.ref===t)return null;if(e.type==="combination"&&e.conditions){const r=e.conditions.map(i=>Fb(i,t)).filter(Boolean);return r.length===1?{...r[0],id:e.id}:{...e,conditions:r}}return e},jb=e=>e.id?e.type==="combination"&&e.conditions?{...e,conditions:e.conditions.map(jb)}:e:{...e,id:On.generate()};function cN(e,t={}){switch(e){case ke.WEBFORM:case ke.WEBFORMS:{const r={metadata:{v:"1.0",datasources:[],styles:[]},components:{ROOT:{parent:"",type:{resolvedName:"Container"},isCanvas:!0,props:{airyMode:!1,className:"bg-white w-full px-6",classNames:[],events:[]},displayName:"Page",custom:{},hidden:!1,nodes:[],linkedNodes:{}}}};return t["webforms.display-mode"]===od.AIRY&&(r.components.ROOT.props.airyMode=!0),r}case ke.REPORT:return{metadata:{v:"1.0",datasources:[],styles:[]},pages:[{name:"doc",id:"index",components:{ROOT:{type:{resolvedName:"Document"},isCanvas:!0,props:{classNames:[],events:[],airyMode:!1,className:"bg-white w-full px-6"},displayName:"Document",custom:{},parent:"",hidden:!1,nodes:[],linkedNodes:{}}}}]};case ke.METHOD:case ke.METHODS:return`//%attributes = {}
|
|
205
|
-
`;case ke.HTTP_HANDLERS:return[];case ke.LOCALIZATION:case ke.SETTINGS:return{};case ke.ROLES:return{permissions:{allowed:[]},privileges:[],roles:[]};default:return""}}function
|
|
206
|
-
`}t.prototype.toString=function(h){return this.errors.map(r).join("")},Object.defineProperty(t.prototype,"valid",{get:function(){return!this.errors.length}}),yt.ValidatorResultError=i;function i(x){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i),this.instance=x.instance,this.schema=x.schema,this.options=x.options,this.errors=x.errors}i.prototype=new Error,i.prototype.constructor=i,i.prototype.name="Validation Error";var s=yt.SchemaError=function x(h,w){this.message=h,this.schema=w,Error.call(this,h),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,x)};s.prototype=Object.create(Error.prototype,{constructor:{value:s,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var a=yt.SchemaContext=function(h,w,v,S,E){this.schema=h,this.options=w,Array.isArray(v)?(this.path=v,this.propertyPath=v.reduce(function(R,T){return R+l(T)},"instance")):this.propertyPath=v,this.base=S,this.schemas=E};a.prototype.resolve=function(h){return y(this.base,h)},a.prototype.makeChild=function(h,w){var v=w===void 0?this.path:this.path.concat([w]),S=h.$id||h.id;let E=y(this.base,S||"");var R=new a(h,this.options,v,E,Object.create(this.schemas));return S&&!R.schemas[E]&&(R.schemas[E]=h),R};var u=yt.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(x){return typeof x=="string"&&parseFloat(x)===parseInt(x,10)&&!isNaN(x)},regex:function(x){var h=!0;try{new RegExp(x)}catch{h=!1}return h},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};u.regexp=u.regex,u.pattern=u.regex,u.ipv4=u["ip-address"],yt.isFormat=function(h,w,v){if(typeof h=="string"&&u[w]!==void 0){if(u[w]instanceof RegExp)return u[w].test(h);if(typeof u[w]=="function")return u[w](h)}else if(v&&v.customFormats&&typeof v.customFormats[w]=="function")return v.customFormats[w](h);return!0};var l=yt.makeSuffix=function(h){return h=h.toString(),!h.match(/[.\s\[\]]/)&&!h.match(/^[\d]/)?"."+h:h.match(/^\d+$/)?"["+h+"]":"["+JSON.stringify(h)+"]"};yt.deepCompareStrict=function x(h,w){if(typeof h!=typeof w)return!1;if(Array.isArray(h))return!Array.isArray(w)||h.length!==w.length?!1:h.every(function(E,R){return x(h[R],w[R])});if(typeof h=="object"){if(!h||!w)return h===w;var v=Object.keys(h),S=Object.keys(w);return v.length!==S.length?!1:v.every(function(E){return x(h[E],w[E])})}return h===w};function f(x,h,w,v){typeof w=="object"?h[v]=d(x[v],w):x.indexOf(w)===-1&&h.push(w)}function p(x,h,w){h[w]=x[w]}function m(x,h,w,v){typeof h[v]!="object"||!h[v]?w[v]=h[v]:x[v]?w[v]=d(x[v],h[v]):w[v]=h[v]}function d(x,h){var w=Array.isArray(h),v=w&&[]||{};return w?(x=x||[],v=v.concat(x),h.forEach(f.bind(null,x,v))):(x&&typeof x=="object"&&Object.keys(x).forEach(p.bind(null,x,v)),Object.keys(h).forEach(m.bind(null,x,h,v))),v}yt.deepMerge=d,yt.objectGetPath=function(h,w){for(var v=w.split("/").slice(1),S;typeof(S=v.shift())=="string";){var E=decodeURIComponent(S.replace(/~0/,"~").replace(/~1/g,"/"));if(!(E in h))return;h=h[E]}return h};function g(x){return"/"+encodeURIComponent(x).replace(/~/g,"%7E")}yt.encodePath=function(h){return h.map(g).join("")},yt.getDecimalPlaces=function(h){var w=0;if(isNaN(h))return w;typeof h!="number"&&(h=Number(h));var v=h.toString().split("e");if(v.length===2){if(v[1][0]!=="-")return w;w=Number(v[1].slice(1))}var S=v[0].split(".");return S.length===2&&(w+=S[1].length),w},yt.isSchema=function(h){return typeof h=="object"&&h||typeof h=="boolean"};var y=yt.resolveUrl=function(h,w){const v=new URL(w,new URL(h,"resolve://"));if(v.protocol==="resolve:"){const{pathname:S,search:E,hash:R}=v;return S+E+R}return v.toString()};return yt}var wc,yv;function _N(){if(yv)return wc;yv=1;var e=qn(),t=e.ValidatorResult,r=e.SchemaError,i={};i.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var s=i.validators={};s.type=function(d,g,y,x){if(d===void 0)return null;var h=new t(d,g,y,x),w=Array.isArray(g.type)?g.type:[g.type];if(!w.some(this.testType.bind(this,d,g,y,x))){var v=w.map(function(S){if(S){var E=S.$id||S.id;return E?"<"+E+">":S+""}});h.addError({name:"type",argument:v,message:"is not of a type(s) "+v})}return h};function a(m,d,g,y,x){var h=d.throwError,w=d.throwAll;d.throwError=!1,d.throwAll=!1;var v=this.validateSchema(m,x,d,g);return d.throwError=h,d.throwAll=w,!v.valid&&y instanceof Function&&y(v),v.valid}s.anyOf=function(d,g,y,x){if(d===void 0)return null;var h=new t(d,g,y,x),w=new t(d,g,y,x);if(!Array.isArray(g.anyOf))throw new r("anyOf must be an array");if(!g.anyOf.some(a.bind(this,d,y,x,function(S){w.importErrors(S)}))){var v=g.anyOf.map(function(S,E){var R=S.$id||S.id;return R?"<"+R+">":S.title&&JSON.stringify(S.title)||S.$ref&&"<"+S.$ref+">"||"[subschema "+E+"]"});y.nestedErrors&&h.importErrors(w),h.addError({name:"anyOf",argument:v,message:"is not any of "+v.join(",")})}return h},s.allOf=function(d,g,y,x){if(d===void 0)return null;if(!Array.isArray(g.allOf))throw new r("allOf must be an array");var h=new t(d,g,y,x),w=this;return g.allOf.forEach(function(v,S){var E=w.validateSchema(d,v,y,x);if(!E.valid){var R=v.$id||v.id,T=R||v.title&&JSON.stringify(v.title)||v.$ref&&"<"+v.$ref+">"||"[subschema "+S+"]";h.addError({name:"allOf",argument:{id:T,length:E.errors.length,valid:E},message:"does not match allOf schema "+T+" with "+E.errors.length+" error[s]:"}),h.importErrors(E)}}),h},s.oneOf=function(d,g,y,x){if(d===void 0)return null;if(!Array.isArray(g.oneOf))throw new r("oneOf must be an array");var h=new t(d,g,y,x),w=new t(d,g,y,x),v=g.oneOf.filter(a.bind(this,d,y,x,function(E){w.importErrors(E)})).length,S=g.oneOf.map(function(E,R){var T=E.$id||E.id;return T||E.title&&JSON.stringify(E.title)||E.$ref&&"<"+E.$ref+">"||"[subschema "+R+"]"});return v!==1&&(y.nestedErrors&&h.importErrors(w),h.addError({name:"oneOf",argument:S,message:"is not exactly one from "+S.join(",")})),h},s.if=function(d,g,y,x){if(d===void 0)return null;if(!e.isSchema(g.if))throw new Error('Expected "if" keyword to be a schema');var h=a.call(this,d,y,x,null,g.if),w=new t(d,g,y,x),v;if(h){if(g.then===void 0)return;if(!e.isSchema(g.then))throw new Error('Expected "then" keyword to be a schema');v=this.validateSchema(d,g.then,y,x.makeChild(g.then)),w.importErrors(v)}else{if(g.else===void 0)return;if(!e.isSchema(g.else))throw new Error('Expected "else" keyword to be a schema');v=this.validateSchema(d,g.else,y,x.makeChild(g.else)),w.importErrors(v)}return w};function u(m,d){if(Object.hasOwnProperty.call(m,d))return m[d];if(d in m){for(;m=Object.getPrototypeOf(m);)if(Object.propertyIsEnumerable.call(m,d))return m[d]}}s.propertyNames=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=g.propertyNames!==void 0?g.propertyNames:{};if(!e.isSchema(w))throw new r('Expected "propertyNames" to be a schema (object or boolean)');for(var v in d)if(u(d,v)!==void 0){var S=this.validateSchema(v,w,y,x.makeChild(w));h.importErrors(S)}return h}},s.properties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=g.properties||{};for(var v in w){var S=w[v];if(S!==void 0){if(S===null)throw new r('Unexpected null, expected schema in "properties"');typeof y.preValidateProperty=="function"&&y.preValidateProperty(d,v,S,y,x);var E=u(d,v),R=this.validateSchema(E,S,y,x.makeChild(S,v));R.instance!==h.instance[v]&&(h.instance[v]=R.instance),h.importErrors(R)}}return h}};function l(m,d,g,y,x,h){if(this.types.object(m)&&!(d.properties&&d.properties[x]!==void 0))if(d.additionalProperties===!1)h.addError({name:"additionalProperties",argument:x,message:"is not allowed to have the additional property "+JSON.stringify(x)});else{var w=d.additionalProperties||{};typeof g.preValidateProperty=="function"&&g.preValidateProperty(m,x,w,g,y);var v=this.validateSchema(m[x],w,g,y.makeChild(w,x));v.instance!==h.instance[x]&&(h.instance[x]=v.instance),h.importErrors(v)}}s.patternProperties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=g.patternProperties||{};for(var v in d){var S=!0;for(var E in w){var R=w[E];if(R!==void 0){if(R===null)throw new r('Unexpected null, expected schema in "patternProperties"');try{var T=new RegExp(E,"u")}catch{T=new RegExp(E)}if(T.test(v)){S=!1,typeof y.preValidateProperty=="function"&&y.preValidateProperty(d,v,R,y,x);var C=this.validateSchema(d[v],R,y,x.makeChild(R,v));C.instance!==h.instance[v]&&(h.instance[v]=C.instance),h.importErrors(C)}}}S&&l.call(this,d,g,y,x,v,h)}return h}},s.additionalProperties=function(d,g,y,x){if(this.types.object(d)){if(g.patternProperties)return null;var h=new t(d,g,y,x);for(var w in d)l.call(this,d,g,y,x,w,h);return h}},s.minProperties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=Object.keys(d);return w.length>=g.minProperties||h.addError({name:"minProperties",argument:g.minProperties,message:"does not meet minimum property length of "+g.minProperties}),h}},s.maxProperties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=Object.keys(d);return w.length<=g.maxProperties||h.addError({name:"maxProperties",argument:g.maxProperties,message:"does not meet maximum property length of "+g.maxProperties}),h}},s.items=function(d,g,y,x){var h=this;if(this.types.array(d)&&g.items!==void 0){var w=new t(d,g,y,x);return d.every(function(v,S){if(Array.isArray(g.items))var E=g.items[S]===void 0?g.additionalItems:g.items[S];else var E=g.items;if(E===void 0)return!0;if(E===!1)return w.addError({name:"items",message:"additionalItems not permitted"}),!1;var R=h.validateSchema(v,E,y,x.makeChild(E,S));return R.instance!==w.instance[S]&&(w.instance[S]=R.instance),w.importErrors(R),!0}),w}},s.contains=function(d,g,y,x){var h=this;if(this.types.array(d)&&g.contains!==void 0){if(!e.isSchema(g.contains))throw new Error('Expected "contains" keyword to be a schema');var w=new t(d,g,y,x),v=d.some(function(S,E){var R=h.validateSchema(S,g.contains,y,x.makeChild(g.contains,E));return R.errors.length===0});return v===!1&&w.addError({name:"contains",argument:g.contains,message:"must contain an item matching given schema"}),w}},s.minimum=function(d,g,y,x){if(this.types.number(d)){var h=new t(d,g,y,x);return g.exclusiveMinimum&&g.exclusiveMinimum===!0?d>g.minimum||h.addError({name:"minimum",argument:g.minimum,message:"must be greater than "+g.minimum}):d>=g.minimum||h.addError({name:"minimum",argument:g.minimum,message:"must be greater than or equal to "+g.minimum}),h}},s.maximum=function(d,g,y,x){if(this.types.number(d)){var h=new t(d,g,y,x);return g.exclusiveMaximum&&g.exclusiveMaximum===!0?d<g.maximum||h.addError({name:"maximum",argument:g.maximum,message:"must be less than "+g.maximum}):d<=g.maximum||h.addError({name:"maximum",argument:g.maximum,message:"must be less than or equal to "+g.maximum}),h}},s.exclusiveMinimum=function(d,g,y,x){if(typeof g.exclusiveMinimum!="boolean"&&this.types.number(d)){var h=new t(d,g,y,x),w=d>g.exclusiveMinimum;return w||h.addError({name:"exclusiveMinimum",argument:g.exclusiveMinimum,message:"must be strictly greater than "+g.exclusiveMinimum}),h}},s.exclusiveMaximum=function(d,g,y,x){if(typeof g.exclusiveMaximum!="boolean"&&this.types.number(d)){var h=new t(d,g,y,x),w=d<g.exclusiveMaximum;return w||h.addError({name:"exclusiveMaximum",argument:g.exclusiveMaximum,message:"must be strictly less than "+g.exclusiveMaximum}),h}};var f=function(d,g,y,x,h,w){if(this.types.number(d)){var v=g[h];if(v==0)throw new r(h+" cannot be zero");var S=new t(d,g,y,x),E=e.getDecimalPlaces(d),R=e.getDecimalPlaces(v),T=Math.max(E,R),C=Math.pow(10,T);return Math.round(d*C)%Math.round(v*C)!==0&&S.addError({name:h,argument:v,message:w+JSON.stringify(v)}),S}};s.multipleOf=function(d,g,y,x){return f.call(this,d,g,y,x,"multipleOf","is not a multiple of (divisible by) ")},s.divisibleBy=function(d,g,y,x){return f.call(this,d,g,y,x,"divisibleBy","is not divisible by (multiple of) ")},s.required=function(d,g,y,x){var h=new t(d,g,y,x);return d===void 0&&g.required===!0?h.addError({name:"required",message:"is required"}):this.types.object(d)&&Array.isArray(g.required)&&g.required.forEach(function(w){u(d,w)===void 0&&h.addError({name:"required",argument:w,message:"requires property "+JSON.stringify(w)})}),h},s.pattern=function(d,g,y,x){if(this.types.string(d)){var h=new t(d,g,y,x),w=g.pattern;try{var v=new RegExp(w,"u")}catch{v=new RegExp(w)}return d.match(v)||h.addError({name:"pattern",argument:g.pattern,message:"does not match pattern "+JSON.stringify(g.pattern.toString())}),h}},s.format=function(d,g,y,x){if(d!==void 0){var h=new t(d,g,y,x);return!h.disableFormat&&!e.isFormat(d,g.format,this)&&h.addError({name:"format",argument:g.format,message:"does not conform to the "+JSON.stringify(g.format)+" format"}),h}},s.minLength=function(d,g,y,x){if(this.types.string(d)){var h=new t(d,g,y,x),w=d.match(/[\uDC00-\uDFFF]/g),v=d.length-(w?w.length:0);return v>=g.minLength||h.addError({name:"minLength",argument:g.minLength,message:"does not meet minimum length of "+g.minLength}),h}},s.maxLength=function(d,g,y,x){if(this.types.string(d)){var h=new t(d,g,y,x),w=d.match(/[\uDC00-\uDFFF]/g),v=d.length-(w?w.length:0);return v<=g.maxLength||h.addError({name:"maxLength",argument:g.maxLength,message:"does not meet maximum length of "+g.maxLength}),h}},s.minItems=function(d,g,y,x){if(this.types.array(d)){var h=new t(d,g,y,x);return d.length>=g.minItems||h.addError({name:"minItems",argument:g.minItems,message:"does not meet minimum length of "+g.minItems}),h}},s.maxItems=function(d,g,y,x){if(this.types.array(d)){var h=new t(d,g,y,x);return d.length<=g.maxItems||h.addError({name:"maxItems",argument:g.maxItems,message:"does not meet maximum length of "+g.maxItems}),h}};function p(m,d,g){var y,x=g.length;for(y=d+1,x;y<x;y++)if(e.deepCompareStrict(m,g[y]))return!1;return!0}return s.uniqueItems=function(d,g,y,x){if(g.uniqueItems===!0&&this.types.array(d)){var h=new t(d,g,y,x);return d.every(p)||h.addError({name:"uniqueItems",message:"contains duplicate item"}),h}},s.dependencies=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x);for(var w in g.dependencies)if(d[w]!==void 0){var v=g.dependencies[w],S=x.makeChild(v,w);if(typeof v=="string"&&(v=[v]),Array.isArray(v))v.forEach(function(R){d[R]===void 0&&h.addError({name:"dependencies",argument:S.propertyPath,message:"property "+R+" not found, required by "+S.propertyPath})});else{var E=this.validateSchema(d,v,y,S);h.instance!==E.instance&&(h.instance=E.instance),E&&E.errors.length&&(h.addError({name:"dependencies",argument:S.propertyPath,message:"does not meet dependency required by "+S.propertyPath}),h.importErrors(E))}}return h}},s.enum=function(d,g,y,x){if(d===void 0)return null;if(!Array.isArray(g.enum))throw new r("enum expects an array",g);var h=new t(d,g,y,x);return g.enum.some(e.deepCompareStrict.bind(null,d))||h.addError({name:"enum",argument:g.enum,message:"is not one of enum values: "+g.enum.map(String).join(",")}),h},s.const=function(d,g,y,x){if(d===void 0)return null;var h=new t(d,g,y,x);return e.deepCompareStrict(g.const,d)||h.addError({name:"const",argument:g.const,message:"does not exactly match expected constant: "+g.const}),h},s.not=s.disallow=function(d,g,y,x){var h=this;if(d===void 0)return null;var w=new t(d,g,y,x),v=g.not||g.disallow;return v?(Array.isArray(v)||(v=[v]),v.forEach(function(S){if(h.testType(d,g,y,x,S)){var E=S&&(S.$id||S.id),R=E||S;w.addError({name:"not",argument:R,message:"is of prohibited type "+R})}}),w):null},wc=i,wc}var da={},bv;function Qc(){if(bv)return da;bv=1;var e=qn();da.SchemaScanResult=t;function t(r,i){this.id=r,this.ref=i}return da.scan=function(i,s){function a(m,d){if(!d||typeof d!="object")return;if(d.$ref){let h=e.resolveUrl(m,d.$ref);p[h]=p[h]?p[h]+1:0;return}var g=d.$id||d.id;let y=e.resolveUrl(m,g);var x=g?y:m;if(x){if(x.indexOf("#")<0&&(x+="#"),f[x]){if(!e.deepCompareStrict(f[x],d))throw new Error("Schema <"+x+"> already exists with different definition");return f[x]}f[x]=d,x[x.length-1]=="#"&&(f[x.substring(0,x.length-1)]=d)}u(x+"/items",Array.isArray(d.items)?d.items:[d.items]),u(x+"/extends",Array.isArray(d.extends)?d.extends:[d.extends]),a(x+"/additionalItems",d.additionalItems),l(x+"/properties",d.properties),a(x+"/additionalProperties",d.additionalProperties),l(x+"/definitions",d.definitions),l(x+"/patternProperties",d.patternProperties),l(x+"/dependencies",d.dependencies),u(x+"/disallow",d.disallow),u(x+"/allOf",d.allOf),u(x+"/anyOf",d.anyOf),u(x+"/oneOf",d.oneOf),a(x+"/not",d.not)}function u(m,d){if(Array.isArray(d))for(var g=0;g<d.length;g++)a(m+"/"+g,d[g])}function l(m,d){if(!(!d||typeof d!="object"))for(var g in d)a(m+"/"+g,d[g])}var f={},p={};return a(i,s),new t(f,p)},da}var xc,wv;function TN(){if(wv)return xc;wv=1;var e=_N(),t=qn(),r=Qc().scan,i=t.ValidatorResult,s=t.ValidatorResultError,a=t.SchemaError,u=t.SchemaContext,l="/",f=function d(){this.customFormats=Object.create(d.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(m),this.attributes=Object.create(e.validators)};f.prototype.customFormats={},f.prototype.schemas=null,f.prototype.types=null,f.prototype.attributes=null,f.prototype.unresolvedRefs=null,f.prototype.addSchema=function(g,y){var x=this;if(!g)return null;var h=r(y||l,g),w=y||g.$id||g.id;for(var v in h.id)this.schemas[v]=h.id[v];for(var v in h.ref)this.unresolvedRefs.push(v);return this.unresolvedRefs=this.unresolvedRefs.filter(function(S){return typeof x.schemas[S]>"u"}),this.schemas[w]},f.prototype.addSubSchemaArray=function(g,y){if(Array.isArray(y))for(var x=0;x<y.length;x++)this.addSubSchema(g,y[x])},f.prototype.addSubSchemaObject=function(g,y){if(!(!y||typeof y!="object"))for(var x in y)this.addSubSchema(g,y[x])},f.prototype.setSchemas=function(g){this.schemas=g},f.prototype.getSchema=function(g){return this.schemas[g]},f.prototype.validate=function(g,y,x,h){if(typeof y!="boolean"&&typeof y!="object"||y===null)throw new a("Expected `schema` to be an object or boolean");x||(x={});var w=y.$id||y.id;let v=t.resolveUrl(x.base,w||"");if(!h){h=new u(y,x,[],v,Object.create(this.schemas)),h.schemas[v]||(h.schemas[v]=y);var S=r(v,y);for(var E in S.id){var R=S.id[E];h.schemas[E]=R}}if(x.required&&g===void 0){var T=new i(g,y,x,h);return T.addError("is required, but is undefined"),T}var T=this.validateSchema(g,y,x,h);if(T){if(x.throwAll&&T.errors.length)throw new s(T)}else throw new Error("Result undefined");return T};function p(d){var g=typeof d=="string"?d:d.$ref;return typeof g=="string"?g:!1}f.prototype.validateSchema=function(g,y,x,h){var w=new i(g,y,x,h);if(typeof y=="boolean")y===!0?y={}:y===!1&&(y={type:[]});else if(!y)throw new Error("schema is undefined");if(y.extends)if(Array.isArray(y.extends)){var v={schema:y,ctx:h};y.extends.forEach(this.schemaTraverser.bind(this,v)),y=v.schema,v.schema=null,v.ctx=null,v=null}else y=t.deepMerge(y,this.superResolve(y.extends,h));var S=p(y);if(S){var E=this.resolve(y,S,h),R=new u(E.subschema,x,h.path,E.switchSchema,h.schemas);return this.validateSchema(g,E.subschema,x,R)}var T=x&&x.skipAttributes||[];for(var C in y)if(!e.ignoreProperties[C]&&T.indexOf(C)<0){var W=null,N=this.attributes[C];if(N)W=N.call(this,g,y,x,h);else if(x.allowUnknownAttributes===!1)throw new a("Unsupported attribute: "+C,y);W&&w.importErrors(W)}if(typeof x.rewrite=="function"){var F=x.rewrite.call(this,g,y,x,h);w.instance=F}return w},f.prototype.schemaTraverser=function(g,y){g.schema=t.deepMerge(g.schema,this.superResolve(y,g.ctx))},f.prototype.superResolve=function(g,y){var x=p(g);return x?this.resolve(g,x,y).subschema:g},f.prototype.resolve=function(g,y,x){if(y=x.resolve(y),x.schemas[y])return{subschema:x.schemas[y],switchSchema:y};let w=new URL(y,"thismessage::/").hash;var v=w&&w.length&&y.substr(0,y.length-w.length);if(!v||!x.schemas[v])throw new a("no such schema <"+y+">",g);var S=t.objectGetPath(x.schemas[v],w.substr(1));if(S===void 0)throw new a("no such schema "+w+" located in <"+v+">",g);return{subschema:S,switchSchema:y}},f.prototype.testType=function(g,y,x,h,w){if(w!==void 0){if(w===null)throw new a('Unexpected null in "type" keyword');if(typeof this.types[w]=="function")return this.types[w].call(this,g);if(w&&typeof w=="object"){var v=this.validateSchema(g,w,x,h);return v===void 0||!(v&&v.errors.length)}return!0}};var m=f.prototype.types={};return m.string=function(g){return typeof g=="string"},m.number=function(g){return typeof g=="number"&&isFinite(g)},m.integer=function(g){return typeof g=="number"&&g%1===0},m.boolean=function(g){return typeof g=="boolean"},m.array=function(g){return Array.isArray(g)},m.null=function(g){return g===null},m.date=function(g){return g instanceof Date},m.any=function(g){return!0},m.object=function(g){return g&&typeof g=="object"&&!Array.isArray(g)&&!(g instanceof Date)},xc=f,xc}var xv;function ON(){if(xv)return Ar;xv=1;var e=Ar.Validator=TN();return Ar.ValidatorResult=qn().ValidatorResult,Ar.ValidatorResultError=qn().ValidatorResultError,Ar.ValidationError=qn().ValidationError,Ar.SchemaError=qn().SchemaError,Ar.SchemaScanResult=Qc().SchemaScanResult,Ar.scan=Qc().scan,Ar.validate=function(t,r,i){var s=new e;return s.validate(t,r,i)},Ar}var AN=ON();const Go="/$shared",RN={"**/saved_conditions.json":{parser:"json",content:{conditions:[]},schema:{type:"object",properties:{conditions:{type:"array",items:{type:"object"}}},required:["conditions"]}},"**/shared_datasources.json":{parser:"json",content:{},schema:{type:"object",additionalProperties:!0,patternProperties:{"^.*$":{type:"array"}}}},"**/shared_css.json":{parser:"json",content:{classes:[]},schema:{type:"object",properties:{classes:{type:"array",items:{type:"object"}}},required:["classes"]}},"**/shared_app_events.json":{parser:"json",content:[]},"**/CustomComponents/manifest.json":{parser:"json",content:[],schema:{type:"array",items:{type:"object"}}},"**/crafted_components.json":{parser:"json",content:[],schema:{type:"array"}},"**/HTTPHandlers.json":{parser:"json",content:[],schema:{type:"array"}},"**/i18n.json":{parser:"json",content:{keys:{},userLang:{primary:"",supported:[]}},schema:{type:"object",properties:{keys:{type:"object"},userLang:{type:"object",properties:{primary:{type:"string"},supported:{type:"array",items:{type:"string"}}},required:["primary","supported"]}},required:["keys","userLang"]}},"**/*.json":{parser:"json",content:{}}};function Bb(e){const t=Object.entries(RN).find(([r])=>xt(e,r));return t==null?void 0:t[1]}function uu(e){var i;const t=(i=Bb(e))==null?void 0:i.content;if(!t)return;const r=e.replace(`${Go}/`,"Shared/");ad({name:r,content:t,asText:typeof t=="string"})}async function PN(){const e=["CustomComponents/manifest.json","shared_app_events.json","shared_css.json","saved_conditions.json","i18n.json"];for(const t of e)try{await We(`${Go}/${t}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch(r){Wb(r)&&uu(`${Go}/${t}`)}}function es({path:e,createIfNotExists:t=!1}){const r=`${Go}/${e}`;return We(`${r}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(i=>{const s=Bb(e);let a=i;if(!s)return a;if(typeof a=="string")try{switch(s.parser){case"json":a=JSON.parse(a);break;default:break}}catch{throw new Error("Cannot parse")}if(s.schema&&!new AN.Validator().validate(a,s.schema).valid)throw new Error("Invalid Schema");return a}).catch(i=>{if(Wb(i)&&t){const s=CN(i,e);Wf.next({message:s,kind:"warning"}),uu(r)}throw i})}function Wb(e){var t;return((t=e==null?void 0:e.response)==null?void 0:t.status)===404||(e==null?void 0:e.message)==="Invalid Schema"||(e==null?void 0:e.message)==="Cannot parse"||(e==null?void 0:e.name)==="SyntaxError"}function CN(e,t){var r;switch(!0){case((e==null?void 0:e.message)==="Cannot parse "||(e==null?void 0:e.name)==="SyntaxError"):return`Cannot parse file '${t}', resetting...`;case(e==null?void 0:e.message)==="Invalid Schema":return`File '${t}' is corrupt, resetting...`;case((r=e==null?void 0:e.response)==null?void 0:r.status)===404:return`File '${t}' not found, creating...`;default:return e==null?void 0:e.message}}function kN(e){return We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function IN(e){return We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const Hb=()=>{const{host:e,protocol:t}=window.location,r=t==="https:";return{projectOpened:!1,remoteDebuggerMode:Vf.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${r?"s":""}://${e}/remoteDebugger`,lsp:`ws${r?"s":""}://${e}/LSP`},isRestActive:!0}};async function $N(){const{hostname:e,host:t,protocol:r}=window.location,i=r==="https:";try{const s=await We(lt,{method:"POST",body:JSON.stringify({verb:Cn.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),a=(()=>{if(s.rendererPath)return s.rendererPath;const u=`http://${e}:${s.webServerHTTPPort}`,l=`https://${e}:${s.webServerHTTPSPort}`;return s.webServerHTTPPort&&s.webServerHTTPSPort?i?l:u:s.webServerHTTPPort?u:l})();return{projectOpened:s.webServerHTTPSPort>0||s.webServerHTTPPort>0,remoteDebuggerMode:s.remoteDebuggerMode,baseUrl:a,qodly:typeof s.qodly>"u"?!0:s.qodly,urls:{renderer:s.rendererPath||`${a}/$lib/renderer/`,debugger:`ws${i?"s":""}://${t}/remoteDebugger`,lsp:`ws${i?"s":""}://${t}/LSP`},isRestActive:s.isRESTActive}}catch(s){return console.error(s),Hb()}}async function Ub(e){return await We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function LN(...e){return(await Promise.all(e.map(i=>Ub({root:i,verb:Cn.GET_FOLDER})))).map(({children:i})=>i.map(({name:s,date:a,type:u})=>({name:s,type:u,date:a,path:`${u}/${s}`}))).flat()}function MN(e,t={}){const{sanitize:r=!0}=t;return We(`/rest/$getWebForm/${e}`,{method:"GET"}).then(i=>{if(!(i!=null&&i.components)||!r)return i;const s=new Map;return{...i,components:Ie.entries(i.components).map(([a,u])=>{const l=a,{resolvedName:f}=u.type;if(f==="WebformLoader"){const p=On.generate();s.set(a,p),a=p}return[a,u,l]}).reduce((a,[u,l,f])=>{var p;return l.nodes&&(l.nodes=l.nodes.map(m=>s.get(m)||m)),l.linkedNodes&&(l.linkedNodes=Ie.entries(l.linkedNodes).reduce((m,[d,g])=>({...m,[d]:s.get(g)||g}),{})),(p=l.props)!=null&&p.events&&(l.props.events=l.props.events.map(m=>(m.type==="navigation"&&m.loader&&(m.loader=s.get(m.loader)||m.loader),m))),{...a,[u]:{...l,props:{...l.props,__originalID:f}}}},{})}})}function DN(e){return We(lt,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(t=>({...t,content:[ke.METHOD,ke.CLASS].includes(t.type)?iu(t.content):t.content}))}function NN(e){return e.type==="folder"?We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function FN(e){return e.type==="folder"?(await We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function jN(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function zN(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function BN(e){return(await We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function WN(...e){return await We(lt,{method:"POST",body:JSON.stringify({verb:Cn.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function HN(e){const t=await We("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return t.isLogged&&t.success}async function UN(){return await We("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function qN(e){try{const t=process.env.NODE_ENV==="development"?"/i18n/languages.json":`/$lib/${e?"studio":"renderer"}/i18n/languages.json`,i=await(await fetch(t)).text(),{supported:s}=JSON.parse(i);return s}catch{return[]}}async function GN({name:e,path:t="",root:r="root",asText:i=!1}){return We(lt,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:r,path:t,name:e,asText:i}),headers:new Headers({"Content-Type":"application/json"})})}async function ZN(e={}){try{return{...await es({path:"shared_datasources.json",...e}),...ja}}catch{return{...ja}}}async function VN(e={}){try{return await es({path:"shared_app_events.json",...e})}catch{return[]}}async function KN(e={}){try{return await es({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function YN(e={}){try{return await es({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function XN(){try{return await We("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function JN(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const QN=ed(),e2=async e=>{const t={verb:Cn.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:Ie.omit(e,Ie.keys(ja))};return QN(()=>We(lt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}))},t2=ed(),r2=async e=>{const t={verb:Cn.SET_FILE_CONTENT,asText:!1,name:"shared_app_events.json",path:"",root:"shared",content:e};return t2(()=>We(lt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}))},ad=async e=>{const t=await We(lt,{method:"POST",body:JSON.stringify({...e,verb:Cn.SET_FILE_CONTENT,root:Zf.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),r=Qf(`${e.path||"Sources"}/${e.name}`);return{...t,type:r,size:0}},n2=async e=>await ad({name:"crafted_components.json",path:wr.WEBFORMS,content:e});function i2(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function o2(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function s2(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function a2(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}).then(t=>Array.isArray(t)?t:{...t,content:["4dm","4qm","4qs"].includes(t.ext)?iu(t.content):t.content}).catch(t=>{var r,i;throw((i=(r=t.data)==null?void 0:r.__ERROR[0])==null?void 0:i.errCode)===1839&&uu(e.path),t})}function u2(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function l2(e){const t=new RegExp(/^\((.+)(?=\))/gi).exec(e);return t!==null?t[1]:""}function c2(e){const t=new RegExp(/(->)(.*)/gi).exec(e);if(t!==null)return t[0].replace("->","");const r=/:([^)]*)$/.exec(e);return r!==null?`result : ${r[1].trim()}`:""}function f2(e){const t=l2(e).split(/[;,]/g).filter(Boolean).map(s=>{const a=s.split(":")[0].trim(),u=s.split(":")[1].trim();return{name:a,type:u}}),r=c2(e),i=r?{name:r.split(":")[0].trim(),type:r.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:t,result:i}}async function d2(e,t){const i=e.split(".").pop();try{const s=await We(lt,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:t,functionName:i}),headers:new Headers({"Content-Type":"application/json"})});s.content=iu(s.content);const{params:a,result:u}=f2(s.parameters);return{...s,params:a,returns:u}}catch(s){return console.error(s),{className:t,functionName:i,filePath:e,content:"",params:[]}}}var qb=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))(qb||{});function p2(e,t){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...t}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(r=>{})}function h2(e){window.pagesense=window.pagesense||[],window.pagesense.push(["trackEvent",e])}const g2={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},m2={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}},Gb=M.createContext(void 0),v2=M.memo(({children:e,isInsideStudio:t,isStandaloneEditor:r})=>{const i=M.useMemo(()=>({isInsideStudio:t,isStandaloneEditor:r}),[t,r]);return I.jsx(Gb.Provider,{value:i,children:e})});function y2(){const e=M.useContext(Gb);return e===void 0?{isInsideStudio:!1,isStandaloneEditor:!1}:e}const Zb=M.createContext(null),b2=5e3,w2={top:"top-4",bottom:"bottom-4"};function x2({children:e}){const[t,r]=M.useState([]),i=M.useRef(0),s=M.useCallback(l=>{r(f=>f.filter(p=>p.id!==l))},[]),a=M.useCallback((l,f)=>{const p=++i.current,m={id:p,containerStyle:f==null?void 0:f.containerStyle,duration:l.duration??b2,position:l.position??"bottom",render:l.render};return r(d=>[...d,m]),p},[]);M.useEffect(()=>{const l=Wf.subscribe(f=>{a({position:"bottom",render:({onClose:p})=>I.jsx(Gv,{...f,onClose:p})})});return()=>{l.unsubscribe()}},[a]);const u=M.useMemo(()=>({pushToast:a,removeToast:s}),[a,s]);return I.jsxs(Zb.Provider,{value:u,children:[e,typeof document<"u"?Qn.createPortal(I.jsx(I.Fragment,{children:["top","bottom"].map(l=>{const f=t.filter(p=>p.position===l);return f.length===0?null:I.jsx("div",{className:`pointer-events-none fixed inset-x-4 z-[2147483647] flex flex-col items-center gap-3 ${w2[l]}`,children:f.map(p=>I.jsx(S2,{toast:p,onClose:()=>s(p.id)},p.id))},l)})}),document.body):null]})}function S2({toast:e,onClose:t}){return M.useEffect(()=>{if(e.duration===null)return;const r=window.setTimeout(t,e.duration);return()=>window.clearTimeout(r)},[t,e.duration]),I.jsx("div",{className:"pointer-events-auto",style:e.containerStyle,children:e.render({onClose:t})})}function E2(e){const t=M.useContext(Zb);if(!t)throw new Error("useToast must be used within a ToastProvider");return M.useCallback(r=>t.pushToast(r,e),[t,e])}exports.API_PREFIX=lt;exports.AppLoader=i$;exports.BaseCheckboxIcon=m0;exports.Checkbox=P$;exports.ControlledSwitch=Vy;exports.DATASOURCE_THEMES=g2;exports.DatasourcesActions=L0;exports.DebuggerActions=N0;exports.DefaultCheckboxIcon=v0;exports.DesignerRequestVerb=Cn;exports.Dialog=jA;exports.DialogBody=Dv;exports.EActivity=qb;exports.ECustomStylePropsViewMode=Ib;exports.EDITOR=m2;exports.EDisplayMode=od;exports.EIDENTIFIERS=Lb;exports.EPermissionType=ze;exports.ERROR_CODES=Mb;exports.ESetting=Cb;exports.ESubPermissionType=Ke;exports.ETooltipBehavior=kb;exports.EWebFormStyleClassScope=Pb;exports.EXT_API_PREFIX=Qo;exports.FileFolderType=ke;exports.FloatingTooltip=T$;exports.FolderRootPath=wr;exports.FolderRootType=Zf;exports.Grid=$$;exports.GridItem=L$;exports.HTTPError=Jc;exports.HTTP_HANDLERS_TAB_PATH=Xf;exports.IPreemptive=qo;exports.IPublished=vb;exports.IPublishedRestScope=rd;exports.IdentityProvider=eL;exports.Image=y0;exports.Incase=va;exports.IndentLines=Xv;exports.InvalidJsonError=I$;exports.LOCALIZATION_TAB_PATH=Jf;exports.LOCATION_DATASOURCE_ID=hb;exports.LogoSVG=l0;exports.LspActions=D0;exports.MAX_FILE_NAME_LENGTH=Hf;exports.MODEL_TAB_PATH=rb;exports.Modal=u$;exports.ModalCloseReason=Ei;exports.ModalColor=Vn;exports.ModalIcons=Fc;exports.ModalType=$f;exports.Mutex=ob;exports.NameError=Uf;exports.Overlay=Mv;exports.PANEL_COLLAPSED_HEIGHT=Pr;exports.PANEL_INITIAL_OPEN_RATIO=p0;exports.PANEL_MAX_RATIO=h0;exports.PERMISSIONS=nd;exports.Panel=R$;exports.PopperTooltip=u0;exports.Portal=_v;exports.PublishOptions=$D;exports.QODLY_NAMESPACE=ko;exports.ROLES_TAB_PATH=Kf;exports.ROOT_WEBFORM_STATE=Db;exports.RemoteDebuggerMode=Vf;exports.SETTINGS_TAB_PATH=Yf;exports.SHARED_API_PREFIX=Go;exports.SHARED_USER_NAMESPACE=ja;exports.SearchInput=k$;exports.SimpleGrid=M$;exports.SourceCodeDescriptor=$b;exports.StudioContextProvider=v2;exports.Switcher=Jv;exports.THEME_CLASSES=aN;exports.TITLE_DATASOURCE_ID=mb;exports.TabEventsActions=M0;exports.Tip=Dy;exports.TipsProvider=fk;exports.Toast=Gv;exports.ToastProvider=x2;exports.ToolbarIcon=C$;exports.Tooltip=r$;exports.Tree=lP;exports.TreeIcon=Zv;exports.TreeNode=ff;exports.USER_LANGUAGE_DATASOURCE_ID=gb;exports.WT_FLAGS_KEYS=sN;exports.WebformActions=$0;exports.WebformEventsActions=Uo;exports.ZoomComponent=f$;exports.ZoomLevel=f0;exports._isArrayDatasource=AD;exports._isObjectDatasource=RD;exports.actionsToPrivs=Eb;exports.addAttributesToContent=MD;exports.addFolder=jN;exports.addItem=bN;exports.addPermission=KD;exports.addPrivilegeIn=BD;exports.allowed=jD;exports.by=sb;exports.byId=fD;exports.byPath=dD;exports.callAll=zb;exports.callAllHandlers=pN;exports.callServerSideParser=EN;exports.checkUpdates=kN;exports.children=Ba;exports.createFolder=i2;exports.createPrivilege=HD;exports.createRole=tN;exports.dataAttr=hN;exports.datasourcesSubject=zL;exports.debuggerSubject=UL;exports.deepDeleteCondition=Fb;exports.deepSanitizeCondition=jb;exports.dropFile=FN;exports.dropFolder=BN;exports.editors=nb;exports.exists=pD;exports.extractWebformName=sD;exports.filterBySeriousError=Rb;exports.focus=gN;exports.formatErrorsAsBulletToast=oN;exports.generateUUID=Xc;exports.getAppSettings=$N;exports.getCashedPrefrences=hD;exports.getCatalog=UN;exports.getDatasourceId=gD;exports.getDefaultAppSettings=Hb;exports.getDefaultContent=cN;exports.getDictByName=Tb;exports.getDisplayableFeedbackErrors=iN;exports.getEditors=oD;exports.getErrorListFromPayload=Ab;exports.getFile=DN;exports.getFileContent=GN;exports.getFileExtentionFromType=ib;exports.getFilePath=dN;exports.getFilenameAndTypeFromPath=iD;exports.getFilenameFromType=aD;exports.getFilesInfo=WN;exports.getFolder=Ub;exports.getFolders=LN;exports.getFunctionContent=d2;exports.getGraphData=VD;exports.getInheritedResources=Ob;exports.getMonacoTheme=JN;exports.getNodeInfo=a2;exports.getPrivilegeById=rn;exports.getPromotions=eN;exports.getResourceFromType=id;exports.getSavedConditions=YN;exports.getSharedAppEvents=VN;exports.getSharedCSS=KN;exports.getSharedDatasources=ZN;exports.getSharedResource=es;exports.getSupportedLanguages=qN;exports.getTypeFromExtension=Qf;exports.getUserPrivileges=XN;exports.getWebForm=MN;exports.hasAttributesString=bb;exports.http=We;exports.i18nSubject=GL;exports.initializeDefaultProjectFiles=PN;exports.installUpdates=IN;exports.isArrayDatasource=fb;exports.isBaseState=uN;exports.isDataClassMethod=bD;exports.isDataStoreMethod=yD;exports.isDateDatasource=PD;exports.isEntity=TD;exports.isEntityDatasource=SD;exports.isEntityMethod=wD;exports.isEntitySelection=OD;exports.isEntitySelectionDatasource=ED;exports.isEntitySelectionMethod=xD;exports.isInputEvent=wN;exports.isObjectAttribute=mD;exports.isObjectDatasource=db;exports.isRelatedAttribute=vD;exports.isRelatedEntitiesAttribute=lb;exports.isRelatedEntityAttribute=cb;exports.isSameNamespace=CD;exports.isScalarDatasource=pb;exports.isSimpleAttribute=ub;exports.isSimpleDatasource=_D;exports.loadDS=kD;exports.loadI18n=ID;exports.localeCompare=ab;exports.log=p2;exports.login=HN;exports.lspSubject=HL;exports.mergeRefs=mN;exports.moveItem=s2;exports.outBy=lD;exports.outById=cD;exports.parents=au;exports.parseAttributes=LD;exports.parseCatalog=DD;exports.populateShallow=qD;exports.queue=ed;exports.refactorConditions=sd;exports.refactorWebform=lN;exports.removeAttributesString=wb;exports.removeItem=o2;exports.removeMultiplePermissions=XD;exports.removePermission=YD;exports.removePrivilege=zD;exports.removePrivilegeFrom=WD;exports.removeRole=rN;exports.renameFile=NN;exports.renameFolder=zN;exports.renamePrivilege=UD;exports.resetResources=JD;exports.rolesToAPI=ZD;exports.sanitizeContent=iu;exports.sanitizeNameCY=ND;exports.sanitizePermissions=_b;exports.sanitizePrivileges=xb;exports.sanitizeRoles=GD;exports.saveContent=u2;exports.saveRole=nN;exports.selectorEqualityFn=fN;exports.setCraftedComponents=n2;exports.setFileContent=ad;exports.setSharedAppEvents=r2;exports.setSharedSources=e2;exports.sortPrivileges=Sb;exports.splitDatasourceID=td;exports.stopEvent=xN;exports.stringifyAttributes=yb;exports.tabEventsSubject=WL;exports.tasksManagerSubject=qL;exports.toastSubject=Wf;exports.togglePermission=QD;exports.trackEvent=h2;exports.transformDates=SN;exports.tryCreateSharedResource=uu;exports.uniquePush=lr;exports.updateDsCondition=Nb;exports.useBoolean=SL;exports.useCallbackRef=EL;exports.useControllableProp=R0;exports.useControllableState=_L;exports.useDidMountEffect=D$;exports.useDoubleClick=iL;exports.useDsChangeRenderer=xL;exports.useDsRendererAdapter=wL;exports.useEnhancedState=bL;exports.useFeatureFlags=Q$;exports.useFormControlProps=AL;exports.useForwardedRef=J$;exports.useHotkeys=V$;exports.useIdentity=tL;exports.useOutsideClick=K$;exports.usePrevious=Y$;exports.useSafeLayoutEffect=TL;exports.useStateObject=rL;exports.useStateRef=X$;exports.useStudioContext=y2;exports.useTip=My;exports.useToast=E2;exports.useUpdateEffect=OL;exports.validateName=nu;exports.validateServerSide=ZL;exports.validateValue=VL;exports.visuallyHiddenStyle=yN;exports.warn=vN;exports.webformEventsSubject=Na;exports.webformSubject=BL;
|
|
203
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function Uc(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ru=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,s,a;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=Oc(u),f=l.next();!f.done;f=l.next()){var p=f.value;p.remove(this)}}catch(h){t={error:h}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else u.remove(this);var m=this.initialTeardown;if(en(m))try{m()}catch(h){a=h instanceof yc?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var g=Oc(d),y=g.next();!y.done;y=g.next()){var x=y.value;try{rv(x)}catch(h){a=a??[],h instanceof yc?a=Ra(Ra([],Ac(a)),Ac(h.errors)):a.push(h)}}}catch(h){i={error:h}}finally{try{y&&!y.done&&(s=g.return)&&s.call(g)}finally{if(i)throw i.error}}}if(a)throw new yc(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)rv(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Uc(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Uc(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),C0=ru.EMPTY;function k0(e){return e instanceof ru||e&&"closed"in e&&en(e.remove)&&en(e.add)&&en(e.unsubscribe)}function rv(e){en(e)?e():e.unsubscribe()}var RL={Promise:void 0},PL={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Ra([e,t],Ac(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function CL(e){PL.setTimeout(function(){throw e})}function nv(){}function xa(e){e()}var I0=(function(e){Za(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,k0(r)&&r.add(i)):i.destination=$L,i}return t.create=function(r,i,s){return new qc(r,i,s)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(ru),kL=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){ca(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){ca(i)}else ca(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){ca(r)}},e})(),qc=(function(e){Za(t,e);function t(r,i,s){var a=e.call(this)||this,u;return en(r)||!r?u={next:r??void 0,error:i??void 0,complete:s??void 0}:u=r,a.destination=new kL(u),a}return t})(I0);function ca(e){CL(e)}function IL(e){throw e}var $L={closed:!0,next:nv,error:IL,complete:nv},LL=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ML(e){return e}function DL(e){return e.length===0?ML:e.length===1?e[0]:function(r){return e.reduce(function(i,s){return s(i)},r)}}var iv=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var s=this,a=FL(t)?t:new qc(t,r,i);return xa(function(){var u=s,l=u.operator,f=u.source;a.add(l?l.call(a,f):f?s._subscribe(a):s._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=ov(r),new r(function(s,a){var u=new qc({next:function(l){try{t(l)}catch(f){a(f),u.unsubscribe()}},error:a,complete:s});i.subscribe(u)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[LL]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return DL(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=ov(t),new t(function(i,s){var a;r.subscribe(function(u){return a=u},function(u){return s(u)},function(){return i(a)})})},e.create=function(t){return new e(t)},e})();function ov(e){var t;return(t=e??RL.Promise)!==null&&t!==void 0?t:Promise}function NL(e){return e&&en(e.next)&&en(e.error)&&en(e.complete)}function FL(e){return e&&e instanceof I0||NL(e)&&k0(e)}var jL=P0(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),jr=(function(e){Za(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new sv(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new jL},t.prototype.next=function(r){var i=this;xa(function(){var s,a;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var u=Oc(i.currentObservers),l=u.next();!l.done;l=u.next()){var f=l.value;f.next(r)}}catch(p){s={error:p}}finally{try{l&&!l.done&&(a=u.return)&&a.call(u)}finally{if(s)throw s.error}}}})},t.prototype.error=function(r){var i=this;xa(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var s=i.observers;s.length;)s.shift().error(r)}})},t.prototype.complete=function(){var r=this;xa(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,s=this,a=s.hasError,u=s.isStopped,l=s.observers;return a||u?C0:(this.currentObservers=null,l.push(r),new ru(function(){i.currentObservers=null,Uc(l,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,s=i.hasError,a=i.thrownError,u=i.isStopped;s?r.error(a):u&&r.complete()},t.prototype.asObservable=function(){var r=new iv;return r.source=this,r},t.create=function(r,i){return new sv(r,i)},t})(iv),sv=(function(e){Za(t,e);function t(r,i){var s=e.call(this)||this;return s.destination=r,s.source=i,s}return t.prototype.next=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,r)},t.prototype.error=function(r){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&s!==void 0?s:C0},t})(jr),$0=(e=>(e.RELOAD="reload",e.RECOMPUTE="recompute",e))($0||{}),L0=(e=>(e.RENAME="rename",e.TYPE_CHANGE="type-change",e))(L0||{});const zL=new jr,BL=new jr,Wf=new jr;var M0=(e=>(e.SAVE_ALL="save-all",e))(M0||{});const WL=new jr;var D0=(e=>(e.WILL_SAVE="will-save",e.DID_SAVE="did-save",e.WILL_CREATE="will-create",e.WILL_RENAME="will-rename",e.WILL_DELETE="will-delete",e.DID_CREATE="did-create",e.DID_RENAME="did-rename",e.DID_DELETE="did-delete",e.DIAGNOSTIC_REFRESH="diagnostic-refresh",e))(D0||{});const HL=new jr;var N0=(e=>(e.RESEND_BREAKPOINTS="resend-breakpoints",e))(N0||{});const UL=new jr,qL=new jr;var Uo=(e=>(e.EVENT_STARTED="event-started",e.EVENT_ENDED="event-ended",e.EVENT_EMITED="event-emited",e.REQUEST_SENT="request-sent",e))(Uo||{});const Na=new jr,GL=new jr,Hf=255;var Uf=(e=>(e.EMPTY="Please enter a valid name",e.LENGTH_EXCEEDED=`The name is too long, it should not exceed ${Hf} characters (including extension)`,e.SHOULD_START_WITH_LETTER="The name can only start with a letter or a Japanese character",e.INVALID="Invalid name",e))(Uf||{});function nu(e,t){const r=t?e.replace(/\.[^.]+$/,""):e;if(e==="")throw new Error("Please enter a valid name");if(e.length>Hf)throw new Error(Uf.LENGTH_EXCEEDED);if(!/^[a-zA-Z\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF]/.test(r))throw new Error("The name can only start with a letter or a Japanese character");if(!/^[\w\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF-]+$/i.test(r))throw new Error("Invalid name");return!0}function ZL(e){if(!e)return null;if(typeof e=="string")try{nu(e)}catch(t){return t.message}}function VL(e,t){let r="";if(["array","object"].includes(t))try{const i=JSON.parse(e);t==="array"&&(!Array.isArray(i)||!Ie.isObject(i))&&(r=`Invalid value for type ${t}`),t==="object"&&(!Ie.isObject(i)||Array.isArray(i))&&(r=`Invalid value for type ${t}`)}catch{r=`Invalid value for type ${t}`}return t==="date"&&(new RegExp(/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/).test(e)||(r=`Invalid value for type ${t}`)),t==="number"&&isNaN(+e)&&(r=`Invalid value for type ${t}`),["boolean","bool"].includes(t)&&typeof e!="boolean"&&!["true","false"].includes(e)&&(r=`Invalid value for type ${t}`),r}function KL(){return{PLACEHOLDER_PREFIX:`@!MASK_${Date.now().toString(36)+Math.random().toString(36).substring(2,8)}_`,counter:0}}function iu(e){const{PLACEHOLDER_PREFIX:t,counter:r}=KL();let i=r;const s=[],a="@!",u=m=>(s.push(m),`${t}${i++}${a}`);let l=e.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g,u);l=l.replace(/([\{\s]\s*\w+\s*)(:\s*\d+)/g,(m,d,g)=>d+u(g)),l=l.replace(/:\d{2}:\d{2}/g,u);const f=new RegExp(":(?!4D\\.\\w+)[CPK]?\\d+","g");let p=l.replace(f,"");for(let m=0;m<s.length;m++){const g=`${t}${m}${a}`.replace(/([.*+?^${}()|[\]\\])/g,"\\$1"),y=new RegExp(g,"g");p=p.replace(y,s[m])}return p}const F0=(e,t,r)=>{const i=e instanceof RegExp?av(e,r):e,s=t instanceof RegExp?av(t,r):t,a=i!==null&&s!=null&&YL(i,s,r);return a&&{start:a[0],end:a[1],pre:r.slice(0,a[0]),body:r.slice(a[0]+i.length,a[1]),post:r.slice(a[1]+s.length)}},av=(e,t)=>{const r=t.match(e);return r?r[0]:null},YL=(e,t,r)=>{let i,s,a,u,l,f=r.indexOf(e),p=r.indexOf(t,f+1),m=f;if(f>=0&&p>0){if(e===t)return[f,p];for(i=[],a=r.length;m>=0&&!l;){if(m===f)i.push(m),f=r.indexOf(e,m+1);else if(i.length===1){const d=i.pop();d!==void 0&&(l=[d,p])}else s=i.pop(),s!==void 0&&s<a&&(a=s,u=p),p=r.indexOf(t,m+1);m=f<p&&f>=0?f:p}i.length&&u!==void 0&&(l=[a,u])}return l},j0="\0SLASH"+Math.random()+"\0",z0="\0OPEN"+Math.random()+"\0",qf="\0CLOSE"+Math.random()+"\0",B0="\0COMMA"+Math.random()+"\0",W0="\0PERIOD"+Math.random()+"\0",XL=new RegExp(j0,"g"),JL=new RegExp(z0,"g"),QL=new RegExp(qf,"g"),eM=new RegExp(B0,"g"),tM=new RegExp(W0,"g"),rM=/\\\\/g,nM=/\\{/g,iM=/\\}/g,oM=/\\,/g,sM=/\\\./g,aM=1e5;function bc(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function uM(e){return e.replace(rM,j0).replace(nM,z0).replace(iM,qf).replace(oM,B0).replace(sM,W0)}function lM(e){return e.replace(XL,"\\").replace(JL,"{").replace(QL,"}").replace(eM,",").replace(tM,".")}function H0(e){if(!e)return[""];const t=[],r=F0("{","}",e);if(!r)return e.split(",");const{pre:i,body:s,post:a}=r,u=i.split(",");u[u.length-1]+="{"+s+"}";const l=H0(a);return a.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l)),t.push.apply(t,u),t}function cM(e,t={}){if(!e)return[];const{max:r=aM}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Po(uM(e),r,!0).map(lM)}function fM(e){return"{"+e+"}"}function dM(e){return/^-?0\d/.test(e)}function pM(e,t){return e<=t}function hM(e,t){return e>=t}function Po(e,t,r){const i=[],s=F0("{","}",e);if(!s)return[e];const a=s.pre,u=s.post.length?Po(s.post,t,!1):[""];if(/\$$/.test(s.pre))for(let l=0;l<u.length&&l<t;l++){const f=a+"{"+s.body+"}"+u[l];i.push(f)}else{const l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),p=l||f,m=s.body.indexOf(",")>=0;if(!p&&!m)return s.post.match(/,(?!,).*\}/)?(e=s.pre+"{"+s.body+qf+s.post,Po(e,t,!0)):[e];let d;if(p)d=s.body.split(/\.\./);else if(d=H0(s.body),d.length===1&&d[0]!==void 0&&(d=Po(d[0],t,!1).map(fM),d.length===1))return u.map(y=>s.pre+d[0]+y);let g;if(p&&d[0]!==void 0&&d[1]!==void 0){const y=bc(d[0]),x=bc(d[1]),h=Math.max(d[0].length,d[1].length);let w=d.length===3&&d[2]!==void 0?Math.max(Math.abs(bc(d[2])),1):1,v=pM;x<y&&(w*=-1,v=hM);const E=d.some(dM);g=[];for(let R=y;v(R,x);R+=w){let T;if(f)T=String.fromCharCode(R),T==="\\"&&(T="");else if(T=String(R),E){const C=h-T.length;if(C>0){const W=new Array(C+1).join("0");R<0?T="-"+W+T.slice(1):T=W+T}}g.push(T)}}else{g=[];for(let y=0;y<d.length;y++)g.push.apply(g,Po(d[y],t,!1))}for(let y=0;y<g.length;y++)for(let x=0;x<u.length&&i.length<t;x++){const h=a+g[y]+u[x];(!r||p||h)&&i.push(h)}}return i}const gM=1024*64,Fa=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>gM)throw new TypeError("pattern is too long")},mM={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},_o=e=>e.replace(/[[\]\\-]/g,"\\$&"),vM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),uv=e=>e.join(""),yM=(e,t)=>{const r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");const i=[],s=[];let a=r+1,u=!1,l=!1,f=!1,p=!1,m=r,d="";e:for(;a<e.length;){const h=e.charAt(a);if((h==="!"||h==="^")&&a===r+1){p=!0,a++;continue}if(h==="]"&&u&&!f){m=a+1;break}if(u=!0,h==="\\"&&!f){f=!0,a++;continue}if(h==="["&&!f){for(const[w,[v,S,E]]of Object.entries(mM))if(e.startsWith(w,a)){if(d)return["$.",!1,e.length-r,!0];a+=w.length,E?s.push(v):i.push(v),l=l||S;continue e}}if(f=!1,d){h>d?i.push(_o(d)+"-"+_o(h)):h===d&&i.push(_o(h)),d="",a++;continue}if(e.startsWith("-]",a+1)){i.push(_o(h+"-")),a+=2;continue}if(e.startsWith("-",a+1)){d=h,a+=2;continue}i.push(_o(h)),a++}if(m<a)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,e.length-r,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!p){const h=i[0].length===2?i[0].slice(-1):i[0];return[vM(h),!1,m-r,!1]}const g="["+(p?"^":"")+uv(i)+"]",y="["+(p?"":"^")+uv(s)+"]";return[i.length&&s.length?"("+g+"|"+y+")":i.length?g:y,l,m-r,!0]},Co=(e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var Dt;const bM=new Set(["!","?","+","*","@"]),Gc=e=>bM.has(e),lv=e=>Gc(e.type),wM=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),xM=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),SM=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),cv=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),EM="(?!(?:^|/)\\.\\.?(?:$|/))",fa="(?!\\.)",_M=new Set(["[","."]),TM=new Set(["..","."]),OM=new Set("().*{}+?[]^$\\!"),AM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Gf="[^/]",fv=Gf+"*?",dv=Gf+"+?";let RM=0;var ut,ht,Qr,we,Xe,Sn,Gn,En,Cr,kr,Ri,Me,U0,Tn,Sa,q0,Zc,Ea,G0,Vc,Z0,V0,K0,_a,Kc,Y0;class ou{constructor(t,r,i={}){vt(this,Me);ye(this,"type");vt(this,ut);vt(this,ht);vt(this,Qr,!1);vt(this,we,[]);vt(this,Xe);vt(this,Sn);vt(this,Gn);vt(this,En,!1);vt(this,Cr);vt(this,kr);vt(this,Ri,!1);ye(this,"id",++RM);this.type=t,t&&He(this,ht,!0),He(this,Xe,r),He(this,ut,X(this,Xe)?X(X(this,Xe),ut):this),He(this,Cr,X(this,ut)===this?i:X(X(this,ut),Cr)),He(this,Gn,X(this,ut)===this?[]:X(X(this,ut),Gn)),t==="!"&&!X(X(this,ut),En)&&X(this,Gn).push(this),He(this,Sn,X(this,Xe)?X(X(this,Xe),we).length:0)}get depth(){var t;return(((t=X(this,Xe))==null?void 0:t.depth)??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){var t;return{"@@type":"AST",id:this.id,type:this.type,root:X(this,ut).id,parent:(t=X(this,Xe))==null?void 0:t.id,depth:this.depth,partsLength:X(this,we).length,parts:X(this,we)}}get hasMagic(){if(X(this,ht)!==void 0)return X(this,ht);for(const t of X(this,we))if(typeof t!="string"&&(t.type||t.hasMagic))return He(this,ht,!0);return X(this,ht)}toString(){return X(this,kr)!==void 0?X(this,kr):this.type?He(this,kr,this.type+"("+X(this,we).map(t=>String(t)).join("|")+")"):He(this,kr,X(this,we).map(t=>String(t)).join(""))}push(...t){for(const r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Dt&&X(r,Xe)===this))throw new Error("invalid part: "+r);X(this,we).push(r)}}toJSON(){var r;const t=this.type===null?X(this,we).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...X(this,we).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===X(this,ut)||X(X(this,ut),En)&&((r=X(this,Xe))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(X(this,ut)===this)return!0;if(!((r=X(this,Xe))!=null&&r.isStart()))return!1;if(X(this,Sn)===0)return!0;const t=X(this,Xe);for(let i=0;i<X(this,Sn);i++){const s=X(t,we)[i];if(!(s instanceof Dt&&s.type==="!"))return!1}return!0}isEnd(){var r,i,s;if(X(this,ut)===this||((r=X(this,Xe))==null?void 0:r.type)==="!")return!0;if(!((i=X(this,Xe))!=null&&i.isEnd()))return!1;if(!this.type)return(s=X(this,Xe))==null?void 0:s.isEnd();const t=X(this,Xe)?X(X(this,Xe),we).length:0;return X(this,Sn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const r=new Dt(this.type,t);for(const i of X(this,we))r.copyIn(i);return r}static fromGlob(t,r={}){var s;const i=new Dt(null,void 0,r);return de(s=Dt,Tn,Sa).call(s,t,i,0,r,0),i}toMMPattern(){if(this!==X(this,ut))return X(this,ut).toMMPattern();const t=this.toString(),[r,i,s,a]=this.toRegExpSource();if(!(s||X(this,ht)||X(this,Cr).nocase&&!X(this,Cr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;const l=(X(this,Cr).nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,l),{_src:r,_glob:t})}get options(){return X(this,Cr)}toRegExpSource(t){var f;const r=t??!!X(this,Cr).dot;if(X(this,ut)===this&&(de(this,Me,_a).call(this),de(this,Me,U0).call(this)),!lv(this)){const p=this.isStart()&&this.isEnd()&&!X(this,we).some(x=>typeof x!="string"),m=X(this,we).map(x=>{var E;const[h,w,v,S]=typeof x=="string"?de(E=Dt,Tn,Y0).call(E,x,X(this,ht),p):x.toRegExpSource(t);return He(this,ht,X(this,ht)||v),He(this,Qr,X(this,Qr)||S),h}).join("");let d="";if(this.isStart()&&typeof X(this,we)[0]=="string"&&!(X(this,we).length===1&&TM.has(X(this,we)[0]))){const h=_M,w=r&&h.has(m.charAt(0))||m.startsWith("\\.")&&h.has(m.charAt(2))||m.startsWith("\\.\\.")&&h.has(m.charAt(4)),v=!r&&!t&&h.has(m.charAt(0));d=w?EM:v?fa:""}let g="";return this.isEnd()&&X(X(this,ut),En)&&((f=X(this,Xe))==null?void 0:f.type)==="!"&&(g="(?:$|\\/)"),[d+m+g,Co(m),He(this,ht,!!X(this,ht)),X(this,Qr)]}const i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let a=de(this,Me,Kc).call(this,r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){const p=this.toString(),m=this;return He(m,we,[p]),m.type=null,He(m,ht,void 0),[p,Co(this.toString()),!1,!1]}let u=!i||t||r||!fa?"":de(this,Me,Kc).call(this,!0);u===a&&(u=""),u&&(a=`(?:${a})(?:${u})*?`);let l="";if(this.type==="!"&&X(this,Ri))l=(this.isStart()&&!r?fa:"")+dv;else{const p=this.type==="!"?"))"+(this.isStart()&&!r&&!t?fa:"")+fv+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&u?")":this.type==="*"&&u?")?":`)${this.type}`;l=s+a+p}return[l,Co(a),He(this,ht,!!X(this,ht)),X(this,Qr)]}}ut=new WeakMap,ht=new WeakMap,Qr=new WeakMap,we=new WeakMap,Xe=new WeakMap,Sn=new WeakMap,Gn=new WeakMap,En=new WeakMap,Cr=new WeakMap,kr=new WeakMap,Ri=new WeakMap,Me=new WeakSet,U0=function(){if(this!==X(this,ut))throw new Error("should only call on root");if(X(this,En))return this;this.toString(),He(this,En,!0);let t;for(;t=X(this,Gn).pop();){if(t.type!=="!")continue;let r=t,i=X(r,Xe);for(;i;){for(let s=X(r,Sn)+1;!i.type&&s<X(i,we).length;s++)for(const a of X(t,we)){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(X(i,we)[s])}r=i,i=X(r,Xe)}}return this},Tn=new WeakSet,Sa=function(t,r,i,s,a){var h,w,v,S;const u=s.maxExtglobRecursion??2;let l=!1,f=!1,p=-1,m=!1;if(r.type===null){let E=i,R="";for(;E<t.length;){const T=t.charAt(E++);if(l||T==="\\"){l=!l,R+=T;continue}if(f){E===p+1?(T==="^"||T==="!")&&(m=!0):T==="]"&&!(E===p+2&&m)&&(f=!1),R+=T;continue}else if(T==="["){f=!0,p=E,m=!1,R+=T;continue}if(!s.noext&&Gc(T)&&t.charAt(E)==="("&&a<=u){r.push(R),R="";const W=new Dt(T,r);E=de(h=Dt,Tn,Sa).call(h,t,W,E,s,a+1),r.push(W);continue}R+=T}return r.push(R),E}let d=i+1,g=new Dt(null,r);const y=[];let x="";for(;d<t.length;){const E=t.charAt(d++);if(l||E==="\\"){l=!l,x+=E;continue}if(f){d===p+1?(E==="^"||E==="!")&&(m=!0):E==="]"&&!(d===p+2&&m)&&(f=!1),x+=E;continue}else if(E==="["){f=!0,p=d,m=!1,x+=E;continue}if(!s.noext&&Gc(E)&&t.charAt(d)==="("&&(a<=u||r&&de(w=r,Me,Ea).call(w,E))){const T=r&&de(v=r,Me,Ea).call(v,E)?0:1;g.push(x),x="";const C=new Dt(E,g);g.push(C),d=de(S=Dt,Tn,Sa).call(S,t,C,d,s,a+T);continue}if(E==="|"){g.push(x),x="",y.push(g),g=new Dt(null,r);continue}if(E===")")return x===""&&X(r,we).length===0&&He(r,Ri,!0),g.push(x),x="",r.push(...y,g),d;x+=E}return r.type=null,He(r,ht,void 0),He(r,we,[t.substring(i-1)]),d},q0=function(t){return de(this,Me,Zc).call(this,t,xM)},Zc=function(t,r=wM){if(!t||typeof t!="object"||t.type!==null||X(t,we).length!==1||this.type===null)return!1;const i=X(t,we)[0];return!i||typeof i!="object"||i.type===null?!1:de(this,Me,Ea).call(this,i.type,r)},Ea=function(t,r=SM){var i;return!!((i=r.get(this.type))!=null&&i.includes(t))},G0=function(t,r){const i=X(t,we)[0],s=new Dt(null,i,this.options);X(s,we).push(""),i.push(s),de(this,Me,Vc).call(this,t,r)},Vc=function(t,r){const i=X(t,we)[0];X(this,we).splice(r,1,...X(i,we));for(const s of X(i,we))typeof s=="object"&&He(s,Xe,this);He(this,kr,void 0)},Z0=function(t){const r=cv.get(this.type);return!!(r!=null&&r.has(t))},V0=function(t){if(!t||typeof t!="object"||t.type!==null||X(t,we).length!==1||this.type===null||X(this,we).length!==1)return!1;const r=X(t,we)[0];return!r||typeof r!="object"||r.type===null?!1:de(this,Me,Z0).call(this,r.type)},K0=function(t){const r=cv.get(this.type),i=X(t,we)[0],s=r==null?void 0:r.get(i.type);if(!s)return!1;He(this,we,X(i,we));for(const a of X(this,we))typeof a=="object"&&He(a,Xe,this);this.type=s,He(this,kr,void 0),He(this,Ri,!1)},_a=function(){var t,r;if(lv(this)){let i=0,s=!1;do{s=!0;for(let a=0;a<X(this,we).length;a++){const u=X(this,we)[a];typeof u=="object"&&(de(r=u,Me,_a).call(r),de(this,Me,Zc).call(this,u)?(s=!1,de(this,Me,Vc).call(this,u,a)):de(this,Me,q0).call(this,u)?(s=!1,de(this,Me,G0).call(this,u,a)):de(this,Me,V0).call(this,u)&&(s=!1,de(this,Me,K0).call(this,u)))}}while(!s&&++i<10)}else for(const i of X(this,we))typeof i=="object"&&de(t=i,Me,_a).call(t);He(this,kr,void 0)},Kc=function(t){return X(this,we).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[i,s,a,u]=r.toRegExpSource(t);return He(this,Qr,X(this,Qr)||u),i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},Y0=function(t,r,i=!1){let s=!1,a="",u=!1,l=!1;for(let f=0;f<t.length;f++){const p=t.charAt(f);if(s){s=!1,a+=(OM.has(p)?"\\":"")+p;continue}if(p==="*"){if(l)continue;l=!0,a+=i&&/^[*]+$/.test(t)?dv:fv,r=!0;continue}else l=!1;if(p==="\\"){f===t.length-1?a+="\\\\":s=!0;continue}if(p==="["){const[m,d,g,y]=yM(t,f);if(g){a+=m,u=u||d,f+=g-1,r=r||y;continue}}if(p==="?"){a+=Gf,r=!0;continue}a+=AM(p)}return[a,Co(t),!!r,u]},vt(ou,Tn);Dt=ou;const PM=(e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),xt=(e,t,r={})=>(Fa(t),!r.nocomment&&t.charAt(0)==="#"?!1:new su(t,r).match(e)),CM=/^\*+([^+@!?*[(]*)$/,kM=e=>t=>!t.startsWith(".")&&t.endsWith(e),IM=e=>t=>t.endsWith(e),$M=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),LM=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),MM=/^\*+\.\*+$/,DM=e=>!e.startsWith(".")&&e.includes("."),NM=e=>e!=="."&&e!==".."&&e.includes("."),FM=/^\.\*+$/,jM=e=>e!=="."&&e!==".."&&e.startsWith("."),zM=/^\*+$/,BM=e=>e.length!==0&&!e.startsWith("."),WM=e=>e.length!==0&&e!=="."&&e!=="..",HM=/^\?+([^+@!?*[(]*)?$/,UM=([e,t=""])=>{const r=X0([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},qM=([e,t=""])=>{const r=J0([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},GM=([e,t=""])=>{const r=J0([e]);return t?i=>r(i)&&i.endsWith(t):r},ZM=([e,t=""])=>{const r=X0([e]);return t?i=>r(i)&&i.endsWith(t):r},X0=([e])=>{const t=e.length;return r=>r.length===t&&!r.startsWith(".")},J0=([e])=>{const t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},Q0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",pv={win32:{sep:"\\"},posix:{sep:"/"}},VM=Q0==="win32"?pv.win32.sep:pv.posix.sep;xt.sep=VM;const Tt=Symbol("globstar **");xt.GLOBSTAR=Tt;const KM="[^/]",YM=KM+"*?",XM="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",JM="(?:(?!(?:\\/|^)\\.).)*?",QM=(e,t={})=>r=>xt(r,e,t);xt.filter=QM;const or=(e,t={})=>Object.assign({},e,t),eD=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return xt;const t=xt;return Object.assign((i,s,a={})=>t(i,s,or(e,a)),{Minimatch:class extends t.Minimatch{constructor(s,a={}){super(s,or(e,a))}static defaults(s){return t.defaults(or(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,a,u={}){super(s,a,or(e,u))}static fromGlob(s,a={}){return t.AST.fromGlob(s,or(e,a))}},unescape:(i,s={})=>t.unescape(i,or(e,s)),escape:(i,s={})=>t.escape(i,or(e,s)),filter:(i,s={})=>t.filter(i,or(e,s)),defaults:i=>t.defaults(or(e,i)),makeRe:(i,s={})=>t.makeRe(i,or(e,s)),braceExpand:(i,s={})=>t.braceExpand(i,or(e,s)),match:(i,s,a={})=>t.match(i,s,or(e,a)),sep:t.sep,GLOBSTAR:Tt})};xt.defaults=eD;const eb=(e,t={})=>(Fa(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:cM(e,{max:t.braceExpandMax}));xt.braceExpand=eb;const tD=(e,t={})=>new su(e,t).makeRe();xt.makeRe=tD;const rD=(e,t,r={})=>{const i=new su(t,r);return e=e.filter(s=>i.match(s)),i.options.nonull&&!e.length&&e.push(t),e};xt.match=rD;const hv=/[?*]|[+@!]\(.*?\)|\[|\]/,nD=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var Vt,tb,Yc,Si;class su{constructor(t,r={}){vt(this,Vt);ye(this,"options");ye(this,"set");ye(this,"pattern");ye(this,"windowsPathsNoEscape");ye(this,"nonegate");ye(this,"negate");ye(this,"comment");ye(this,"empty");ye(this,"preserveMultipleSlashes");ye(this,"partial");ye(this,"globSet");ye(this,"globParts");ye(this,"nocase");ye(this,"isWindows");ye(this,"platform");ye(this,"windowsNoMagicRoot");ye(this,"maxGlobstarRecursion");ye(this,"regexp");Fa(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||Q0,this.isWindows=this.platform==="win32";const i="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);const i=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((a,u,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const f=a[0]===""&&a[1]===""&&(a[2]==="?"||!hv.test(a[2]))&&!hv.test(a[3]),p=/^[a-z]:/i.test(a[0]);if(f)return[...a.slice(0,4),...a.slice(4).map(m=>this.parse(m))];if(p)return[a[0],...a.slice(1).map(m=>this.parse(m))]}return a.map(f=>this.parse(f))});if(this.debug(this.pattern,s),this.set=s.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){const u=this.set[a];u[0]===""&&u[1]===""&&this.globParts[a][2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3])&&(u[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(const i of t)for(let s=0;s<i.length;s++)i[s]==="**"&&(i[s]="*");const{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s!==i&&r.splice(i,s-i)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((i,s)=>{const a=i[i.length-1];return s==="**"&&a==="**"?i:s===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(i.pop(),i):(i.push(s),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const a=t[s];s===1&&a===""&&t[0]===""||(a==="."||a==="")&&(r=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){const s=t[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(s))&&(r=!0,t.splice(i-1,2),i-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let i of t){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let u=s;for(;i[u+1]==="**";)u++;u>s&&i.splice(s+1,u-s);let l=i[s+1];const f=i[s+2],p=i[s+3];if(l!==".."||!f||f==="."||f===".."||!p||p==="."||p==="..")continue;r=!0,i.splice(s,1);const m=i.slice(0);m[s]="**",t.push(m),s--}if(!this.preserveMultipleSlashes){for(let u=1;u<i.length-1;u++){const l=i[u];u===1&&l===""&&i[0]===""||(l==="."||l==="")&&(r=!0,i.splice(u,1),u--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let a=0;for(;(a=i.indexOf("..",a+1))!==-1;){const u=i[a-1];if(u&&u!=="."&&u!==".."&&u!=="**"){r=!0;const f=a===1&&i[a+1]==="**"?["."]:[];i.splice(a-1,2,...f),i.length===0&&i.push(""),a-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let i=r+1;i<t.length;i++){const s=this.partsMatch(t[r],t[i],!this.preserveMultipleSlashes);if(s){t[r]=[],t[i]=s;break}}return t.filter(r=>r.length)}partsMatch(t,r,i=!1){let s=0,a=0,u=[],l="";for(;s<t.length&&a<r.length;)if(t[s]===r[a])u.push(l==="b"?r[a]:t[s]),s++,a++;else if(i&&t[s]==="**"&&r[a]===t[s+1])u.push(t[s]),s++;else if(i&&r[a]==="**"&&t[s]===r[a+1])u.push(r[a]),a++;else if(t[s]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(l==="b")return!1;l="a",u.push(t[s]),s++,a++}else if(r[a]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(l==="a")return!1;l="b",u.push(r[a]),s++,a++}else return!1;return t.length===r.length&&u}parseNegate(){if(this.nonegate)return;const t=this.pattern;let r=!1,i=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)r=!r,i++;i&&(this.pattern=t.slice(i)),this.negate=r}matchOne(t,r,i=!1){let s=0,a=0;if(this.isWindows){const l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),p=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),m=!p&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),d=f?3:l?0:void 0,g=m?3:p?0:void 0;if(typeof d=="number"&&typeof g=="number"){const[y,x]=[t[d],r[g]];y.toLowerCase()===x.toLowerCase()&&(r[g]=y,a=g,s=d)}}const{optimizationLevel:u=1}=this.options;return u>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(Tt)?de(this,Vt,tb).call(this,t,r,i,s,a):de(this,Vt,Si).call(this,t,r,i,s,a)}braceExpand(){return eb(this.pattern,this.options)}parse(t){Fa(t);const r=this.options;if(t==="**")return Tt;if(t==="")return"";let i,s=null;(i=t.match(zM))?s=r.dot?WM:BM:(i=t.match(CM))?s=(r.nocase?r.dot?LM:$M:r.dot?IM:kM)(i[1]):(i=t.match(HM))?s=(r.nocase?r.dot?qM:UM:r.dot?GM:ZM)(i):(i=t.match(MM))?s=r.dot?NM:DM:(i=t.match(FM))&&(s=jM);const a=ou.fromGlob(t,this.options).toMMPattern();return s&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:s}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const r=this.options,i=r.noglobstar?YM:r.dot?XM:JM,s=new Set(r.nocase?["i"]:[]);let a=t.map(f=>{const p=f.map(d=>{if(d instanceof RegExp)for(const g of d.flags.split(""))s.add(g);return typeof d=="string"?nD(d):d===Tt?Tt:d._src});p.forEach((d,g)=>{const y=p[g+1],x=p[g-1];d!==Tt||x===Tt||(x===void 0?y!==void 0&&y!==Tt?p[g+1]="(?:\\/|"+i+"\\/)?"+y:p[g]=i:y===void 0?p[g-1]=x+"(?:\\/|\\/"+i+")?":y!==Tt&&(p[g-1]=x+"(?:\\/|\\/"+i+"\\/)"+y,p[g+1]=Tt))});const m=p.filter(d=>d!==Tt);if(this.partial&&m.length>=1){const d=[];for(let g=1;g<=m.length;g++)d.push(m.slice(0,g).join("/"));return"(?:"+d.join("|")+")"}return m.join("/")}).join("|");const[u,l]=t.length>1?["(?:",")"]:["",""];a="^"+u+a+l+"$",this.partial&&(a="^(?:\\/|"+u+a.slice(1,-1)+l+")$"),this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;const i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const a=this.set;this.debug(this.pattern,"set",a);let u=s[s.length-1];if(!u)for(let l=s.length-2;!u&&l>=0;l--)u=s[l];for(const l of a){let f=s;if(i.matchBase&&l.length===1&&(f=[u]),this.matchOne(f,l,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return xt.defaults(t).Minimatch}}Vt=new WeakSet,tb=function(t,r,i,s,a){const u=r.indexOf(Tt,a),l=r.lastIndexOf(Tt),[f,p,m]=i?[r.slice(a,u),r.slice(u+1),[]]:[r.slice(a,u),r.slice(u+1,l),r.slice(l+1)];if(f.length){const S=t.slice(s,s+f.length);if(!de(this,Vt,Si).call(this,S,f,i,0,0))return!1;s+=f.length,a+=f.length}let d=0;if(m.length){if(m.length+s>t.length)return!1;let S=t.length-m.length;if(de(this,Vt,Si).call(this,t,m,i,S,0))d=m.length;else{if(t[t.length-1]!==""||s+m.length===t.length||(S--,!de(this,Vt,Si).call(this,t,m,i,S,0)))return!1;d=m.length+1}}if(!p.length){let S=!!d;for(let E=s;E<t.length-d;E++){const R=String(t[E]);if(S=!0,R==="."||R===".."||!this.options.dot&&R.startsWith("."))return!1}return i||S}const g=[[[],0]];let y=g[0],x=0;const h=[0];for(const S of p)S===Tt?(h.push(x),y=[[],0],g.push(y)):(y[0].push(S),x++);let w=g.length-1;const v=t.length-d;for(const S of g)S[1]=v-(h[w--]+S[0].length);return!!de(this,Vt,Yc).call(this,t,g,s,0,i,0,!!d)},Yc=function(t,r,i,s,a,u,l){const f=r[s];if(!f){for(let d=i;d<t.length;d++){l=!0;const g=t[d];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return l}const[p,m]=f;for(;i<=m;){if(de(this,Vt,Si).call(this,t.slice(0,i+p.length),p,a,i,0)&&u<this.maxGlobstarRecursion){const y=de(this,Vt,Yc).call(this,t,r,i+p.length,s+1,a,u+1,l);if(y!==!1)return y}const g=t[i];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1;i++}return a||null},Si=function(t,r,i,s,a){let u,l,f,p;for(u=s,l=a,p=t.length,f=r.length;u<p&&l<f;u++,l++){this.debug("matchOne loop");let m=r[l],d=t[u];if(this.debug(r,m,d),m===!1||m===Tt)return!1;let g;if(typeof m=="string"?(g=d===m,this.debug("string match",m,d,g)):(g=m.test(d),this.debug("pattern match",m,d,g)),!g)return!1}if(u===p&&l===f)return!0;if(u===p)return i;if(l===f)return u===p-1&&t[u]==="";throw new Error("wtf?")};xt.AST=ou;xt.Minimatch=su;xt.escape=PM;xt.unescape=Co;var Zf=(e=>(e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.WELCOME="welcome",e.SETTINGS="settings",e.ROOT="root",e.REPORTS="report",e))(Zf||{});const wr={CLASSES:"Classes",METHODS:"Methods",SHARED:"Shared",WEBFORMS:"WebForms",CLASSES_FOLDER:"ClassesFolder",REPORTS:"Reports",DEBUGGER:"Debugger"};var ke=(e=>(e.FOLDER="folder",e.WEBFORM="webform",e.REPORT="report",e.METHOD="method",e.CLASS="class",e.CLASS_FOLDER="classfolder",e.DEBUGGER="debugger",e.WELCOME="welcome",e.SETTINGS="settings",e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.DEBUGGERS="debugger",e.MODELS="models",e.ROLES="roles",e.HTTP_HANDLERS="http-handlers",e.LOCALIZATION="localization",e.MODEL="model",e.DATA_EXPLORER="dataexplorer",e.MOBILE="mobile",e.MOBILEFORM="mform",e.FILE="file",e.TEXT="text",e))(ke||{}),Cn=(e=>(e.GET_FOLDER="getFolder",e.GET="get",e.SAVE="save",e.RENAME="rename",e.DROP="drop",e.ADD_FOLDER="addFolder",e.CREATE_FOLDER="mkdir",e.RENAME_FOLDER="renameFolder",e.DROP_FOLDER="dropFolder",e.REMOVE_ITEM="removeItem",e.MOVE_ITEM="moveItem",e.GET_INFO="getInfo",e.SAVE_CONTENT="save",e.UPDATE_CHECK="update:check",e.UPDATE_INSTALL="update:install",e.GET_APP_SETTINGS="getWebServerInfo",e.GET_FILE_CONTENT="getFileContent",e.SET_FILE_CONTENT="setFileContent",e.GET_FILES_INFO="getFilesInfo",e))(Cn||{}),Vf=(e=>(e[e.DISABLED=0]="DISABLED",e[e.ENABLED=1]="ENABLED",e))(Vf||{});const Kf="roles.json",Yf="qodlyApp.json",rb="model.4DModel",Xf="HTTPHandlers.json",Jf="Shared/i18n.json",nb=[{pattern:Yf,editor:{key:"editors:settings"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:Kf,editor:{key:"editors:roles"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:Xf,editor:{key:"editors:http-handlers"},supportedEditors:[{key:"editors:code",config:{language:"json"}}]},{pattern:Jf,editor:{key:"editors:localization"},supportedEditors:[{key:"editors:code",config:{language:"json"}}]},{pattern:rb,editor:{key:"editors:model"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:"**/*.webform",editor:{key:"editors:webforms"},supportedEditors:[{key:"editors:event-report"},{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:"**/*.qodoc",editor:{key:"editors:reports"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:"Methods/*.4dm",editor:{key:"editors:code:method",config:{theme:"fd-dark",language:"4d"}}},{pattern:"Methods/*.4qs",editor:{key:"editors:code:method",config:{theme:"fd-dark",language:"4d"}}},{pattern:"Classes/*.4dm",editor:{key:"editors:code",config:{theme:"fd-dark",language:"4d"}}},{pattern:"Classes/*.4qs",editor:{key:"editors:code",config:{theme:"fd-dark",language:"4d"}}},{pattern:"**/*.+(json)",editor:{key:"editors:code",config:{language:"json"}}},{pattern:"**/*.+(js)",editor:{key:"editors:code",config:{language:"js"}}},{pattern:"**/*.+(css)",editor:{key:"editors:code",config:{language:"css"}}},{pattern:"**/*.+(txt)",editor:{key:"editors:code",config:{language:""}}},{pattern:"Debugger/*",editor:{key:"editors:code",config:{theme:"fd-dark",language:"4d"}}},{pattern:"**/*.+(png|jpeg|jpg|gif|svg)",editor:{key:"editors:img"}}];function iD(e){const t=Qf(e);switch(t){case ke.SETTINGS:return{filename:"Settings",type:t};case ke.HTTP_HANDLERS:return{filename:"HTTP Handlers",type:t};case ke.ROLES:return{filename:"Roles & Privileges",type:t};case ke.LOCALIZATION:return{filename:"Localization",type:t};case ke.MODEL:return{filename:"Model",type:t};default:{const r=e.split("/"),[i]=r[1].split(".");return{filename:i,type:t}}}}function oD(e){const t=nb.find(({pattern:r})=>xt(e,r,{nocase:!0}));return t||{pattern:"",editor:{key:"editors:unknown",config:{language:"text"}}}}function Qf(e){const t=e.split("."),r=t.pop(),i=t.join(".").split("/")[0];switch(!0){case r==="4DModel":return ke.MODEL;case r==="WebForm":return ke.WEBFORM;case(["4dm","4qs","4qm"].includes(r)&&i===wr.METHODS):return ke.METHOD;case(["4dm","4qs","4qm"].includes(r)&&i===wr.CLASSES):return ke.CLASS;case e===Kf:return ke.ROLES;case e===Xf:return ke.HTTP_HANDLERS;case e===Yf:return ke.SETTINGS;case e===Jf:return ke.LOCALIZATION;default:return ke.TEXT}}function ib(e,t=!1){switch(e){case wr.REPORTS:case"report":return"QoDoc";case wr.WEBFORMS:case"webform":return"WebForm";case"Mobile":case"mform":return"MForm";case"class":case"method":case wr.CLASSES:case wr.METHODS:return t?"4qs":"4dm";default:return""}}function sD(e,t=""){const r=new RegExp("(?<=\\/)(\\w+)(?=\\.)").exec(e);return r?r[1]:t}function aD(e,t,r){switch(t){case ke.MOBILEFORM:return`${e}.MForm`;case ke.WEBFORM:return`${e}.WebForm`;case ke.REPORT:return`${e}.QoDoc`;case ke.METHOD:case ke.CLASS:return`${e}.${r?"4qs":"4dm"}`;default:return e}}class ob{constructor(){this.current=Promise.resolve()}lock(){let t;const r=new Promise(s=>{t=s}),i=this.current.then(()=>t);return this.current=r,i}}function ed(){const e=new ob;return async t=>{const r=await e.lock();try{const i=await t();return r(),i}catch(i){console.error(i),r();return}}}const uD="4DWS_PREFS",sb=Ie.curry((e,t,r)=>e&&Ie.get(r,e)===t),lD=Ie.curry((e,t,r)=>Ie.get(r,e)!==t),cD=Ie.curry((e,t)=>Ie.get(t,"id")!==e),fD=Ie.curry((e,t)=>Ie.get(t,"id")===e),dD=Ie.curry((e,t)=>Ie.get(t,"path")===e);function pD(e="id",t,r){return r.findIndex(sb(e,t))!==-1}function ab(e,t){return e==null?void 0:e.localeCompare(t,void 0,{numeric:!0})}function hD(){try{const e=localStorage.getItem(uD);return{...e?JSON.parse(e):{},"features.experimental.i18n":!0}}catch(e){console.error(e)}}function gD(e){if(!e)return"";const{id:t,namespace:r}=e;return r&&t?`${r}:${t}`:t}function td(e=""){const t=e.trim().split(":")||[];let r="",i="";return t.length>1?(r=t[1],i=t[0]):r=t[0],{id:r,namespace:i,root:r.split(".").filter(Boolean)[0],original:i?`${i}:${r}`:r,parts:t}}function ub(e){return["bool","word","string","text","uuid","short","long","number","long64","duration","object","date","image","blob"].includes(e.type||"")}const mD={bool:"bool",string:"string",text:"string",uuid:"string",short:"number",long:"number",number:"number",long64:"number",duration:"number",object:"object",date:"date",blob:"blob",image:"image",word:"number"};function vD(e){return e?mD[e]:void 0}function yD(e){return e.type==="object"}function lb(e){var t;return e.kind==="relatedEntities"||((t=e.type)==null?void 0:t.includes("Selection"))||e.behavior==="relatedEntities"}function cb(e){return e.kind==="relatedEntity"||e.behavior==="relatedEntity"||!ub(e)}function bD(e){return lb(e)||cb(e)}function wD(e){return e.applyTo==="dataStore"}function xD(e){return e.applyTo==="dataClass"}function SD(e){return e.applyTo==="entity"}function ED(e){return e.applyTo==="entityCollection"}function _D(e){return e.type==="entity"}function TD(e){return e.type==="entitysel"}function fb(e){return e.dataType==="array"}function db(e){return e.dataType==="object"}function pb(e){return e.type==="scalar"}function OD(e){return fb(e)||db(e)||pb(e)}const AD=e=>e!=null&&e.type==="entity",RD=e=>e.type==="entitysel",PD=e=>e.type==="array"||e.type==="scalar"&&e.dataType==="array",CD=e=>e.type==="object"||e.type==="scalar"&&e.dataType==="object",kD=e=>e.type==="scalar"&&e.dataType==="date",ID=(e,t)=>(e||"")===(t||"");function $D(){return new Promise((e,t)=>{window.addEventListener("bundle:ready",r=>r.data?e():t(r.caughtErr))})}function LD(){return new Promise(e=>{window.addEventListener("i18n:ready",()=>e())})}const ko="Qodly",hb="Location",gb="UserLanguage",mb="Title",ja={[ko]:[{id:mb,dataType:"string",type:"scalar",namespace:ko,initialValue:""},{id:hb,dataType:"object",type:"scalar",namespace:ko,initialValue:{urlQuery:[],urlPath:{},Anchor:""},schema:{type:"object",properties:[{name:"urlQuery",type:"object",initialValue:{}},{name:"urlPath",type:"array",initialValue:[]},{name:"Anchor",type:"string",initialValue:""}]}},{id:gb,dataType:"object",type:"scalar",namespace:ko,initialValue:{selected:{},supported:[]},schema:{type:"object",properties:[{name:"selected",type:"object",initialValue:{},attributes:[{name:"isocode",type:"string"},{name:"local",type:"string"},{name:"native",type:"string"},{name:"flag",type:"string"}]},{name:"supported",type:"array",initialValue:[],attributes:[{name:"isocode",type:"string"},{name:"local",type:"string"},{name:"native",type:"string"},{name:"flag",type:"string"}]}]}}]};var qo=(e=>(e.capable="capable",e.incapable="incapable",e.indifferent="indifferent",e))(qo||{}),vb=(e=>(e.soap="soap",e.web="web",e.sql="sql",e.rest="rest",e))(vb||{}),rd=(e=>(e.table="table",e.catalog="catalog",e.currentRecord="currentRecord",e.currentSelection="currentSelection",e))(rd||{});const MD={publishedSoap:"soap",publishedWeb:"web",publishedSql:"sql",publishedRest:"rest"};function DD(e){var a;let t={};try{const u=((a=e.match(/\/\/%attributes = (.*)/))==null?void 0:a[1])||"";t=JSON.parse(u)}catch{}const{published4DMobile:r,...i}=t;return{...{invisible:!1,shared:!1,executedOnServer:!1,preemptive:qo.indifferent,publishedSoap:!1,publishedWsdl:!1,publishedWeb:!1,publishedSql:!1,publishedRest:!!r,publishedRestOptions:r||{table:"",scope:rd.table}},...i}}function yb(e){const t={};return e.invisible&&(t.invisible=!0),e.shared&&(t.shared=!0),e.executedOnServer&&(t.executedOnServer=!0),e.preemptive&&[qo.capable,qo.incapable].includes(e.preemptive)&&(t.preemptive=e.preemptive),e.publishedSoap&&(t.publishedSoap=!0,e.publishedWsdl&&(t.publishedWsdl=!0)),e.publishedWeb&&(t.publishedWeb=!0),e.publishedSql&&(t.publishedSql=!0),e.publishedRest&&e.publishedRestOptions&&(t.published4DMobile=e.publishedRestOptions),JSON.stringify(t).replace(/"(true|false)"/g,"$1")}function ND(e,t,r=!1){const i=Ie.isString(t)?t:yb(t);if(!r&&bb(e))return e;const s=wb(e);return`//%attributes = ${i}\r
|
|
204
|
+
${s}`}function bb(e){return/^\/\/%attributes.*(?:\r\n|\n)?/g.test(e)}function wb(e){return e.replace(/^\/\/%attributes.*(?:\r\n|\n)?/g,"")}const Xc=()=>On.uuid().replaceAll("-","").toUpperCase();function FD(e){var s,a;const t=new Map,r=new Map,i=new Map;return(s=e.singletons)==null||s.forEach(({methods:u=[],...l})=>{i.set(l.name,{...l,methods:u})}),(a=e.dataClasses)==null||a.forEach(({methods:u=[],...l})=>{const f={...l,methods:u};if(f.uuid||(f.uuid=Xc()),f.attributes){const p=["storage","relatedEntity"];f.attributes=f.attributes.map(m=>p.includes(m.kind)&&!m.uuid?{...m,uuid:Xc()}:m)}r.set(f.className,f),t.set(f.collectionName,f)}),{...e,methods:e.methods||[],dataClasses:Object.fromEntries(r.entries()),dataClassByCollectionName:Object.fromEntries(t.entries()),singletons:Object.fromEntries(i.entries())}}const jD=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/_{2,}/g,"_").replace(/^_|_$/g,"");var ze=(e=>(e.DATACLASS="dataclass",e.METHOD="method",e.ATTRIBUTE="attribute",e.DATASTORE="datastore",e.SINGLETON="singleton",e.SINGLETON_METHOD="singletonMethod",e))(ze||{}),Ke=(e=>(e.DS_METHOD="dsMethod",e.DATACLASS_METHOD="dataclassMethod",e.ENTITY_METHOD="entityMethod",e.ENTITY_SEL_METHOD="entityselMethod",e))(Ke||{});const zD=[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE,ze.SINGLETON_METHOD,ze.SINGLETON,ze.METHOD,Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD],gv=e=>[Ke.DS_METHOD,Ke.ENTITY_METHOD,Ke.DATACLASS_METHOD].includes(e)?ze.METHOD:e,za="guest",nd=[{key:"read",label:"Read",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"create",label:"Create",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"update",label:"Update",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"drop",label:"Delete",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.ATTRIBUTE]},{key:"execute",label:"Execute",canApplyTo:[ze.DATASTORE,ze.DATACLASS,ze.METHOD,Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD,ze.SINGLETON,ze.SINGLETON_METHOD]},{key:"promote",label:"Promote",canApplyTo:[ze.METHOD,Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD,ze.SINGLETON_METHOD]}];function lr(e,...t){return Array.from(new Set([...e,...t]))}function xb(e){const t={},r=new Map;e.forEach(f=>{const p=f.id||On.generate();t[p]={...f,id:p,parents:[],includes:lr(f.includes||[]),resources:[]},r.set(f.privilege,p)}),Object.entries(t).forEach(([f,p])=>{const m=p.includes.map(d=>{const g=r.get(d);return g?(t[g].parents=lr(t[g].parents,g),g):""}).filter(Boolean);t[f]={...p,includes:m}});const i=Sb(t),s=new Set;function a(f){s.add(f.id),f.includes=f.includes.filter(p=>!s.has(p))}if(i.forEach(a),i.forEach(f=>f.parents=[]),i.forEach(f=>{f.includes.forEach(p=>t[p].parents.push(f.id))}),Object.values(t).find(({privilege:f})=>f===za))return t;const l=On.generate();return{[l]:{id:l,privilege:za,includes:[],parents:[],resources:[]},...t}}function Sb(e){return Object.values(e).sort((t,r)=>t.parents.length-r.parents.length)}function au(e,t){const r=t[e];let i=[];return r&&r.parents.forEach(s=>{i=lr(i,...au(s,t),s)}),i}function Ba(e,t){const r=t[e];let i=[];return r&&r.includes.forEach(s=>{i=lr(i,...Ba(s,t),s)}),i}function BD(e,t){const r=t[e];if(!r)return[];const i=[e,...au(e,t),...r.includes];return Object.keys(t).filter(s=>!i.includes(s))}function WD(e,t){return t[e]?Object.keys(t).reduce((i,s)=>s===e?i:{...i,[s]:{...t[s],parents:t[s].parents.filter(a=>a!==e),includes:t[s].includes.filter(a=>a!==e)}},{}):t}function HD(e,t,r){const i=r[e],s=r[t];return!i||!s?r:{...r,[e]:{...r[e],includes:lr(i.includes,t)},[t]:{...r[t],parents:lr(s.parents,e)}}}function UD(e,t,r){const i=r[e],s=r[t];return!i||!s?r:{...r,[e]:{...r[e],includes:r[e].includes.filter(a=>a!==t)},[t]:{...r[t],parents:r[t].parents.filter(a=>a!==e)}}}function qD(e,t){nu(e),Object.entries(t).forEach(([,{privilege:i}])=>{if(e.toLowerCase()===i.toLowerCase())throw new Error(`There's already a Privilege with the name ${e}`)});const r=On.generate();return{[r]:{id:r,privilege:e,includes:[],parents:[],resources:[]},...t}}function GD(e,t,r){if(!e)throw new Error("Please enter a name");if(!r[t])throw new Error("Invalid privilege");return Object.entries(r).forEach(([,{privilege:i,id:s}])=>{if(e.toLowerCase()===i.toLowerCase()&&t!==s)throw new Error(`There's already a Privilege with the name ${e}`)}),{...r,[t]:{...r[t],privilege:e}}}function ZD(e,t){return e.map(r=>rn(r,t))}function rn(e,t){return t[e]?t[e]:null}function Eb({applyTo:e,type:t,...r}){return Object.entries(r).reduce((i,[s,a])=>{const u=Ie.find(nd,["key",s]);return!u||!u.canApplyTo.includes(t)||(typeof a=="string"?a.split(","):a).forEach(f=>{i[f]=lr(i[f]||[],s)}),i},{})}const mv=(e,t=!1)=>["read","create","update","delete"].includes(e.toLowerCase())?`All ${t?"dataclasses and ":""}attributes have the '${e.toLowerCase()}' permission`:e.toLowerCase()==="execute"?`All functions defined ${t?"through the model (DataStore, Dataclasses, Entity selections, Entities) have the execute permission":"on this Dataclass, Entity selection class, Entity class have the execute permission"}`:`All ${t?"dataclasses, ":""}attributes and functions have the '${e.toLowerCase()}' permission`;function id(e){return{permissions:nd.filter(({canApplyTo:t})=>t.includes(e.type)).map(({key:t,label:r})=>{const i={name:t,from:[]};switch(e.type){case ze.DATASTORE:return{...i,info:mv(r,!0)};case ze.DATACLASS:return{...i,info:mv(r)};default:return i}}),resource:e.applyTo,type:e.type}}function _b(e,t){const r=Tb(t),i={};return e.filter(({type:s})=>zD.includes(s)).forEach(s=>{const a=Eb(s);Object.entries(a).forEach(([u,l])=>{var m;const f=(m=r[u])==null?void 0:m.id;if(!f)return;i[f]=i[f]||{...t[f]};let p=Ie.find(i[f].resources,{resource:s.applyTo,type:s.type});p||(p=id(s),i[f].resources.push(p)),p.permissions=p.permissions.map(d=>({...d,checked:d.checked||l.includes(d.name)}))})}),{...t,...i}}function Tb(e){return Object.values(e).reduce((t,r)=>({...t,[r.privilege]:r}),{})}function VD(e){var r;if(!e)throw new Error("Invalid roles data");const t=xb(e.privileges||[]);return{forceLogin:(e==null?void 0:e.forceLogin)||!1,restrictedByDefault:(e==null?void 0:e.restrictedByDefault)||!1,privileges:_b(((r=e==null?void 0:e.permissions)==null?void 0:r.allowed)||[],t),roles:((e==null?void 0:e.roles)||[]).map(({id:i=On.generate(),role:s,privileges:a=[]})=>({id:i,role:s,privileges:lr(a).map(u=>{var l;return(l=Object.values(t).find(({privilege:f})=>f===u))==null?void 0:l.id}).filter(Boolean)})).reduce((i,s)=>({...i,[s.id]:{...s}}),{})}}function KD(e){const t=Object.values(e.privileges).filter(({includes:i})=>i.length===0).map(({id:i})=>i),r=[...t,...t.map(i=>au(i,e.privileges).reverse())].flat().filter((i,s,a)=>a.indexOf(i)===s).map(i=>e.privileges[i]);return{forceLogin:e.forceLogin||!1,restrictedByDefault:e.restrictedByDefault||!1,permissions:{allowed:Object.values(e.privileges).reduce((i,s)=>(s.resources.forEach(({permissions:a,resource:u,type:l})=>{let f=Ie.find(i,{applyTo:u,type:gv(l)});f||(f={applyTo:u,type:gv(l)},i.push(f)),a.forEach(({name:p,checked:m})=>{m&&f&&(f[p]=f[p]||[],f[p].push(s.privilege))})}),i),[])},privileges:r.filter(({privilege:i})=>i!==za).map(({id:i,includes:s,privilege:a})=>({id:i,privilege:a,includes:s.map(u=>e.privileges[u].privilege)})),roles:Object.values(e.roles).map(i=>({...i,privileges:i.privileges.map(s=>{var a;return(a=e.privileges[s])==null?void 0:a.privilege}).filter(Boolean)}))}}function YD(e,t){const r=t[e],i={children:[],links:[],parents:[],selected:e};if(!r)return i;function s(l,f,p=[]){const m=l.reduce((d,g)=>[...d,...t[g][f]],[]);return m.length===0?p:(p.push(m),s(m,f,p))}function a(l){const f=[],p=[];for(let m=l.length-1;m>=0;m-=1){const d=l[m].filter(g=>f.includes(g)?!1:(f.push(g),!0));d.length>0&&p.unshift(lr(d))}return p}function u(l,f){const p=[];return l.reduce((m,d)=>(d.forEach(g=>{t[g][f==="parents"?"includes":"parents"].forEach(x=>{p.includes(x)&&m.push(f==="parents"?{source:g,target:x}:{source:x,target:g})}),p.push(g)}),m),[])}return i.children=s([e],"includes"),i.children=a(i.children),i.parents=s([e],"parents"),i.parents=a(i.parents),i.links=[...u([[e],...i.parents],"parents"),...u([[e],...i.children],"includes")],i}function XD(e,t,r){const i=rn(e,r);if(!i||Ie.find(i.resources,{resource:t.applyTo,type:t.type}))return r;const s={...i,resources:[...i.resources,id(t)]};return{...r,[e]:s}}function JD(e,t,r){const i=rn(e,r);if(!i)return r;const s={...i,resources:i.resources.filter(({resource:a,type:u})=>a!==t.applyTo||u!==t.type)};return{...r,[e]:s}}function QD(e,t){const r=Object.entries(e).map(([i,s])=>{const a=rn(i,t);if(!a)return{[i]:t[i]};const u={...a,resources:a.resources.filter(({resource:l,type:f})=>!s.some(p=>p.applyTo===l&&p.type===f))};return{[i]:u}}).reduce((i,s)=>({...i,...s}),{});return{...t,...r}}function eN(e,t){const r=rn(e,t);if(!r)return t;const i={...r,resources:r.resources.filter(s=>s.permissions.some(a=>a.from.length)).map(s=>({...s,permissions:s.permissions.map(a=>({...a,checked:!1}))}))};return{...t,[e]:i}}function tN(e,t,r,i){const s=rn(e,i);if(!s)return i;const u=Ie.find(s.resources,{type:t.type,resource:t.resource})?{...s,resources:s.resources.map(l=>l.type===t.type&&l.resource===t.resource?{...l,permissions:t.permissions.map(f=>f.name===r.name?{...f,checked:!f.checked,from:[]}:f)}:l)}:{...s,resources:[...s.resources,{...t,permissions:t.permissions.map(l=>({...l,checked:r.name===l.name,from:[]}))}]};return{...i,[e]:u}}function rN(e,t){var f;const r=Ob(e,t)||[],i=((f=rn(e,t))==null?void 0:f.resources)||[],u=([...r,...i].filter(({type:p})=>[Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD].includes(p))||[]).map(({resource:p})=>p);return Object.entries(t).reduce((p,[m,{resources:d}])=>(d.filter(({resource:g,type:y})=>[Ke.DS_METHOD,Ke.DATACLASS_METHOD,Ke.ENTITY_METHOD,Ke.ENTITY_SEL_METHOD].includes(y)&&u.includes(g)).forEach(({permissions:g,resource:y})=>{var h;((h=g.find(({name:w})=>w==="promote"))==null?void 0:h.checked)&&(p[y]=lr(p[y]||[],m))}),p),{})}function Ob(e,t){var u;const r=rn(e,t);if(!r)return[];const i=(u=Object.values(t).find(l=>l.privilege===za))==null?void 0:u.id;return(i&&i!==e?lr(Ba(e,t),i):Ba(e,t)).reduce((l,f)=>(t[f].resources.forEach(m=>{if(m.permissions.filter(({checked:y,name:x})=>y&&x!=="promote").length===0)return;const g=Ie.find(l,{type:m.type,resource:m.resource});if(!g){l.push({...m,permissions:m.permissions.map(y=>({...y,from:y.checked?[f]:[],checked:!1}))});return}g.permissions=g.permissions.map((y,x)=>{let{from:h=[]}=y;return m.permissions[x].checked&&!h.includes(f)&&(h=[...h,f]),{...y,from:h,checked:y.checked}})}),l),Ie.clone(r.resources.map(l=>({...l,permissions:l.permissions.map(({checked:f,...p})=>({...p,checked:!!f}))}))))}const nN=(e,t,r)=>{const i={id:e,role:t,privileges:[]};return{...r,[i.id]:i}},iN=(e,t)=>t[e]?Object.values(t).reduce((r,i)=>e===i.id||i.role===""?r:{...r,[i.id]:i},{}):t,oN=(e,t)=>{if(nu(e.role),Object.values(t).find(i=>i.role===e.role))throw new Error(`a role with the name ${e.role} already exists`);return Object.values(t).reduce((i,s)=>e.id===s.id?{...i,[e.id]:e}:{...i,[s.id]:s},{})};function Ab(e){var r;if(!e||typeof e!="object")return[];const t=((r=e.__STATUS)==null?void 0:r.errors)??e.__ERRORS??e.errorStack;return Array.isArray(t)?t:[]}function Rb(e,t){return t?e.filter(r=>r.seriousError===!0):[]}function sN(e,t){const r=Ab(e);return Rb(r,t)}function aN(e){const t=e.map(r=>typeof r.message=="string"?r.message:String(r));return t.length===0?[]:[{messages:t}]}var Pb=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(Pb||{}),Cb=(e=>(e.GROUP="group",e.TEXT_FIELD="textfield",e.COLOR_PICKER="colorpicker",e.LAYOUT="layout",e.RADIOGROUP="radiogroup",e.SELECT="select",e.BORDERS="borders",e.BORDER_RADIUS="borderRadius",e.DIMENSIONS="dimensions",e.COMBOBOX="combobox",e.UNITFIELD="unitfield",e.DATAGRID="datagrid",e.CHECKBOX="checkbox",e.NUMBER_FIELD="number",e.FORMAT_FIELD="format",e.DISPLAY="display",e.BOXSHADOW="boxshadow",e.CSSCLASS_SELECTOR="cssClassSelector",e.CUSTOM_STYLE_PROPS_SELECTOR="customStylePropertiesSelector",e.ICON_PICKER="iconPicker",e.ASYNC_SELECT="asyncSelect",e.DS_AUTO_SUGGEST="dsAutoSuggest",e.POSITION="position",e.BACKGROUND="background",e.SELECTBOXLENGTH="selectBoxLength",e.I18NFIELD="i18nField",e.DATE_INTERVALS="dateIntervals",e.SEARCH_MODE="searchMode",e))(Cb||{}),kb=(e=>(e.SHOW_AFTER_TIMEOUT="show_after_timeout",e.HIDE_AFTER_TIMEOUT="hide_after_timeout",e))(kb||{}),od=(e=>(e.AIRY="airy",e.COMPACT="neutral",e))(od||{}),Ib=(e=>(e.GRID="grid",e.COMPACT="compact",e))(Ib||{}),$b=(e=>(e[e.METHOD=1]="METHOD",e[e.CLASS=10]="CLASS",e))($b||{}),Lb=(e=>(e.WelCome="WelCome",e.ActionPanel="ActionPanel",e.SideBar="SideBar",e.Settings="Settings",e.Main="Main",e.Explorer="Explorer",e.Header="Header",e.ComponentList="ComponentList",e))(Lb||{});const uN={SIDEBAR_SECTION_RESIZABLE:"sidebar.section.resizable"};var Mb=(e=>(e[e.FILE_NOT_FOUND=1839]="FILE_NOT_FOUND",e[e.JSON_MALFORMED=554]="JSON_MALFORMED",e[e.JSON_MALFORMED_AT_LINE=550]="JSON_MALFORMED_AT_LINE",e))(Mb||{});const Db={label:"Base",id:"root"},lN=["rounded-full","rounded-lg","border-gray-400","border-2","bg-red-500","bg-blue-500","bg-indigo-500","bg-transparent","bg-primary-dark","bg-green-500","bg-yellow-400","text-gray-500","text-4xl","text-white","px-4","py-2","primary","info","secondary","success","warning","danger","w-10","w-20","w-40","w-60","w-80","mb-2","mb-3","shadow","shadow-lg","shadow-xl","shadow-2xl"],cN=e=>e.id===Db.id,sd=(e,t,r="")=>t?e.type==="currentState"&&e.value===t?{...e,value:r}:e.type==="combination"&&e.conditions?{...e,conditions:e.conditions.map(i=>sd(i,t,r))}:e:e;function fN(e,t){const{id:r,label:i}=t;return{...e,components:Object.entries(e.components||{}).reduce((s,[a,u])=>({...s,[a]:{...u,custom:Object.entries(u.custom).reduce((l,[f,p])=>f===`states:${r}`?l:{...l,[f]:p},{}),props:Object.entries(u.props).reduce((l,[f,p])=>{let m=p;return f==="events"&&(m=m.map(d=>{var g,y;return d.type==="simple-action"?{...d,state:{...d.state,states:(y=(g=d.state)==null?void 0:g.states)==null?void 0:y.filter(x=>x!==r)}}:d})),{...l,[f]:m}},{})}}),{}),metadata:{...e.metadata,states:e.metadata.states.filter(s=>(s==null?void 0:s.id)!==r).map(s=>s.conditions?{...s,conditions:sd(s.conditions,i)}:s)}}}const Nb=(e,t,r)=>{switch(e.type){case"datasource":return{...e,path:e.path===t?r:e.path,value:e.valueType==="datasource"&&e.value===t?r:e.value,compareValue:e.compareValueType==="datasource"&&e.compareValue===t?r:e.compareValue};case"privilege":case"currentState":case"parentState":if(e.valueType==="datasource")return{...e,value:e.value===t?r:e.value};break;case"combination":return{...e,conditions:(e.conditions||[]).map(i=>Nb(i,t,r))}}return e},Fb=(e,t)=>{if(e.id===t||e.type==="reference"&&e.ref===t)return null;if(e.type==="combination"&&e.conditions){const r=e.conditions.map(i=>Fb(i,t)).filter(Boolean);return r.length===1?{...r[0],id:e.id}:{...e,conditions:r}}return e},jb=e=>e.id?e.type==="combination"&&e.conditions?{...e,conditions:e.conditions.map(jb)}:e:{...e,id:On.generate()};function dN(e,t={}){switch(e){case ke.WEBFORM:case ke.WEBFORMS:{const r={metadata:{v:"1.0",datasources:[],styles:[]},components:{ROOT:{parent:"",type:{resolvedName:"Container"},isCanvas:!0,props:{airyMode:!1,className:"bg-white w-full px-6",classNames:[],events:[]},displayName:"Page",custom:{},hidden:!1,nodes:[],linkedNodes:{}}}};return t["webforms.display-mode"]===od.AIRY&&(r.components.ROOT.props.airyMode=!0),r}case ke.REPORT:return{metadata:{v:"1.0",datasources:[],styles:[]},pages:[{name:"doc",id:"index",components:{ROOT:{type:{resolvedName:"Document"},isCanvas:!0,props:{classNames:[],events:[],airyMode:!1,className:"bg-white w-full px-6"},displayName:"Document",custom:{},parent:"",hidden:!1,nodes:[],linkedNodes:{}}}}]};case ke.METHOD:case ke.METHODS:return`//%attributes = {}
|
|
205
|
+
`;case ke.HTTP_HANDLERS:return[];case ke.LOCALIZATION:case ke.SETTINGS:return{};case ke.ROLES:return{permissions:{allowed:[]},privileges:[],roles:[]};default:return""}}function pN(e,t){return Ie.isEqual(e,t)}function hN(e,t){const{qodly:r=!0,withExtension:i=!0}=t||{},s=ib(e.type,r);let a="";switch(e.type){case ke.WEBFORM:a=`${wr.WEBFORMS}/${e.name}`;break;case ke.METHOD:a=`${wr.METHODS}/${e.name}`;break;case ke.CLASS:a=`${wr.CLASSES}/${e.name}`;break;default:return""}return`${a}${i?`.${s}`:""}`}function zb(...e){return(...t)=>{e.forEach(r=>r==null?void 0:r(...t))}}const gN=zb;function mN(e){return e?"":void 0}function vN(e,t){if(!e)return;const r=()=>{e.focus(t)};if(t!=null&&t.nextTick){requestAnimationFrame(r);return}r()}function yN(...e){return t=>{e.forEach(r=>{if(r){if(typeof r=="function"){r(t);return}r.current=t}})}}function bN({condition:e,message:t}){!e||process.env.NODE_ENV==="production"||console.warn(t)}const wN={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function xN(e,t){return e.some(r=>String(r)===String(t))?e:[...e,t]}function SN(e){return typeof e=="object"&&e!==null&&"target"in e&&typeof e.target=="object"}function EN(e){e.preventDefault(),e.stopPropagation()}const lt="/rest/$designer",Qo="/rest/$designer-ext";function _N(...e){return t=>{if(e.length===0)return t;const r={...t};return e.forEach(i=>{typeof r[i]=="string"&&(r[i]=new Date(r[i]))}),r}}class Jc extends Error{constructor(t,r,i){super(),this.url=t,this.response=r,this.data=i}log(){console.error("Error while sending the request",this)}}async function We(e,t){var s;Na.next({action:Uo.REQUEST_SENT});const r=await window.fetch(e,t);if(/401/.test(r.status.toString())&&(window.location.href="/login.html?redirect=studio"),/^[45]/.test(r.status.toString())){let a;try{const u=await r.json();((s=u==null?void 0:u.__ERROR)==null?void 0:s.some(f=>f.errCode===1651))&&Na.next({action:Uo.EVENT_EMITED,payload:{eventName:"onsessionexpired"}}),a=new Jc(e,r,u)}catch{a=new Jc(e,r)}throw a.log(),a}return await r.json()}function TN(e){return Na.next({action:Uo.REQUEST_SENT}),e}var Ar={},yt={},vv;function qn(){if(vv)return yt;vv=1;var e=yt.ValidationError=function(h,w,v,S,E,R){if(Array.isArray(S)?(this.path=S,this.property=S.reduce(function(C,W){return C+l(W)},"instance")):S!==void 0&&(this.property=S),h&&(this.message=h),v){var T=v.$id||v.id;this.schema=T||v}w!==void 0&&(this.instance=w),this.name=E,this.argument=R,this.stack=this.toString()};e.prototype.toString=function(){return this.property+" "+this.message};var t=yt.ValidatorResult=function(h,w,v,S){this.instance=h,this.schema=w,this.options=v,this.path=S.path,this.propertyPath=S.propertyPath,this.errors=[],this.throwError=v&&v.throwError,this.throwFirst=v&&v.throwFirst,this.throwAll=v&&v.throwAll,this.disableFormat=v&&v.disableFormat===!0};t.prototype.addError=function(h){var w;if(typeof h=="string")w=new e(h,this.instance,this.schema,this.path);else{if(!h)throw new Error("Missing error detail");if(!h.message)throw new Error("Missing error message");if(!h.name)throw new Error("Missing validator type");w=new e(h.message,this.instance,this.schema,this.path,h.name,h.argument)}if(this.errors.push(w),this.throwFirst)throw new i(this);if(this.throwError)throw w;return w},t.prototype.importErrors=function(h){typeof h=="string"||h&&h.validatorType?this.addError(h):h&&h.errors&&(this.errors=this.errors.concat(h.errors))};function r(x,h){return h+": "+x.toString()+`
|
|
206
|
+
`}t.prototype.toString=function(h){return this.errors.map(r).join("")},Object.defineProperty(t.prototype,"valid",{get:function(){return!this.errors.length}}),yt.ValidatorResultError=i;function i(x){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i),this.instance=x.instance,this.schema=x.schema,this.options=x.options,this.errors=x.errors}i.prototype=new Error,i.prototype.constructor=i,i.prototype.name="Validation Error";var s=yt.SchemaError=function x(h,w){this.message=h,this.schema=w,Error.call(this,h),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,x)};s.prototype=Object.create(Error.prototype,{constructor:{value:s,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var a=yt.SchemaContext=function(h,w,v,S,E){this.schema=h,this.options=w,Array.isArray(v)?(this.path=v,this.propertyPath=v.reduce(function(R,T){return R+l(T)},"instance")):this.propertyPath=v,this.base=S,this.schemas=E};a.prototype.resolve=function(h){return y(this.base,h)},a.prototype.makeChild=function(h,w){var v=w===void 0?this.path:this.path.concat([w]),S=h.$id||h.id;let E=y(this.base,S||"");var R=new a(h,this.options,v,E,Object.create(this.schemas));return S&&!R.schemas[E]&&(R.schemas[E]=h),R};var u=yt.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(x){return typeof x=="string"&&parseFloat(x)===parseInt(x,10)&&!isNaN(x)},regex:function(x){var h=!0;try{new RegExp(x)}catch{h=!1}return h},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};u.regexp=u.regex,u.pattern=u.regex,u.ipv4=u["ip-address"],yt.isFormat=function(h,w,v){if(typeof h=="string"&&u[w]!==void 0){if(u[w]instanceof RegExp)return u[w].test(h);if(typeof u[w]=="function")return u[w](h)}else if(v&&v.customFormats&&typeof v.customFormats[w]=="function")return v.customFormats[w](h);return!0};var l=yt.makeSuffix=function(h){return h=h.toString(),!h.match(/[.\s\[\]]/)&&!h.match(/^[\d]/)?"."+h:h.match(/^\d+$/)?"["+h+"]":"["+JSON.stringify(h)+"]"};yt.deepCompareStrict=function x(h,w){if(typeof h!=typeof w)return!1;if(Array.isArray(h))return!Array.isArray(w)||h.length!==w.length?!1:h.every(function(E,R){return x(h[R],w[R])});if(typeof h=="object"){if(!h||!w)return h===w;var v=Object.keys(h),S=Object.keys(w);return v.length!==S.length?!1:v.every(function(E){return x(h[E],w[E])})}return h===w};function f(x,h,w,v){typeof w=="object"?h[v]=d(x[v],w):x.indexOf(w)===-1&&h.push(w)}function p(x,h,w){h[w]=x[w]}function m(x,h,w,v){typeof h[v]!="object"||!h[v]?w[v]=h[v]:x[v]?w[v]=d(x[v],h[v]):w[v]=h[v]}function d(x,h){var w=Array.isArray(h),v=w&&[]||{};return w?(x=x||[],v=v.concat(x),h.forEach(f.bind(null,x,v))):(x&&typeof x=="object"&&Object.keys(x).forEach(p.bind(null,x,v)),Object.keys(h).forEach(m.bind(null,x,h,v))),v}yt.deepMerge=d,yt.objectGetPath=function(h,w){for(var v=w.split("/").slice(1),S;typeof(S=v.shift())=="string";){var E=decodeURIComponent(S.replace(/~0/,"~").replace(/~1/g,"/"));if(!(E in h))return;h=h[E]}return h};function g(x){return"/"+encodeURIComponent(x).replace(/~/g,"%7E")}yt.encodePath=function(h){return h.map(g).join("")},yt.getDecimalPlaces=function(h){var w=0;if(isNaN(h))return w;typeof h!="number"&&(h=Number(h));var v=h.toString().split("e");if(v.length===2){if(v[1][0]!=="-")return w;w=Number(v[1].slice(1))}var S=v[0].split(".");return S.length===2&&(w+=S[1].length),w},yt.isSchema=function(h){return typeof h=="object"&&h||typeof h=="boolean"};var y=yt.resolveUrl=function(h,w){const v=new URL(w,new URL(h,"resolve://"));if(v.protocol==="resolve:"){const{pathname:S,search:E,hash:R}=v;return S+E+R}return v.toString()};return yt}var wc,yv;function ON(){if(yv)return wc;yv=1;var e=qn(),t=e.ValidatorResult,r=e.SchemaError,i={};i.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var s=i.validators={};s.type=function(d,g,y,x){if(d===void 0)return null;var h=new t(d,g,y,x),w=Array.isArray(g.type)?g.type:[g.type];if(!w.some(this.testType.bind(this,d,g,y,x))){var v=w.map(function(S){if(S){var E=S.$id||S.id;return E?"<"+E+">":S+""}});h.addError({name:"type",argument:v,message:"is not of a type(s) "+v})}return h};function a(m,d,g,y,x){var h=d.throwError,w=d.throwAll;d.throwError=!1,d.throwAll=!1;var v=this.validateSchema(m,x,d,g);return d.throwError=h,d.throwAll=w,!v.valid&&y instanceof Function&&y(v),v.valid}s.anyOf=function(d,g,y,x){if(d===void 0)return null;var h=new t(d,g,y,x),w=new t(d,g,y,x);if(!Array.isArray(g.anyOf))throw new r("anyOf must be an array");if(!g.anyOf.some(a.bind(this,d,y,x,function(S){w.importErrors(S)}))){var v=g.anyOf.map(function(S,E){var R=S.$id||S.id;return R?"<"+R+">":S.title&&JSON.stringify(S.title)||S.$ref&&"<"+S.$ref+">"||"[subschema "+E+"]"});y.nestedErrors&&h.importErrors(w),h.addError({name:"anyOf",argument:v,message:"is not any of "+v.join(",")})}return h},s.allOf=function(d,g,y,x){if(d===void 0)return null;if(!Array.isArray(g.allOf))throw new r("allOf must be an array");var h=new t(d,g,y,x),w=this;return g.allOf.forEach(function(v,S){var E=w.validateSchema(d,v,y,x);if(!E.valid){var R=v.$id||v.id,T=R||v.title&&JSON.stringify(v.title)||v.$ref&&"<"+v.$ref+">"||"[subschema "+S+"]";h.addError({name:"allOf",argument:{id:T,length:E.errors.length,valid:E},message:"does not match allOf schema "+T+" with "+E.errors.length+" error[s]:"}),h.importErrors(E)}}),h},s.oneOf=function(d,g,y,x){if(d===void 0)return null;if(!Array.isArray(g.oneOf))throw new r("oneOf must be an array");var h=new t(d,g,y,x),w=new t(d,g,y,x),v=g.oneOf.filter(a.bind(this,d,y,x,function(E){w.importErrors(E)})).length,S=g.oneOf.map(function(E,R){var T=E.$id||E.id;return T||E.title&&JSON.stringify(E.title)||E.$ref&&"<"+E.$ref+">"||"[subschema "+R+"]"});return v!==1&&(y.nestedErrors&&h.importErrors(w),h.addError({name:"oneOf",argument:S,message:"is not exactly one from "+S.join(",")})),h},s.if=function(d,g,y,x){if(d===void 0)return null;if(!e.isSchema(g.if))throw new Error('Expected "if" keyword to be a schema');var h=a.call(this,d,y,x,null,g.if),w=new t(d,g,y,x),v;if(h){if(g.then===void 0)return;if(!e.isSchema(g.then))throw new Error('Expected "then" keyword to be a schema');v=this.validateSchema(d,g.then,y,x.makeChild(g.then)),w.importErrors(v)}else{if(g.else===void 0)return;if(!e.isSchema(g.else))throw new Error('Expected "else" keyword to be a schema');v=this.validateSchema(d,g.else,y,x.makeChild(g.else)),w.importErrors(v)}return w};function u(m,d){if(Object.hasOwnProperty.call(m,d))return m[d];if(d in m){for(;m=Object.getPrototypeOf(m);)if(Object.propertyIsEnumerable.call(m,d))return m[d]}}s.propertyNames=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=g.propertyNames!==void 0?g.propertyNames:{};if(!e.isSchema(w))throw new r('Expected "propertyNames" to be a schema (object or boolean)');for(var v in d)if(u(d,v)!==void 0){var S=this.validateSchema(v,w,y,x.makeChild(w));h.importErrors(S)}return h}},s.properties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=g.properties||{};for(var v in w){var S=w[v];if(S!==void 0){if(S===null)throw new r('Unexpected null, expected schema in "properties"');typeof y.preValidateProperty=="function"&&y.preValidateProperty(d,v,S,y,x);var E=u(d,v),R=this.validateSchema(E,S,y,x.makeChild(S,v));R.instance!==h.instance[v]&&(h.instance[v]=R.instance),h.importErrors(R)}}return h}};function l(m,d,g,y,x,h){if(this.types.object(m)&&!(d.properties&&d.properties[x]!==void 0))if(d.additionalProperties===!1)h.addError({name:"additionalProperties",argument:x,message:"is not allowed to have the additional property "+JSON.stringify(x)});else{var w=d.additionalProperties||{};typeof g.preValidateProperty=="function"&&g.preValidateProperty(m,x,w,g,y);var v=this.validateSchema(m[x],w,g,y.makeChild(w,x));v.instance!==h.instance[x]&&(h.instance[x]=v.instance),h.importErrors(v)}}s.patternProperties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=g.patternProperties||{};for(var v in d){var S=!0;for(var E in w){var R=w[E];if(R!==void 0){if(R===null)throw new r('Unexpected null, expected schema in "patternProperties"');try{var T=new RegExp(E,"u")}catch{T=new RegExp(E)}if(T.test(v)){S=!1,typeof y.preValidateProperty=="function"&&y.preValidateProperty(d,v,R,y,x);var C=this.validateSchema(d[v],R,y,x.makeChild(R,v));C.instance!==h.instance[v]&&(h.instance[v]=C.instance),h.importErrors(C)}}}S&&l.call(this,d,g,y,x,v,h)}return h}},s.additionalProperties=function(d,g,y,x){if(this.types.object(d)){if(g.patternProperties)return null;var h=new t(d,g,y,x);for(var w in d)l.call(this,d,g,y,x,w,h);return h}},s.minProperties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=Object.keys(d);return w.length>=g.minProperties||h.addError({name:"minProperties",argument:g.minProperties,message:"does not meet minimum property length of "+g.minProperties}),h}},s.maxProperties=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x),w=Object.keys(d);return w.length<=g.maxProperties||h.addError({name:"maxProperties",argument:g.maxProperties,message:"does not meet maximum property length of "+g.maxProperties}),h}},s.items=function(d,g,y,x){var h=this;if(this.types.array(d)&&g.items!==void 0){var w=new t(d,g,y,x);return d.every(function(v,S){if(Array.isArray(g.items))var E=g.items[S]===void 0?g.additionalItems:g.items[S];else var E=g.items;if(E===void 0)return!0;if(E===!1)return w.addError({name:"items",message:"additionalItems not permitted"}),!1;var R=h.validateSchema(v,E,y,x.makeChild(E,S));return R.instance!==w.instance[S]&&(w.instance[S]=R.instance),w.importErrors(R),!0}),w}},s.contains=function(d,g,y,x){var h=this;if(this.types.array(d)&&g.contains!==void 0){if(!e.isSchema(g.contains))throw new Error('Expected "contains" keyword to be a schema');var w=new t(d,g,y,x),v=d.some(function(S,E){var R=h.validateSchema(S,g.contains,y,x.makeChild(g.contains,E));return R.errors.length===0});return v===!1&&w.addError({name:"contains",argument:g.contains,message:"must contain an item matching given schema"}),w}},s.minimum=function(d,g,y,x){if(this.types.number(d)){var h=new t(d,g,y,x);return g.exclusiveMinimum&&g.exclusiveMinimum===!0?d>g.minimum||h.addError({name:"minimum",argument:g.minimum,message:"must be greater than "+g.minimum}):d>=g.minimum||h.addError({name:"minimum",argument:g.minimum,message:"must be greater than or equal to "+g.minimum}),h}},s.maximum=function(d,g,y,x){if(this.types.number(d)){var h=new t(d,g,y,x);return g.exclusiveMaximum&&g.exclusiveMaximum===!0?d<g.maximum||h.addError({name:"maximum",argument:g.maximum,message:"must be less than "+g.maximum}):d<=g.maximum||h.addError({name:"maximum",argument:g.maximum,message:"must be less than or equal to "+g.maximum}),h}},s.exclusiveMinimum=function(d,g,y,x){if(typeof g.exclusiveMinimum!="boolean"&&this.types.number(d)){var h=new t(d,g,y,x),w=d>g.exclusiveMinimum;return w||h.addError({name:"exclusiveMinimum",argument:g.exclusiveMinimum,message:"must be strictly greater than "+g.exclusiveMinimum}),h}},s.exclusiveMaximum=function(d,g,y,x){if(typeof g.exclusiveMaximum!="boolean"&&this.types.number(d)){var h=new t(d,g,y,x),w=d<g.exclusiveMaximum;return w||h.addError({name:"exclusiveMaximum",argument:g.exclusiveMaximum,message:"must be strictly less than "+g.exclusiveMaximum}),h}};var f=function(d,g,y,x,h,w){if(this.types.number(d)){var v=g[h];if(v==0)throw new r(h+" cannot be zero");var S=new t(d,g,y,x),E=e.getDecimalPlaces(d),R=e.getDecimalPlaces(v),T=Math.max(E,R),C=Math.pow(10,T);return Math.round(d*C)%Math.round(v*C)!==0&&S.addError({name:h,argument:v,message:w+JSON.stringify(v)}),S}};s.multipleOf=function(d,g,y,x){return f.call(this,d,g,y,x,"multipleOf","is not a multiple of (divisible by) ")},s.divisibleBy=function(d,g,y,x){return f.call(this,d,g,y,x,"divisibleBy","is not divisible by (multiple of) ")},s.required=function(d,g,y,x){var h=new t(d,g,y,x);return d===void 0&&g.required===!0?h.addError({name:"required",message:"is required"}):this.types.object(d)&&Array.isArray(g.required)&&g.required.forEach(function(w){u(d,w)===void 0&&h.addError({name:"required",argument:w,message:"requires property "+JSON.stringify(w)})}),h},s.pattern=function(d,g,y,x){if(this.types.string(d)){var h=new t(d,g,y,x),w=g.pattern;try{var v=new RegExp(w,"u")}catch{v=new RegExp(w)}return d.match(v)||h.addError({name:"pattern",argument:g.pattern,message:"does not match pattern "+JSON.stringify(g.pattern.toString())}),h}},s.format=function(d,g,y,x){if(d!==void 0){var h=new t(d,g,y,x);return!h.disableFormat&&!e.isFormat(d,g.format,this)&&h.addError({name:"format",argument:g.format,message:"does not conform to the "+JSON.stringify(g.format)+" format"}),h}},s.minLength=function(d,g,y,x){if(this.types.string(d)){var h=new t(d,g,y,x),w=d.match(/[\uDC00-\uDFFF]/g),v=d.length-(w?w.length:0);return v>=g.minLength||h.addError({name:"minLength",argument:g.minLength,message:"does not meet minimum length of "+g.minLength}),h}},s.maxLength=function(d,g,y,x){if(this.types.string(d)){var h=new t(d,g,y,x),w=d.match(/[\uDC00-\uDFFF]/g),v=d.length-(w?w.length:0);return v<=g.maxLength||h.addError({name:"maxLength",argument:g.maxLength,message:"does not meet maximum length of "+g.maxLength}),h}},s.minItems=function(d,g,y,x){if(this.types.array(d)){var h=new t(d,g,y,x);return d.length>=g.minItems||h.addError({name:"minItems",argument:g.minItems,message:"does not meet minimum length of "+g.minItems}),h}},s.maxItems=function(d,g,y,x){if(this.types.array(d)){var h=new t(d,g,y,x);return d.length<=g.maxItems||h.addError({name:"maxItems",argument:g.maxItems,message:"does not meet maximum length of "+g.maxItems}),h}};function p(m,d,g){var y,x=g.length;for(y=d+1,x;y<x;y++)if(e.deepCompareStrict(m,g[y]))return!1;return!0}return s.uniqueItems=function(d,g,y,x){if(g.uniqueItems===!0&&this.types.array(d)){var h=new t(d,g,y,x);return d.every(p)||h.addError({name:"uniqueItems",message:"contains duplicate item"}),h}},s.dependencies=function(d,g,y,x){if(this.types.object(d)){var h=new t(d,g,y,x);for(var w in g.dependencies)if(d[w]!==void 0){var v=g.dependencies[w],S=x.makeChild(v,w);if(typeof v=="string"&&(v=[v]),Array.isArray(v))v.forEach(function(R){d[R]===void 0&&h.addError({name:"dependencies",argument:S.propertyPath,message:"property "+R+" not found, required by "+S.propertyPath})});else{var E=this.validateSchema(d,v,y,S);h.instance!==E.instance&&(h.instance=E.instance),E&&E.errors.length&&(h.addError({name:"dependencies",argument:S.propertyPath,message:"does not meet dependency required by "+S.propertyPath}),h.importErrors(E))}}return h}},s.enum=function(d,g,y,x){if(d===void 0)return null;if(!Array.isArray(g.enum))throw new r("enum expects an array",g);var h=new t(d,g,y,x);return g.enum.some(e.deepCompareStrict.bind(null,d))||h.addError({name:"enum",argument:g.enum,message:"is not one of enum values: "+g.enum.map(String).join(",")}),h},s.const=function(d,g,y,x){if(d===void 0)return null;var h=new t(d,g,y,x);return e.deepCompareStrict(g.const,d)||h.addError({name:"const",argument:g.const,message:"does not exactly match expected constant: "+g.const}),h},s.not=s.disallow=function(d,g,y,x){var h=this;if(d===void 0)return null;var w=new t(d,g,y,x),v=g.not||g.disallow;return v?(Array.isArray(v)||(v=[v]),v.forEach(function(S){if(h.testType(d,g,y,x,S)){var E=S&&(S.$id||S.id),R=E||S;w.addError({name:"not",argument:R,message:"is of prohibited type "+R})}}),w):null},wc=i,wc}var da={},bv;function Qc(){if(bv)return da;bv=1;var e=qn();da.SchemaScanResult=t;function t(r,i){this.id=r,this.ref=i}return da.scan=function(i,s){function a(m,d){if(!d||typeof d!="object")return;if(d.$ref){let h=e.resolveUrl(m,d.$ref);p[h]=p[h]?p[h]+1:0;return}var g=d.$id||d.id;let y=e.resolveUrl(m,g);var x=g?y:m;if(x){if(x.indexOf("#")<0&&(x+="#"),f[x]){if(!e.deepCompareStrict(f[x],d))throw new Error("Schema <"+x+"> already exists with different definition");return f[x]}f[x]=d,x[x.length-1]=="#"&&(f[x.substring(0,x.length-1)]=d)}u(x+"/items",Array.isArray(d.items)?d.items:[d.items]),u(x+"/extends",Array.isArray(d.extends)?d.extends:[d.extends]),a(x+"/additionalItems",d.additionalItems),l(x+"/properties",d.properties),a(x+"/additionalProperties",d.additionalProperties),l(x+"/definitions",d.definitions),l(x+"/patternProperties",d.patternProperties),l(x+"/dependencies",d.dependencies),u(x+"/disallow",d.disallow),u(x+"/allOf",d.allOf),u(x+"/anyOf",d.anyOf),u(x+"/oneOf",d.oneOf),a(x+"/not",d.not)}function u(m,d){if(Array.isArray(d))for(var g=0;g<d.length;g++)a(m+"/"+g,d[g])}function l(m,d){if(!(!d||typeof d!="object"))for(var g in d)a(m+"/"+g,d[g])}var f={},p={};return a(i,s),new t(f,p)},da}var xc,wv;function AN(){if(wv)return xc;wv=1;var e=ON(),t=qn(),r=Qc().scan,i=t.ValidatorResult,s=t.ValidatorResultError,a=t.SchemaError,u=t.SchemaContext,l="/",f=function d(){this.customFormats=Object.create(d.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(m),this.attributes=Object.create(e.validators)};f.prototype.customFormats={},f.prototype.schemas=null,f.prototype.types=null,f.prototype.attributes=null,f.prototype.unresolvedRefs=null,f.prototype.addSchema=function(g,y){var x=this;if(!g)return null;var h=r(y||l,g),w=y||g.$id||g.id;for(var v in h.id)this.schemas[v]=h.id[v];for(var v in h.ref)this.unresolvedRefs.push(v);return this.unresolvedRefs=this.unresolvedRefs.filter(function(S){return typeof x.schemas[S]>"u"}),this.schemas[w]},f.prototype.addSubSchemaArray=function(g,y){if(Array.isArray(y))for(var x=0;x<y.length;x++)this.addSubSchema(g,y[x])},f.prototype.addSubSchemaObject=function(g,y){if(!(!y||typeof y!="object"))for(var x in y)this.addSubSchema(g,y[x])},f.prototype.setSchemas=function(g){this.schemas=g},f.prototype.getSchema=function(g){return this.schemas[g]},f.prototype.validate=function(g,y,x,h){if(typeof y!="boolean"&&typeof y!="object"||y===null)throw new a("Expected `schema` to be an object or boolean");x||(x={});var w=y.$id||y.id;let v=t.resolveUrl(x.base,w||"");if(!h){h=new u(y,x,[],v,Object.create(this.schemas)),h.schemas[v]||(h.schemas[v]=y);var S=r(v,y);for(var E in S.id){var R=S.id[E];h.schemas[E]=R}}if(x.required&&g===void 0){var T=new i(g,y,x,h);return T.addError("is required, but is undefined"),T}var T=this.validateSchema(g,y,x,h);if(T){if(x.throwAll&&T.errors.length)throw new s(T)}else throw new Error("Result undefined");return T};function p(d){var g=typeof d=="string"?d:d.$ref;return typeof g=="string"?g:!1}f.prototype.validateSchema=function(g,y,x,h){var w=new i(g,y,x,h);if(typeof y=="boolean")y===!0?y={}:y===!1&&(y={type:[]});else if(!y)throw new Error("schema is undefined");if(y.extends)if(Array.isArray(y.extends)){var v={schema:y,ctx:h};y.extends.forEach(this.schemaTraverser.bind(this,v)),y=v.schema,v.schema=null,v.ctx=null,v=null}else y=t.deepMerge(y,this.superResolve(y.extends,h));var S=p(y);if(S){var E=this.resolve(y,S,h),R=new u(E.subschema,x,h.path,E.switchSchema,h.schemas);return this.validateSchema(g,E.subschema,x,R)}var T=x&&x.skipAttributes||[];for(var C in y)if(!e.ignoreProperties[C]&&T.indexOf(C)<0){var W=null,N=this.attributes[C];if(N)W=N.call(this,g,y,x,h);else if(x.allowUnknownAttributes===!1)throw new a("Unsupported attribute: "+C,y);W&&w.importErrors(W)}if(typeof x.rewrite=="function"){var F=x.rewrite.call(this,g,y,x,h);w.instance=F}return w},f.prototype.schemaTraverser=function(g,y){g.schema=t.deepMerge(g.schema,this.superResolve(y,g.ctx))},f.prototype.superResolve=function(g,y){var x=p(g);return x?this.resolve(g,x,y).subschema:g},f.prototype.resolve=function(g,y,x){if(y=x.resolve(y),x.schemas[y])return{subschema:x.schemas[y],switchSchema:y};let w=new URL(y,"thismessage::/").hash;var v=w&&w.length&&y.substr(0,y.length-w.length);if(!v||!x.schemas[v])throw new a("no such schema <"+y+">",g);var S=t.objectGetPath(x.schemas[v],w.substr(1));if(S===void 0)throw new a("no such schema "+w+" located in <"+v+">",g);return{subschema:S,switchSchema:y}},f.prototype.testType=function(g,y,x,h,w){if(w!==void 0){if(w===null)throw new a('Unexpected null in "type" keyword');if(typeof this.types[w]=="function")return this.types[w].call(this,g);if(w&&typeof w=="object"){var v=this.validateSchema(g,w,x,h);return v===void 0||!(v&&v.errors.length)}return!0}};var m=f.prototype.types={};return m.string=function(g){return typeof g=="string"},m.number=function(g){return typeof g=="number"&&isFinite(g)},m.integer=function(g){return typeof g=="number"&&g%1===0},m.boolean=function(g){return typeof g=="boolean"},m.array=function(g){return Array.isArray(g)},m.null=function(g){return g===null},m.date=function(g){return g instanceof Date},m.any=function(g){return!0},m.object=function(g){return g&&typeof g=="object"&&!Array.isArray(g)&&!(g instanceof Date)},xc=f,xc}var xv;function RN(){if(xv)return Ar;xv=1;var e=Ar.Validator=AN();return Ar.ValidatorResult=qn().ValidatorResult,Ar.ValidatorResultError=qn().ValidatorResultError,Ar.ValidationError=qn().ValidationError,Ar.SchemaError=qn().SchemaError,Ar.SchemaScanResult=Qc().SchemaScanResult,Ar.scan=Qc().scan,Ar.validate=function(t,r,i){var s=new e;return s.validate(t,r,i)},Ar}var PN=RN();const Go="/$shared",CN={"**/saved_conditions.json":{parser:"json",content:{conditions:[]},schema:{type:"object",properties:{conditions:{type:"array",items:{type:"object"}}},required:["conditions"]}},"**/shared_datasources.json":{parser:"json",content:{},schema:{type:"object",additionalProperties:!0,patternProperties:{"^.*$":{type:"array"}}}},"**/shared_css.json":{parser:"json",content:{classes:[]},schema:{type:"object",properties:{classes:{type:"array",items:{type:"object"}}},required:["classes"]}},"**/shared_app_events.json":{parser:"json",content:[]},"**/CustomComponents/manifest.json":{parser:"json",content:[],schema:{type:"array",items:{type:"object"}}},"**/crafted_components.json":{parser:"json",content:[],schema:{type:"array"}},"**/HTTPHandlers.json":{parser:"json",content:[],schema:{type:"array"}},"**/i18n.json":{parser:"json",content:{keys:{},userLang:{primary:"",supported:[]}},schema:{type:"object",properties:{keys:{type:"object"},userLang:{type:"object",properties:{primary:{type:"string"},supported:{type:"array",items:{type:"string"}}},required:["primary","supported"]}},required:["keys","userLang"]}},"**/*.json":{parser:"json",content:{}}};function Bb(e){const t=Object.entries(CN).find(([r])=>xt(e,r));return t==null?void 0:t[1]}function uu(e){var i;const t=(i=Bb(e))==null?void 0:i.content;if(!t)return;const r=e.replace(`${Go}/`,"Shared/");ad({name:r,content:t,asText:typeof t=="string"})}async function kN(){const e=["CustomComponents/manifest.json","shared_app_events.json","shared_css.json","saved_conditions.json","i18n.json"];for(const t of e)try{await We(`${Go}/${t}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch(r){Wb(r)&&uu(`${Go}/${t}`)}}function es({path:e,createIfNotExists:t=!1}){const r=`${Go}/${e}`;return We(`${r}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(i=>{const s=Bb(e);let a=i;if(!s)return a;if(typeof a=="string")try{switch(s.parser){case"json":a=JSON.parse(a);break;default:break}}catch{throw new Error("Cannot parse")}if(s.schema&&!new PN.Validator().validate(a,s.schema).valid)throw new Error("Invalid Schema");return a}).catch(i=>{if(Wb(i)&&t){const s=IN(i,e);Wf.next({message:s,kind:"warning"}),uu(r)}throw i})}function Wb(e){var t;return((t=e==null?void 0:e.response)==null?void 0:t.status)===404||(e==null?void 0:e.message)==="Invalid Schema"||(e==null?void 0:e.message)==="Cannot parse"||(e==null?void 0:e.name)==="SyntaxError"}function IN(e,t){var r;switch(!0){case((e==null?void 0:e.message)==="Cannot parse "||(e==null?void 0:e.name)==="SyntaxError"):return`Cannot parse file '${t}', resetting...`;case(e==null?void 0:e.message)==="Invalid Schema":return`File '${t}' is corrupt, resetting...`;case((r=e==null?void 0:e.response)==null?void 0:r.status)===404:return`File '${t}' not found, creating...`;default:return e==null?void 0:e.message}}function $N(e){return We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function LN(e){return We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const Hb=()=>{const{host:e,protocol:t}=window.location,r=t==="https:";return{projectOpened:!1,remoteDebuggerMode:Vf.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${r?"s":""}://${e}/remoteDebugger`,lsp:`ws${r?"s":""}://${e}/LSP`},isRestActive:!0}};async function MN(){const{hostname:e,host:t,protocol:r}=window.location,i=r==="https:";try{const s=await We(lt,{method:"POST",body:JSON.stringify({verb:Cn.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),a=(()=>{if(s.rendererPath)return s.rendererPath;const u=`http://${e}:${s.webServerHTTPPort}`,l=`https://${e}:${s.webServerHTTPSPort}`;return s.webServerHTTPPort&&s.webServerHTTPSPort?i?l:u:s.webServerHTTPPort?u:l})();return{projectOpened:s.webServerHTTPSPort>0||s.webServerHTTPPort>0,remoteDebuggerMode:s.remoteDebuggerMode,baseUrl:a,qodly:typeof s.qodly>"u"?!0:s.qodly,urls:{renderer:s.rendererPath||`${a}/$lib/renderer/`,debugger:`ws${i?"s":""}://${t}/remoteDebugger`,lsp:`ws${i?"s":""}://${t}/LSP`},isRestActive:s.isRESTActive}}catch(s){return console.error(s),Hb()}}async function Ub(e){return await We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function DN(...e){return(await Promise.all(e.map(i=>Ub({root:i,verb:Cn.GET_FOLDER})))).map(({children:i})=>i.map(({name:s,date:a,type:u})=>({name:s,type:u,date:a,path:`${u}/${s}`}))).flat()}function NN(e,t={}){const{sanitize:r=!0}=t;return We(`/rest/$getWebForm/${e}`,{method:"GET"}).then(i=>{if(!(i!=null&&i.components)||!r)return i;const s=new Map;return{...i,components:Ie.entries(i.components).map(([a,u])=>{const l=a,{resolvedName:f}=u.type;if(f==="WebformLoader"){const p=On.generate();s.set(a,p),a=p}return[a,u,l]}).reduce((a,[u,l,f])=>{var p;return l.nodes&&(l.nodes=l.nodes.map(m=>s.get(m)||m)),l.linkedNodes&&(l.linkedNodes=Ie.entries(l.linkedNodes).reduce((m,[d,g])=>({...m,[d]:s.get(g)||g}),{})),(p=l.props)!=null&&p.events&&(l.props.events=l.props.events.map(m=>(m.type==="navigation"&&m.loader&&(m.loader=s.get(m.loader)||m.loader),m))),{...a,[u]:{...l,props:{...l.props,__originalID:f}}}},{})}})}function FN(e){return We(lt,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(t=>({...t,content:[ke.METHOD,ke.CLASS].includes(t.type)?iu(t.content):t.content}))}function jN(e){return e.type==="folder"?We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function zN(e){return e.type==="folder"?(await We(Qo,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function BN(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function WN(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function HN(e){return(await We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function UN(...e){return await We(lt,{method:"POST",body:JSON.stringify({verb:Cn.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function qN(e){const t=await We("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return t.isLogged&&t.success}async function GN(){return await We("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function ZN(e){try{const t=process.env.NODE_ENV==="development"?"/i18n/languages.json":`/$lib/${e?"studio":"renderer"}/i18n/languages.json`,i=await(await fetch(t)).text(),{supported:s}=JSON.parse(i);return s}catch{return[]}}async function VN({name:e,path:t="",root:r="root",asText:i=!1}){return We(lt,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:r,path:t,name:e,asText:i}),headers:new Headers({"Content-Type":"application/json"})})}async function KN(e={}){try{return{...await es({path:"shared_datasources.json",...e}),...ja}}catch{return{...ja}}}async function YN(e={}){try{return await es({path:"shared_app_events.json",...e})}catch{return[]}}async function XN(e={}){try{return await es({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function JN(e={}){try{return await es({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function QN(){try{return await We("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function eF(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const tF=ed(),rF=async e=>{const t={verb:Cn.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:Ie.omit(e,Ie.keys(ja))};return tF(()=>We(lt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}))},nF=ed(),iF=async e=>{const t={verb:Cn.SET_FILE_CONTENT,asText:!1,name:"shared_app_events.json",path:"",root:"shared",content:e};return nF(()=>We(lt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}))},ad=async e=>{const t=await We(lt,{method:"POST",body:JSON.stringify({...e,verb:Cn.SET_FILE_CONTENT,root:Zf.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),r=Qf(`${e.path||"Sources"}/${e.name}`);return{...t,type:r,size:0}},oF=async e=>await ad({name:"crafted_components.json",path:wr.WEBFORMS,content:e});function sF(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function aF(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function uF(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function lF(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}).then(t=>Array.isArray(t)?t:{...t,content:["4dm","4qm","4qs"].includes(t.ext)?iu(t.content):t.content}).catch(t=>{var r,i;throw((i=(r=t.data)==null?void 0:r.__ERROR[0])==null?void 0:i.errCode)===1839&&uu(e.path),t})}function cF(e){return We(lt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function fF(e){const t=new RegExp(/^\((.+)(?=\))/gi).exec(e);return t!==null?t[1]:""}function dF(e){const t=new RegExp(/(->)(.*)/gi).exec(e);if(t!==null)return t[0].replace("->","");const r=/:([^)]*)$/.exec(e);return r!==null?`result : ${r[1].trim()}`:""}function pF(e){const t=fF(e).split(/[;,]/g).filter(Boolean).map(s=>{const a=s.split(":")[0].trim(),u=s.split(":")[1].trim();return{name:a,type:u}}),r=dF(e),i=r?{name:r.split(":")[0].trim(),type:r.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:t,result:i}}async function hF(e,t){const i=e.split(".").pop();try{const s=await We(lt,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:t,functionName:i}),headers:new Headers({"Content-Type":"application/json"})});s.content=iu(s.content);const{params:a,result:u}=pF(s.parameters);return{...s,params:a,returns:u}}catch(s){return console.error(s),{className:t,functionName:i,filePath:e,content:"",params:[]}}}var qb=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))(qb||{});function gF(e,t){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...t}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(r=>{})}function mF(e){window.pagesense=window.pagesense||[],window.pagesense.push(["trackEvent",e])}const vF={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},yF={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}},Gb=M.createContext(void 0),bF=M.memo(({children:e,isInsideStudio:t,isStandaloneEditor:r})=>{const i=M.useMemo(()=>({isInsideStudio:t,isStandaloneEditor:r}),[t,r]);return I.jsx(Gb.Provider,{value:i,children:e})});function wF(){const e=M.useContext(Gb);return e===void 0?{isInsideStudio:!1,isStandaloneEditor:!1}:e}const Zb=M.createContext(null),xF=5e3,SF={top:"top-4",bottom:"bottom-4"};function EF({children:e}){const[t,r]=M.useState([]),i=M.useRef(0),s=M.useCallback(l=>{r(f=>f.filter(p=>p.id!==l))},[]),a=M.useCallback((l,f)=>{const p=++i.current,m={id:p,containerStyle:f==null?void 0:f.containerStyle,duration:l.duration??xF,position:l.position??"bottom",render:l.render};return r(d=>[...d,m]),p},[]);M.useEffect(()=>{const l=Wf.subscribe(f=>{a({position:"bottom",render:({onClose:p})=>I.jsx(Gv,{...f,onClose:p})})});return()=>{l.unsubscribe()}},[a]);const u=M.useMemo(()=>({pushToast:a,removeToast:s}),[a,s]);return I.jsxs(Zb.Provider,{value:u,children:[e,typeof document<"u"?Qn.createPortal(I.jsx(I.Fragment,{children:["top","bottom"].map(l=>{const f=t.filter(p=>p.position===l);return f.length===0?null:I.jsx("div",{className:`pointer-events-none fixed inset-x-4 z-[2147483647] flex flex-col items-center gap-3 ${SF[l]}`,children:f.map(p=>I.jsx(_F,{toast:p,onClose:()=>s(p.id)},p.id))},l)})}),document.body):null]})}function _F({toast:e,onClose:t}){return M.useEffect(()=>{if(e.duration===null)return;const r=window.setTimeout(t,e.duration);return()=>window.clearTimeout(r)},[t,e.duration]),I.jsx("div",{className:"pointer-events-auto",style:e.containerStyle,children:e.render({onClose:t})})}function TF(e){const t=M.useContext(Zb);if(!t)throw new Error("useToast must be used within a ToastProvider");return M.useCallback(r=>t.pushToast(r,e),[t,e])}exports.API_PREFIX=lt;exports.AppLoader=i$;exports.BaseCheckboxIcon=m0;exports.Checkbox=P$;exports.ControlledSwitch=Vy;exports.DATASOURCE_THEMES=vF;exports.DatasourcesActions=L0;exports.DebuggerActions=N0;exports.DefaultCheckboxIcon=v0;exports.DesignerRequestVerb=Cn;exports.Dialog=jA;exports.DialogBody=Dv;exports.EActivity=qb;exports.ECustomStylePropsViewMode=Ib;exports.EDITOR=yF;exports.EDisplayMode=od;exports.EIDENTIFIERS=Lb;exports.EPermissionType=ze;exports.ERROR_CODES=Mb;exports.ESetting=Cb;exports.ESubPermissionType=Ke;exports.ETooltipBehavior=kb;exports.EWebFormStyleClassScope=Pb;exports.EXT_API_PREFIX=Qo;exports.FileFolderType=ke;exports.FloatingTooltip=T$;exports.FolderRootPath=wr;exports.FolderRootType=Zf;exports.Grid=$$;exports.GridItem=L$;exports.HTTPError=Jc;exports.HTTP_HANDLERS_TAB_PATH=Xf;exports.IPreemptive=qo;exports.IPublished=vb;exports.IPublishedRestScope=rd;exports.IdentityProvider=eL;exports.Image=y0;exports.Incase=va;exports.IndentLines=Xv;exports.InvalidJsonError=I$;exports.LOCALIZATION_TAB_PATH=Jf;exports.LOCATION_DATASOURCE_ID=hb;exports.LogoSVG=l0;exports.LspActions=D0;exports.MAX_FILE_NAME_LENGTH=Hf;exports.MODEL_TAB_PATH=rb;exports.Modal=u$;exports.ModalCloseReason=Ei;exports.ModalColor=Vn;exports.ModalIcons=Fc;exports.ModalType=$f;exports.Mutex=ob;exports.NameError=Uf;exports.Overlay=Mv;exports.PANEL_COLLAPSED_HEIGHT=Pr;exports.PANEL_INITIAL_OPEN_RATIO=p0;exports.PANEL_MAX_RATIO=h0;exports.PERMISSIONS=nd;exports.Panel=R$;exports.PopperTooltip=u0;exports.Portal=_v;exports.PublishOptions=MD;exports.QODLY_NAMESPACE=ko;exports.ROLES_TAB_PATH=Kf;exports.ROOT_WEBFORM_STATE=Db;exports.RemoteDebuggerMode=Vf;exports.SETTINGS_TAB_PATH=Yf;exports.SHARED_API_PREFIX=Go;exports.SHARED_USER_NAMESPACE=ja;exports.SearchInput=k$;exports.SimpleGrid=M$;exports.SourceCodeDescriptor=$b;exports.StudioContextProvider=bF;exports.Switcher=Jv;exports.THEME_CLASSES=lN;exports.TITLE_DATASOURCE_ID=mb;exports.TabEventsActions=M0;exports.Tip=Dy;exports.TipsProvider=fk;exports.Toast=Gv;exports.ToastProvider=EF;exports.ToolbarIcon=C$;exports.Tooltip=r$;exports.Tree=lP;exports.TreeIcon=Zv;exports.TreeNode=ff;exports.USER_LANGUAGE_DATASOURCE_ID=gb;exports.WT_FLAGS_KEYS=uN;exports.WebformActions=$0;exports.WebformEventsActions=Uo;exports.ZoomComponent=f$;exports.ZoomLevel=f0;exports._isArrayDatasource=PD;exports._isObjectDatasource=CD;exports.actionsToPrivs=Eb;exports.addAttributesToContent=ND;exports.addFolder=BN;exports.addItem=xN;exports.addPermission=XD;exports.addPrivilegeIn=HD;exports.allowed=BD;exports.by=sb;exports.byId=fD;exports.byPath=dD;exports.callAll=zb;exports.callAllHandlers=gN;exports.callServerSideParser=TN;exports.checkUpdates=$N;exports.children=Ba;exports.createFolder=sF;exports.createPrivilege=qD;exports.createRole=nN;exports.dataAttr=mN;exports.datasourcesSubject=zL;exports.debuggerSubject=UL;exports.deepDeleteCondition=Fb;exports.deepSanitizeCondition=jb;exports.dropFile=zN;exports.dropFolder=HN;exports.editors=nb;exports.exists=pD;exports.extractWebformName=sD;exports.filterBySeriousError=Rb;exports.focus=vN;exports.formatErrorsAsBulletToast=aN;exports.generateUUID=Xc;exports.getAppSettings=MN;exports.getCashedPrefrences=hD;exports.getCatalog=GN;exports.getDatasourceId=gD;exports.getDefaultAppSettings=Hb;exports.getDefaultContent=dN;exports.getDictByName=Tb;exports.getDisplayableFeedbackErrors=sN;exports.getEditors=oD;exports.getErrorListFromPayload=Ab;exports.getFile=FN;exports.getFileContent=VN;exports.getFileExtentionFromType=ib;exports.getFilePath=hN;exports.getFilenameAndTypeFromPath=iD;exports.getFilenameFromType=aD;exports.getFilesInfo=UN;exports.getFolder=Ub;exports.getFolders=DN;exports.getFunctionContent=hF;exports.getGraphData=YD;exports.getInheritedResources=Ob;exports.getMonacoTheme=eF;exports.getNodeInfo=lF;exports.getNormalizedDataType=vD;exports.getPrivilegeById=rn;exports.getPromotions=rN;exports.getResourceFromType=id;exports.getSavedConditions=JN;exports.getSharedAppEvents=YN;exports.getSharedCSS=XN;exports.getSharedDatasources=KN;exports.getSharedResource=es;exports.getSupportedLanguages=ZN;exports.getTypeFromExtension=Qf;exports.getUserPrivileges=QN;exports.getWebForm=NN;exports.hasAttributesString=bb;exports.http=We;exports.i18nSubject=GL;exports.initializeDefaultProjectFiles=kN;exports.installUpdates=LN;exports.isArrayDatasource=fb;exports.isBaseState=cN;exports.isDataClassMethod=xD;exports.isDataStoreMethod=wD;exports.isDateDatasource=kD;exports.isEntity=AD;exports.isEntityDatasource=_D;exports.isEntityMethod=SD;exports.isEntitySelection=RD;exports.isEntitySelectionDatasource=TD;exports.isEntitySelectionMethod=ED;exports.isInputEvent=SN;exports.isObjectAttribute=yD;exports.isObjectDatasource=db;exports.isRelatedAttribute=bD;exports.isRelatedEntitiesAttribute=lb;exports.isRelatedEntityAttribute=cb;exports.isSameNamespace=ID;exports.isScalarDatasource=pb;exports.isSimpleAttribute=ub;exports.isSimpleDatasource=OD;exports.loadDS=$D;exports.loadI18n=LD;exports.localeCompare=ab;exports.log=gF;exports.login=qN;exports.lspSubject=HL;exports.mergeRefs=yN;exports.moveItem=uF;exports.outBy=lD;exports.outById=cD;exports.parents=au;exports.parseAttributes=DD;exports.parseCatalog=FD;exports.populateShallow=ZD;exports.queue=ed;exports.refactorConditions=sd;exports.refactorWebform=fN;exports.removeAttributesString=wb;exports.removeItem=aF;exports.removeMultiplePermissions=QD;exports.removePermission=JD;exports.removePrivilege=WD;exports.removePrivilegeFrom=UD;exports.removeRole=iN;exports.renameFile=jN;exports.renameFolder=WN;exports.renamePrivilege=GD;exports.resetResources=eN;exports.rolesToAPI=KD;exports.sanitizeContent=iu;exports.sanitizeNameCY=jD;exports.sanitizePermissions=_b;exports.sanitizePrivileges=xb;exports.sanitizeRoles=VD;exports.saveContent=cF;exports.saveRole=oN;exports.selectorEqualityFn=pN;exports.setCraftedComponents=oF;exports.setFileContent=ad;exports.setSharedAppEvents=iF;exports.setSharedSources=rF;exports.sortPrivileges=Sb;exports.splitDatasourceID=td;exports.stopEvent=EN;exports.stringifyAttributes=yb;exports.tabEventsSubject=WL;exports.tasksManagerSubject=qL;exports.toastSubject=Wf;exports.togglePermission=tN;exports.trackEvent=mF;exports.transformDates=_N;exports.tryCreateSharedResource=uu;exports.uniquePush=lr;exports.updateDsCondition=Nb;exports.useBoolean=SL;exports.useCallbackRef=EL;exports.useControllableProp=R0;exports.useControllableState=_L;exports.useDidMountEffect=D$;exports.useDoubleClick=iL;exports.useDsChangeRenderer=xL;exports.useDsRendererAdapter=wL;exports.useEnhancedState=bL;exports.useFeatureFlags=Q$;exports.useFormControlProps=AL;exports.useForwardedRef=J$;exports.useHotkeys=V$;exports.useIdentity=tL;exports.useOutsideClick=K$;exports.usePrevious=Y$;exports.useSafeLayoutEffect=TL;exports.useStateObject=rL;exports.useStateRef=X$;exports.useStudioContext=wF;exports.useTip=My;exports.useToast=TF;exports.useUpdateEffect=OL;exports.validateName=nu;exports.validateServerSide=ZL;exports.validateValue=VL;exports.visuallyHiddenStyle=wN;exports.warn=bN;exports.webformEventsSubject=Na;exports.webformSubject=BL;
|
|
207
207
|
//# sourceMappingURL=index.cjs.js.map
|