@ws-ui/store 0.0.5 → 0.0.6
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/README.md +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +4 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +55 -55
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Qodly store
|
|
2
|
-
|
|
3
|
-
coming soon...
|
|
1
|
+
# Qodly store
|
|
2
|
+
|
|
3
|
+
coming soon...
|
package/dist/index.cjs.js
CHANGED
|
@@ -266,7 +266,7 @@ globstar while`,n,b,r,E,O),this.matchOne(n.slice(b),r.slice(E),a))return this.de
|
|
|
266
266
|
>>> no match, partial?`,n,b,r,E),b===f))}var R;if(typeof h=="string"?(R=m===h,this.debug("string match",h,m,R)):(R=m.match(h),this.debug("pattern match",h,m,R)),!R)return!1}if(u===f&&c===p)return!0;if(u===f)return a;if(c===p)return u===f-1&&n[u]==="";throw new Error("wtf?")}braceExpand(){return ux(this.pattern,this.options)}parse(n,r){md(n);const a=this.options;if(n==="**")if(a.noglobstar)n="*";else return go;if(n==="")return"";let i="",u=!1,c=!1;const f=[],p=[];let h,m=!1,b=-1,E=-1,O,R,C,k=n.charAt(0)===".",j=a.dot||k;const F=()=>k?"":j?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",D=U=>U.charAt(0)==="."?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",M=()=>{if(h){switch(h){case"*":i+=a1,u=!0;break;case"?":i+=Z1,u=!0;break;default:i+="\\"+h;break}this.debug("clearStateChar %j %j",h,i),h=!1}};for(let U=0,V;U<n.length&&(V=n.charAt(U));U++){if(this.debug("%s %s %s %j",n,U,i,V),c){if(V==="/")return!1;TS[V]&&(i+="\\"),i+=V,c=!1;continue}switch(V){case"/":return!1;case"\\":if(m&&n.charAt(U+1)==="-"){i+=V;continue}M(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",n,U,i,V),m){this.debug(" in class"),V==="!"&&U===E+1&&(V="^"),i+=V;continue}this.debug("call clearStateChar %j",h),M(),h=V,a.noext&&M();continue;case"(":{if(m){i+="(";continue}if(!h){i+="\\(";continue}const Ee={type:h,start:U-1,reStart:i.length,open:OS[h].open,close:OS[h].close};this.debug(this.pattern," ",Ee),f.push(Ee),i+=Ee.open,Ee.start===0&&Ee.type!=="!"&&(k=!0,i+=D(n.slice(U+1))),this.debug("plType %j %j",h,i),h=!1;continue}case")":{const Ee=f[f.length-1];if(m||!Ee){i+="\\)";continue}f.pop(),M(),u=!0,R=Ee,i+=R.close,R.type==="!"&&p.push(Object.assign(R,{reEnd:i.length}));continue}case"|":{const Ee=f[f.length-1];if(m||!Ee){i+="\\|";continue}M(),i+="|",Ee.start===0&&Ee.type!=="!"&&(k=!0,i+=D(n.slice(U+1)));continue}case"[":if(M(),m){i+="\\"+V;continue}m=!0,E=U,b=i.length,i+=V;continue;case"]":if(U===E+1||!m){i+="\\"+V;continue}O=n.substring(E+1,U);try{RegExp("["+RL(xL(O))+"]"),i+=V}catch{i=i.substring(0,b)+"(?:$.)"}u=!0,m=!1;continue;default:M(),TS[V]&&!(V==="^"&&m)&&(i+="\\"),i+=V;break}}for(m&&(O=n.slice(E+1),C=this.parse(O,i1),i=i.substring(0,b)+"\\["+C[0],u=u||C[1]),R=f.pop();R;R=f.pop()){let U;U=i.slice(R.reStart+R.open.length),this.debug("setting tail",i,R),U=U.replace(/((?:\\{2}){0,64})(\\?)\|/g,(Ee,He,Be)=>(Be||(Be="\\"),He+He+Be+"|")),this.debug(`tail=%j
|
|
267
267
|
%s`,U,U,R,i);const V=R.type==="*"?a1:R.type==="?"?Z1:"\\"+R.type;u=!0,i=i.slice(0,R.reStart)+V+"\\("+U}M(),c&&(i+="\\\\");const S=SL[i.charAt(0)];for(let U=p.length-1;U>-1;U--){const V=p[U],Ee=i.slice(0,V.reStart),He=i.slice(V.reStart,V.reEnd-8);let Be=i.slice(V.reEnd);const St=i.slice(V.reEnd-8,V.reEnd)+Be,me=Ee.split(")").length,Me=Ee.split("(").length-me;let at=Be;for(let Le=0;Le<Me;Le++)at=at.replace(/\)[+*?]?/,"");Be=at;const Xe=Be===""&&r!==i1?"(?:$|\\/)":"";i=Ee+He+Be+Xe+St}if(i!==""&&u&&(i="(?=.)"+i),S&&(i=F()+i),r===i1)return[i,u];if(a.nocase&&!u&&(u=n.toUpperCase()!==n.toLowerCase()),!u)return TL(n);const q=a.nocase?"i":"";try{return Object.assign(new RegExp("^"+i+"$",q),{_glob:n,_src:i})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const n=this.set;if(!n.length)return this.regexp=!1,this.regexp;const r=this.options,a=r.noglobstar?a1:r.dot?wL:EL,i=r.nocase?"i":"";let u=n.map(c=>(c=c.map(f=>typeof f=="string"?CL(f):f===go?go:f._src).reduce((f,p)=>(f[f.length-1]===go&&p===go||f.push(p),f),[]),c.forEach((f,p)=>{f!==go||c[p-1]===go||(p===0?c.length>1?c[p+1]="(?:\\/|"+a+"\\/)?"+c[p+1]:c[p]=a:p===c.length-1?c[p-1]+="(?:\\/|"+a+")?":(c[p-1]+="(?:\\/|\\/"+a+"\\/)"+c[p+1],c[p+1]=go))}),c.filter(f=>f!==go).join("/"))).join("|");u="^(?:"+u+")$",this.negate&&(u="^(?!"+u+").*$");try{this.regexp=new RegExp(u,i)}catch{this.regexp=!1}return this.regexp}match(n,r=this.partial){if(this.debug("match",n,this.pattern),this.comment)return!1;if(this.empty)return n==="";if(n==="/"&&r)return!0;const a=this.options;J1.sep!=="/"&&(n=n.split(J1.sep).join("/")),n=n.split(xS),this.debug(this.pattern,"split",n);const i=this.set;this.debug(this.pattern,"set",i);let u;for(let c=n.length-1;c>=0&&(u=n[c],!u);c--);for(let c=0;c<i.length;c++){const f=i[c];let p=n;if(a.matchBase&&f.length===1&&(p=[u]),this.matchOne(p,f,r))return a.flipNegate?!0:!this.negate}return a.flipNegate?!1:this.negate}static defaults(n){return Un.defaults(n).Minimatch}}Un.Minimatch=Jd;const cx=Rd(ix),lx=[{pattern:Ur,editor:{key:"editors:roles"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:B_,editor:{key:"editors:model"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},{pattern:"**/*.webform",editor:{key:"editors:webforms"},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"}}],fx=[{pattern:"**/*.+(json|4DModel|WebForm)",type:"json"},{pattern:"**/*.+(4dm|txt|json|4qs)",type:"text"}];function dx(e){const n=e.split("/");return n.pop(),n.join("/")}function bo(e){const n=lx.find(({pattern:r})=>cx(e,r,{nocase:!0}));return n||{pattern:"",editor:{key:"editors:unknown",config:{language:"text"}}}}function px(e){const n=fx.find(({pattern:r})=>cx(e,r,{nocase:!0}));return n?n.type:"text"}var Q1=function(e,n){return Q1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(r[i]=a[i])},Q1(e,n)};function Zd(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Q1(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}function e_(e){var n=typeof Symbol=="function"&&Symbol.iterator,r=n&&e[n],a=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function yd(e,n){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),i,u=[],c;try{for(;(n===void 0||n-- >0)&&!(i=a.next()).done;)u.push(i.value)}catch(f){c={error:f}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(c)throw c.error}}return u}function bd(e,n,r){if(r||arguments.length===2)for(var a=0,i=n.length,u;a<i;a++)(u||!(a in n))&&(u||(u=Array.prototype.slice.call(n,0,a)),u[a]=n[a]);return e.concat(u||Array.prototype.slice.call(n))}function ja(e){return typeof e=="function"}function hx(e){var n=function(a){Error.call(a),a.stack=new Error().stack},r=e(n);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var s1=hx(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
268
268
|
`+r.map(function(a,i){return i+1+") "+a.toString()}).join(`
|
|
269
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function t_(e,n){if(e){var r=e.indexOf(n);0<=r&&e.splice(r,1)}}var Qd=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,r,a,i,u;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var f=e_(c),p=f.next();!p.done;p=f.next()){var h=p.value;h.remove(this)}}catch(C){n={error:C}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}else c.remove(this);var m=this.initialTeardown;if(ja(m))try{m()}catch(C){u=C instanceof s1?C.errors:[C]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var E=e_(b),O=E.next();!O.done;O=E.next()){var R=O.value;try{CS(R)}catch(C){u=u??[],C instanceof s1?u=bd(bd([],yd(u)),yd(C.errors)):u.push(C)}}}catch(C){a={error:C}}finally{try{O&&!O.done&&(i=E.return)&&i.call(E)}finally{if(a)throw a.error}}}if(u)throw new s1(u)}},e.prototype.add=function(n){var r;if(n&&n!==this)if(this.closed)CS(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(n)}},e.prototype._hasParent=function(n){var r=this._parentage;return r===n||Array.isArray(r)&&r.includes(n)},e.prototype._addParent=function(n){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(n),r):r?[r,n]:n},e.prototype._removeParent=function(n){var r=this._parentage;r===n?this._parentage=null:Array.isArray(r)&&t_(r,n)},e.prototype.remove=function(n){var r=this._finalizers;r&&t_(r,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}(),vx=Qd.EMPTY;function gx(e){return e instanceof Qd||e&&"closed"in e&&ja(e.remove)&&ja(e.add)&&ja(e.unsubscribe)}function CS(e){ja(e)?e():e.unsubscribe()}var mx={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},r_={setTimeout:function(e,n){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];var i=r_.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,bd([e,n],yd(r))):setTimeout.apply(void 0,bd([e,n],yd(r)))},clearTimeout:function(e){var n=r_.delegate;return((n==null?void 0:n.clearTimeout)||clearTimeout)(e)},delegate:void 0};function AL(e){r_.setTimeout(function(){throw e})}function RS(){}function Gf(e){e()}var yx=function(e){Zd(n,e);function n(r){var a=e.call(this)||this;return a.isStopped=!1,r?(a.destination=r,gx(r)&&r.add(a)):a.destination=ML,a}return n.create=function(r,a,i){return new n_(r,a,i)},n.prototype.next=function(r){this.isStopped||this._next(r)},n.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(r){this.destination.next(r)},n.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(Qd),PL=Function.prototype.bind;function u1(e,n){return PL.call(e,n)}var DL=function(){function e(n){this.partialObserver=n}return e.prototype.next=function(n){var r=this.partialObserver;if(r.next)try{r.next(n)}catch(a){Df(a)}},e.prototype.error=function(n){var r=this.partialObserver;if(r.error)try{r.error(n)}catch(a){Df(a)}else Df(n)},e.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(r){Df(r)}},e}(),n_=function(e){Zd(n,e);function n(r,a,i){var u=e.call(this)||this,c;if(ja(r)||!r)c={next:r??void 0,error:a??void 0,complete:i??void 0};else{var f;u&&mx.useDeprecatedNextContext?(f=Object.create(r),f.unsubscribe=function(){return u.unsubscribe()},c={next:r.next&&u1(r.next,f),error:r.error&&u1(r.error,f),complete:r.complete&&u1(r.complete,f)}):c=r}return u.destination=new DL(c),u}return n}(yx);function Df(e){AL(e)}function IL(e){throw e}var ML={closed:!0,next:RS,error:IL,complete:RS},kL=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $L(e){return e}function NL(e){return e.length===0?$L:e.length===1?e[0]:function(r){return e.reduce(function(a,i){return i(a)},r)}}var AS=function(){function e(n){n&&(this._subscribe=n)}return e.prototype.lift=function(n){var r=new e;return r.source=this,r.operator=n,r},e.prototype.subscribe=function(n,r,a){var i=this,u=LL(n)?n:new n_(n,r,a);return Gf(function(){var c=i,f=c.operator,p=c.source;u.add(f?f.call(u,p):p?i._subscribe(u):i._trySubscribe(u))}),u},e.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(r){n.error(r)}},e.prototype.forEach=function(n,r){var a=this;return r=PS(r),new r(function(i,u){var c=new n_({next:function(f){try{n(f)}catch(p){u(p),c.unsubscribe()}},error:u,complete:i});a.subscribe(c)})},e.prototype._subscribe=function(n){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(n)},e.prototype[kL]=function(){return this},e.prototype.pipe=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return NL(n)(this)},e.prototype.toPromise=function(n){var r=this;return n=PS(n),new n(function(a,i){var u;r.subscribe(function(c){return u=c},function(c){return i(c)},function(){return a(u)})})},e.create=function(n){return new e(n)},e}();function PS(e){var n;return(n=e??mx.Promise)!==null&&n!==void 0?n:Promise}function jL(e){return e&&ja(e.next)&&ja(e.error)&&ja(e.complete)}function LL(e){return e&&e instanceof yx||jL(e)&&gx(e)}var FL=hx(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),bx=function(e){Zd(n,e);function n(){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 n.prototype.lift=function(r){var a=new DS(this,this);return a.operator=r,a},n.prototype._throwIfClosed=function(){if(this.closed)throw new FL},n.prototype.next=function(r){var a=this;Gf(function(){var i,u;if(a._throwIfClosed(),!a.isStopped){a.currentObservers||(a.currentObservers=Array.from(a.observers));try{for(var c=e_(a.currentObservers),f=c.next();!f.done;f=c.next()){var p=f.value;p.next(r)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(i)throw i.error}}}})},n.prototype.error=function(r){var a=this;Gf(function(){if(a._throwIfClosed(),!a.isStopped){a.hasError=a.isStopped=!0,a.thrownError=r;for(var i=a.observers;i.length;)i.shift().error(r)}})},n.prototype.complete=function(){var r=this;Gf(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var a=r.observers;a.length;)a.shift().complete()}})},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},n.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},n.prototype._innerSubscribe=function(r){var a=this,i=this,u=i.hasError,c=i.isStopped,f=i.observers;return u||c?vx:(this.currentObservers=null,f.push(r),new Qd(function(){a.currentObservers=null,t_(f,r)}))},n.prototype._checkFinalizedStatuses=function(r){var a=this,i=a.hasError,u=a.thrownError,c=a.isStopped;i?r.error(u):c&&r.complete()},n.prototype.asObservable=function(){var r=new AS;return r.source=this,r},n.create=function(r,a){return new DS(r,a)},n}(AS),DS=function(e){Zd(n,e);function n(r,a){var i=e.call(this)||this;return i.destination=r,i.source=a,i}return n.prototype.next=function(r){var a,i;(i=(a=this.destination)===null||a===void 0?void 0:a.next)===null||i===void 0||i.call(a,r)},n.prototype.error=function(r){var a,i;(i=(a=this.destination)===null||a===void 0?void 0:a.error)===null||i===void 0||i.call(a,r)},n.prototype.complete=function(){var r,a;(a=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||a===void 0||a.call(r)},n.prototype._subscribe=function(r){var a,i;return(i=(a=this.source)===null||a===void 0?void 0:a.subscribe(r))!==null&&i!==void 0?i:vx},n}(bx);const _x=new bx,WL=()=>JT(),Ua=sL,J_=pe(e=>e,e=>e.catalog.state==="loaded"?e.catalog.model:null),BL=pe(J_,e=>e?e.dataClasses:[]),UL=pe(J_,e=>e?e.methods:[]),wx=e=>pe(n=>n,n=>{switch(n.catalog.state){case"loaded":const r=e?n.catalog.model.dataClasses[e]:n.catalog.model;return(r==null?void 0:r.methods)||[];default:return[]}}),zL=e=>Ua(wx(e),YT),HL=(e,n)=>pe(wx(e),r=>r.find(a=>`${a.applyTo}.${a.name}`===n)),GL=(e,n,r)=>Ua(HL(e,`${r}.${n}`),YT),Ex=pe(e=>e,e=>e),qL=e=>pe(za,n=>{var i;const r=n.tabs.find(({path:u})=>u===e),a=r==null?void 0:r.content.components;return!r||!a?[]:(i=Object.keys(a))==null?void 0:i.map(u=>({id:u,...a[u]}))}),Sx=e=>pe(za,n=>{var a,i;const r=n.tabs.find(({path:u})=>u===e);return((i=(a=r==null?void 0:r.content)==null?void 0:a.metadata)==null?void 0:i.datasources)||[]}),VL=(e,n,r)=>pe(Ex,a=>{var i,u;if(n){const c=a.sharedDatasources.sources[n];return c?c.find(f=>f.id===e):void 0}else{const c=a.root.tabs.find(p=>p.path===r);return c?(u=(i=c.content.metadata)==null?void 0:i.datasources)==null?void 0:u.find(p=>p.id===e):void 0}}),Ox=pe(e=>e,e=>e.sharedDatasources.sources),YL=(e,n,r,a)=>pe(Sx(e),Ox,(i,u)=>{const c=Bt.flatten(Bt.values(u)),f=[...n!=="private"?i:[],...n!=="shared"?c:[]];return r?f.filter(p=>(!a||a.every(({id:h,namespace:m=""})=>p.id!==h||(p.namespace||"")!==m))&&(r.includes(p.type)||p.dataType&&(r.includes(p.dataType)||r.includes("objectFromArray")&&p.dataType==="object"&&p.from))):f}),KL=pe(e=>e.debugger,e=>e.meta),Is=pe(e=>e.debugger,e=>e.list),En=pe(e=>e.debugger,e=>e.sessions),XL=pe(En,e=>e.length),Ps=(e,n,r,a)=>e.find(i=>i.filePath===n&&i.methodName===r&&(!a||i.className===a)),dr=(e,n)=>e.find(r=>r.threadId===n),Tx=(e,n)=>e.find(r=>r.tabPath===n),JL=(e,n)=>pe(Is,r=>{var a;return((a=Ps(r,e,n))==null?void 0:a.breakpoints.saved.locations)||[]}),ZL=(e,n)=>pe(Is,r=>{var a;return((a=Ps(r,e,n))==null?void 0:a.breakpoints.draft.locations)||[]}),QL=e=>pe(Is,n=>n.filter(r=>r.filePath===e).reduce((r,a)=>[...r,...a.breakpoints.saved.locations.map(i=>({...i,line:i.line+(a.breakpoints.saved.offset||0)}))],[]).sort((r,a)=>r.line-a.line)),e3=e=>pe(Is,n=>n.filter(r=>r.filePath===e).reduce((r,a)=>[...r,...a.breakpoints.draft.locations.map(i=>({...i,line:i.line+(a.breakpoints.draft.offset||0)}))],[]).sort((r,a)=>r.line-a.line)),t3=e=>pe(En,n=>{const r=dr(n,e);return r!=null&&r.stopped?r.highlightedLines:null}),r3=e=>pe(En,n=>{const r=dr(n,e);return r!=null&&r.stopped?r.activeLine:null}),n3=e=>pe(En,n=>{var r;return((r=dr(n,e))==null?void 0:r.expressions)||[]}),o3=e=>pe(En,n=>{var r;return((r=dr(n,e))==null?void 0:r.stopped)||!1}),a3=(e,n)=>pe(Is,r=>{var a;return(a=Ps(r,e,n))==null?void 0:a.source}),i3=e=>pe(En,n=>{var r;return((r=Tx(n,e))==null?void 0:r.threadId)||-1}),s3=e=>pe(En,n=>{var r,a;return(a=(r=dr(n,e))==null?void 0:r.currentStackFrame)==null?void 0:a.source}),u3=e=>pe(En,n=>{var r;return(r=dr(n,e))==null?void 0:r.currentStackFrame}),c3=pe(En,e=>e.map(({channelId:n,threadId:r})=>({id:n,threadId:r}))),l3=e=>pe(En,n=>{var r;return((r=dr(n,e))==null?void 0:r.stackFrames)||[]}),f3=e=>pe(En,n=>{var r,a;return((a=(r=dr(n,e))==null?void 0:r.variables)==null?void 0:a.callchain)||[]}),d3=e=>pe(En,n=>{var r,a;return((a=(r=dr(n,e))==null?void 0:r.variables)==null?void 0:a.expressions)||[]}),p3=(e,n="saved")=>pe(Is,r=>{const a=r.find(i=>i.filePath===e);return(a==null?void 0:a.breakpoints[n].offset)||0}),h3=(e,n,r,a)=>pe(En,i=>{var h;const u=((h=dr(i,e))==null?void 0:h.exceptions)||[],c=n===le.CLASS,f=c&&a?`${a}.${r}`:r;return(f?u.filter(m=>m.location===f):u).map(m=>({...m,locationLine:c?m.locationLine:m.locationLine+1}))}),za=pe(e=>e.root,e=>e),cu=pe(za,e=>e.tabs),v3=pe(za,e=>e.activeTab),g3=pe(za,e=>e.recent.filter(({type:n})=>n!==le.DEBUGGER)),m3=pe(za,({tabs:e,activeTab:n})=>e.find(({path:r})=>r===n)),y3=pe(za,({tabs:e})=>e.reduce((r,a)=>(a==null?void 0:a.weight)>((r==null?void 0:r.weight)||0)?a:r,null)),b3=pe(cu,e=>e.filter(({type:n,flags:r})=>n===le.WEBFORM&&r.enabled===!1).map(({path:n})=>n)),_3=pe(cu,e=>e.length>0),gf=e=>pe(za,n=>n.tabs.find(({path:r})=>r===e)),xx=(e,n="")=>pe(gf(e),r=>!r||!r.content||typeof r.content=="string"?r==null?void 0:r.content:Bt.get(r.content,n)),w3=e=>pe(gf(e),n=>n==null?void 0:n.extra),E3=(e,n=r=>r)=>pe(xx(e,"components"),r=>n(r||{})),Z_=pe(cu,e=>e.filter(n=>n.flags.touched)),S3=pe(Z_,e=>e.length),O3=pe(En,e=>e.map(({threadId:n,currentStackFrame:{source:r},tabPath:a})=>({name:WT(n,r),path:a,type:le.DEBUGGER,content:r==null?void 0:r.content,flags:{},extra:{source:r}}))),T3=pe(e=>e,e=>e.explorer||[]),Cx=pe(e=>e,e=>e.explorer.find(n=>n.path===Wt.WEBFORMS)),Rx=pe(e=>e,e=>e.explorer.find(n=>n.path===Wt.METHODS)),Ax=pe(e=>e,e=>e.explorer.find(n=>n.path===Wt.CLASSES)),x3=pe(Rx,e=>(e==null?void 0:e.children)||[]),C3=pe(Cx,e=>(e==null?void 0:e.children)||[]),R3=pe(Ax,e=>(e==null?void 0:e.children)||[]),A3=pe(e=>e.modals,e=>e.list),P3=pe(e=>e.roles,({roles:e})=>e),D3=pe(e=>e.roles,({privileges:e})=>e),I3=pe(e=>e.roles,({privileges:e})=>Object.values(e).find(({privilege:n})=>n==="guest")),M3=pe(e=>e.roles,({flags:e})=>e),k3=pe(e=>e.roles,({selectedTab:e})=>e),$3=pe(e=>e.roles,({date:e})=>e),Px=pe(e=>e.settings,e=>e.session),N3=pe(e=>e.settings,e=>e.project),j3=pe(e=>e.settings,e=>e),Q_=pe(e=>e.settings,e=>e.server),L3=pe(Q_,e=>e.remoteDebuggerMode),F3=pe(Q_,e=>e.qodly),W3=pe(Px,e=>e["monaco.zoom"]),Dx=["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"],Ix=Dx.map(e=>({id:y_(),content:"",name:e,parentId:null,scope:As.THEME})),ew=e=>pe(gf(e),n=>{var r,a;return((a=(r=n==null?void 0:n.content)==null?void 0:r.metadata)==null?void 0:a.styles)||[]}),B3=(e,n)=>pe(ew(e),r=>n.map(a=>{switch(!0){case a===As.LOCAL:return r.map(i=>({...i,scope:As.LOCAL}));case a===As.THEME:return Ix;default:return[]}}).flat()),U3=e=>pe(ew(e),n=>[...n.map(r=>({...r,scope:As.LOCAL})),...Ix]),z3=pe(e=>e,e=>{var n;return[...(((n=e.sharedCSS)==null?void 0:n.styles)||[]).map(r=>({...r,scope:As.SHARED}))]}),H3=e=>pe(gf(e),n=>n==null?void 0:n.flags),mf=pe(e=>e.webforms,e=>e),Mx=pe(mf,e=>(e==null?void 0:e.components)||[]),ep=pe(mf,e=>e.inspector),G3=pe(ep,e=>e.css),q3=pe(ep,e=>e.datasource),kx=pe(mf,e=>e.templates||{data:[]}),V3=pe(kx,e=>e.data||[]),Y3=e=>pe(Mx,n=>n.find(r=>r.id===e)),K3=e=>pe(ep,n=>n[e]),X3=pe(mf,e=>e.datasources.theme),J3=pe(e=>e.catalog,e=>e.sharedDatasources,e=>e.sharedCSS,(e,n,r)=>[e.state,n.state,r.state].every(a=>["loaded","error"].includes(a)));var tw=(e=>(e.SHOW_AFTER_TIMEOUT="show_after_timeout",e.HIDE_AFTER_TIMEOUT="hide_after_timeout",e))(tw||{}),$x=(e=>(e.AIRY="airy",e.COMPACT="neutral",e))($x||{});const Nx={metadata:{v:"1.0",datasources:[],styles:[]},components:{ROOT:{parent:"",type:{resolvedName:"Container"},isCanvas:!0,props:{className:"bg-white h-full w-full px-6",classNames:[],events:[],airyMode:!1},displayName:"App",custom:{},hidden:!1,nodes:[],linkedNodes:{}}}};var If,Z3=new Uint8Array(16);function jx(){if(!If&&(If=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!If))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return If(Z3)}const Q3=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function tp(e){return typeof e=="string"&&Q3.test(e)}var Fr=[];for(var c1=0;c1<256;++c1)Fr.push((c1+256).toString(16).substr(1));function rp(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(Fr[e[n+0]]+Fr[e[n+1]]+Fr[e[n+2]]+Fr[e[n+3]]+"-"+Fr[e[n+4]]+Fr[e[n+5]]+"-"+Fr[e[n+6]]+Fr[e[n+7]]+"-"+Fr[e[n+8]]+Fr[e[n+9]]+"-"+Fr[e[n+10]]+Fr[e[n+11]]+Fr[e[n+12]]+Fr[e[n+13]]+Fr[e[n+14]]+Fr[e[n+15]]).toLowerCase();if(!tp(r))throw TypeError("Stringified UUID is invalid");return r}var IS,l1,f1=0,d1=0;function e4(e,n,r){var a=n&&r||0,i=n||new Array(16);e=e||{};var u=e.node||IS,c=e.clockseq!==void 0?e.clockseq:l1;if(u==null||c==null){var f=e.random||(e.rng||jx)();u==null&&(u=IS=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),c==null&&(c=l1=(f[6]<<8|f[7])&16383)}var p=e.msecs!==void 0?e.msecs:Date.now(),h=e.nsecs!==void 0?e.nsecs:d1+1,m=p-f1+(h-d1)/1e4;if(m<0&&e.clockseq===void 0&&(c=c+1&16383),(m<0||p>f1)&&e.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f1=p,d1=h,l1=c,p+=122192928e5;var b=((p&268435455)*1e4+h)%4294967296;i[a++]=b>>>24&255,i[a++]=b>>>16&255,i[a++]=b>>>8&255,i[a++]=b&255;var E=p/4294967296*1e4&268435455;i[a++]=E>>>8&255,i[a++]=E&255,i[a++]=E>>>24&15|16,i[a++]=E>>>16&255,i[a++]=c>>>8|128,i[a++]=c&255;for(var O=0;O<6;++O)i[a+O]=u[O];return n||rp(i)}function Lx(e){if(!tp(e))throw TypeError("Invalid UUID");var n,r=new Uint8Array(16);return r[0]=(n=parseInt(e.slice(0,8),16))>>>24,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=n&255,r[4]=(n=parseInt(e.slice(9,13),16))>>>8,r[5]=n&255,r[6]=(n=parseInt(e.slice(14,18),16))>>>8,r[7]=n&255,r[8]=(n=parseInt(e.slice(19,23),16))>>>8,r[9]=n&255,r[10]=(n=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=n/4294967296&255,r[12]=n>>>24&255,r[13]=n>>>16&255,r[14]=n>>>8&255,r[15]=n&255,r}function t4(e){e=unescape(encodeURIComponent(e));for(var n=[],r=0;r<e.length;++r)n.push(e.charCodeAt(r));return n}var r4="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n4="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Fx(e,n,r){function a(i,u,c,f){if(typeof i=="string"&&(i=t4(i)),typeof u=="string"&&(u=Lx(u)),u.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var p=new Uint8Array(16+i.length);if(p.set(u),p.set(i,u.length),p=r(p),p[6]=p[6]&15|n,p[8]=p[8]&63|128,c){f=f||0;for(var h=0;h<16;++h)c[f+h]=p[h];return c}return rp(p)}try{a.name=e}catch{}return a.DNS=r4,a.URL=n4,a}function o4(e){if(typeof e=="string"){var n=unescape(encodeURIComponent(e));e=new Uint8Array(n.length);for(var r=0;r<n.length;++r)e[r]=n.charCodeAt(r)}return a4(i4(s4(e),e.length*8))}function a4(e){for(var n=[],r=e.length*32,a="0123456789abcdef",i=0;i<r;i+=8){var u=e[i>>5]>>>i%32&255,c=parseInt(a.charAt(u>>>4&15)+a.charAt(u&15),16);n.push(c)}return n}function Wx(e){return(e+64>>>9<<4)+14+1}function i4(e,n){e[n>>5]|=128<<n%32,e[Wx(n)-1]=n;for(var r=1732584193,a=-271733879,i=-1732584194,u=271733878,c=0;c<e.length;c+=16){var f=r,p=a,h=i,m=u;r=Vr(r,a,i,u,e[c],7,-680876936),u=Vr(u,r,a,i,e[c+1],12,-389564586),i=Vr(i,u,r,a,e[c+2],17,606105819),a=Vr(a,i,u,r,e[c+3],22,-1044525330),r=Vr(r,a,i,u,e[c+4],7,-176418897),u=Vr(u,r,a,i,e[c+5],12,1200080426),i=Vr(i,u,r,a,e[c+6],17,-1473231341),a=Vr(a,i,u,r,e[c+7],22,-45705983),r=Vr(r,a,i,u,e[c+8],7,1770035416),u=Vr(u,r,a,i,e[c+9],12,-1958414417),i=Vr(i,u,r,a,e[c+10],17,-42063),a=Vr(a,i,u,r,e[c+11],22,-1990404162),r=Vr(r,a,i,u,e[c+12],7,1804603682),u=Vr(u,r,a,i,e[c+13],12,-40341101),i=Vr(i,u,r,a,e[c+14],17,-1502002290),a=Vr(a,i,u,r,e[c+15],22,1236535329),r=Yr(r,a,i,u,e[c+1],5,-165796510),u=Yr(u,r,a,i,e[c+6],9,-1069501632),i=Yr(i,u,r,a,e[c+11],14,643717713),a=Yr(a,i,u,r,e[c],20,-373897302),r=Yr(r,a,i,u,e[c+5],5,-701558691),u=Yr(u,r,a,i,e[c+10],9,38016083),i=Yr(i,u,r,a,e[c+15],14,-660478335),a=Yr(a,i,u,r,e[c+4],20,-405537848),r=Yr(r,a,i,u,e[c+9],5,568446438),u=Yr(u,r,a,i,e[c+14],9,-1019803690),i=Yr(i,u,r,a,e[c+3],14,-187363961),a=Yr(a,i,u,r,e[c+8],20,1163531501),r=Yr(r,a,i,u,e[c+13],5,-1444681467),u=Yr(u,r,a,i,e[c+2],9,-51403784),i=Yr(i,u,r,a,e[c+7],14,1735328473),a=Yr(a,i,u,r,e[c+12],20,-1926607734),r=Kr(r,a,i,u,e[c+5],4,-378558),u=Kr(u,r,a,i,e[c+8],11,-2022574463),i=Kr(i,u,r,a,e[c+11],16,1839030562),a=Kr(a,i,u,r,e[c+14],23,-35309556),r=Kr(r,a,i,u,e[c+1],4,-1530992060),u=Kr(u,r,a,i,e[c+4],11,1272893353),i=Kr(i,u,r,a,e[c+7],16,-155497632),a=Kr(a,i,u,r,e[c+10],23,-1094730640),r=Kr(r,a,i,u,e[c+13],4,681279174),u=Kr(u,r,a,i,e[c],11,-358537222),i=Kr(i,u,r,a,e[c+3],16,-722521979),a=Kr(a,i,u,r,e[c+6],23,76029189),r=Kr(r,a,i,u,e[c+9],4,-640364487),u=Kr(u,r,a,i,e[c+12],11,-421815835),i=Kr(i,u,r,a,e[c+15],16,530742520),a=Kr(a,i,u,r,e[c+2],23,-995338651),r=Xr(r,a,i,u,e[c],6,-198630844),u=Xr(u,r,a,i,e[c+7],10,1126891415),i=Xr(i,u,r,a,e[c+14],15,-1416354905),a=Xr(a,i,u,r,e[c+5],21,-57434055),r=Xr(r,a,i,u,e[c+12],6,1700485571),u=Xr(u,r,a,i,e[c+3],10,-1894986606),i=Xr(i,u,r,a,e[c+10],15,-1051523),a=Xr(a,i,u,r,e[c+1],21,-2054922799),r=Xr(r,a,i,u,e[c+8],6,1873313359),u=Xr(u,r,a,i,e[c+15],10,-30611744),i=Xr(i,u,r,a,e[c+6],15,-1560198380),a=Xr(a,i,u,r,e[c+13],21,1309151649),r=Xr(r,a,i,u,e[c+4],6,-145523070),u=Xr(u,r,a,i,e[c+11],10,-1120210379),i=Xr(i,u,r,a,e[c+2],15,718787259),a=Xr(a,i,u,r,e[c+9],21,-343485551),r=Ja(r,f),a=Ja(a,p),i=Ja(i,h),u=Ja(u,m)}return[r,a,i,u]}function s4(e){if(e.length===0)return[];for(var n=e.length*8,r=new Uint32Array(Wx(n)),a=0;a<n;a+=8)r[a>>5]|=(e[a/8]&255)<<a%32;return r}function Ja(e,n){var r=(e&65535)+(n&65535),a=(e>>16)+(n>>16)+(r>>16);return a<<16|r&65535}function u4(e,n){return e<<n|e>>>32-n}function np(e,n,r,a,i,u){return Ja(u4(Ja(Ja(n,e),Ja(a,u)),i),r)}function Vr(e,n,r,a,i,u,c){return np(n&r|~n&a,e,n,i,u,c)}function Yr(e,n,r,a,i,u,c){return np(n&a|r&~a,e,n,i,u,c)}function Kr(e,n,r,a,i,u,c){return np(n^r^a,e,n,i,u,c)}function Xr(e,n,r,a,i,u,c){return np(r^(n|~a),e,n,i,u,c)}var c4=Fx("v3",48,o4);const l4=c4;function f4(e,n,r){e=e||{};var a=e.random||(e.rng||jx)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,n){r=r||0;for(var i=0;i<16;++i)n[r+i]=a[i];return n}return rp(a)}function d4(e,n,r,a){switch(e){case 0:return n&r^~n&a;case 1:return n^r^a;case 2:return n&r^n&a^r&a;case 3:return n^r^a}}function p1(e,n){return e<<n|e>>>32-n}function p4(e){var n=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var a=unescape(encodeURIComponent(e));e=[];for(var i=0;i<a.length;++i)e.push(a.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var u=e.length/4+2,c=Math.ceil(u/16),f=new Array(c),p=0;p<c;++p){for(var h=new Uint32Array(16),m=0;m<16;++m)h[m]=e[p*64+m*4]<<24|e[p*64+m*4+1]<<16|e[p*64+m*4+2]<<8|e[p*64+m*4+3];f[p]=h}f[c-1][14]=(e.length-1)*8/Math.pow(2,32),f[c-1][14]=Math.floor(f[c-1][14]),f[c-1][15]=(e.length-1)*8&4294967295;for(var b=0;b<c;++b){for(var E=new Uint32Array(80),O=0;O<16;++O)E[O]=f[b][O];for(var R=16;R<80;++R)E[R]=p1(E[R-3]^E[R-8]^E[R-14]^E[R-16],1);for(var C=r[0],k=r[1],j=r[2],F=r[3],D=r[4],M=0;M<80;++M){var S=Math.floor(M/20),q=p1(C,5)+d4(S,k,j,F)+D+n[S]+E[M]>>>0;D=F,F=j,j=p1(k,30)>>>0,k=C,C=q}r[0]=r[0]+C>>>0,r[1]=r[1]+k>>>0,r[2]=r[2]+j>>>0,r[3]=r[3]+F>>>0,r[4]=r[4]+D>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var h4=Fx("v5",80,p4);const v4=h4,g4="00000000-0000-0000-0000-000000000000";function m4(e){if(!tp(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}const y4=Object.freeze(Object.defineProperty({__proto__:null,NIL:g4,parse:Lx,stringify:rp,v1:e4,v3:l4,v4:f4,v5:v4,validate:tp,version:m4},Symbol.toStringTag,{value:"Module"})),b4=cA(y4);function rw(e,n){if(!e||!n||!e.length||!n.length)throw new Error("Bad alphabet");this.srcAlphabet=e,this.dstAlphabet=n}rw.prototype.convert=function(e){var n,r,a,i={},u=this.srcAlphabet.length,c=this.dstAlphabet.length,f=e.length,p=typeof e=="string"?"":[];if(!this.isValid(e))throw new Error('Number "'+e+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return e;for(n=0;n<f;n++)i[n]=this.srcAlphabet.indexOf(e[n]);do{for(r=0,a=0,n=0;n<f;n++)r=r*u+i[n],r>=c?(i[a++]=parseInt(r/c,10),r=r%c):a>0&&(i[a++]=0);f=a,p=this.dstAlphabet.slice(r,r+1).concat(p)}while(a!==0);return p};rw.prototype.isValid=function(e){for(var n=0;n<e.length;++n)if(this.srcAlphabet.indexOf(e[n])===-1)return!1;return!0};var _4=rw,w4=_4;function yf(e,n){var r=new w4(e,n);return function(a){return r.convert(a)}}yf.BIN="01";yf.OCT="01234567";yf.DEC="0123456789";yf.HEX="0123456789abcdef";var E4=yf;const{v4:h1}=b4,Mf=E4,v1="123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",S4="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",O4={consistentLength:!0};let g1;const MS=(e,n,r)=>{const a=n(e.toLowerCase().replace(/-/g,""));return!r||!r.consistentLength?a:a.padStart(r.shortIdLength,r.paddingChar)},T4=(e,n)=>{const a=n(e).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[a[1],a[2],a[3],a[4],a[5]].join("-")},x4=e=>Math.ceil(Math.log(2**128)/Math.log(e));var _d=(()=>{const e=(n,r)=>{const a=n||v1,i={...O4,...r};if([...new Set(Array.from(a))].length!==a.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const u=x4(a.length),c={shortIdLength:u,consistentLength:i.consistentLength,paddingChar:a[0]},f=Mf(Mf.HEX,a),p=Mf(a,Mf.HEX),h=()=>MS(h1(),f,c),m={new:h,generate:h,uuid:h1,fromUUID:b=>MS(b,f,c),toUUID:b=>T4(b,p),alphabet:a,maxLength:u};return Object.freeze(m),m};return e.constants={flickrBase58:v1,cookieBase90:S4},e.uuid=h1,e.generate=()=>(g1||(g1=e(v1).generate),g1()),e})(),gt=(e=>(e.DATACLASS="dataclass",e.METHOD="method",e.ATTRIBUTE="attribute",e.DATASTORE="datastore",e))(gt||{});const C4=[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE,gt.METHOD],wd="guest",nw=[{key:"read",label:"Read",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"create",label:"Create",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"update",label:"Update",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"drop",label:"Delete",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"describe",label:"Describe",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE,gt.METHOD]},{key:"execute",label:"Execute",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.METHOD]},{key:"promote",label:"Promote",canApplyTo:[gt.METHOD]}];function Gn(e,...n){return Array.from(new Set([...e,...n]))}function Bx(e){const n={},r=new Map;e.forEach(p=>{const h=p.id||_d.generate();n[h]={...p,id:h,parents:[],includes:Gn(p.includes||[]),resources:[]},r.set(p.privilege,h)}),Object.entries(n).forEach(([p,h])=>{const m=h.includes.map(b=>{const E=r.get(b);return E?(n[E].parents=Gn(n[E].parents,E),E):""}).filter(Boolean);n[p]={...h,includes:m}});const a=Ux(n),i=new Set;function u(p){i.add(p.id),p.includes=p.includes.filter(h=>!i.has(h))}if(a.forEach(u),a.forEach(p=>p.parents=[]),a.forEach(p=>{p.includes.forEach(h=>n[h].parents.push(p.id))}),Object.values(n).find(({privilege:p})=>p===wd))return n;const f=_d.generate();return{[f]:{id:f,privilege:wd,includes:[],parents:[],resources:[]},...n}}function Ux(e){return Object.values(e).sort((n,r)=>n.parents.length-r.parents.length)}function op(e,n){const r=n[e];let a=[];return r&&r.parents.forEach(i=>{a=Gn(a,...op(i,n),i)}),a}function Ed(e,n){const r=n[e];let a=[];return r&&r.includes.forEach(i=>{a=Gn(a,...Ed(i,n),i)}),a}function R4(e,n){const r=n[e];if(!r)return[];const a=[e,...op(e,n),...r.includes];return Object.keys(n).filter(i=>!a.includes(i))}function A4(e,n){return n[e]?Object.keys(n).reduce((a,i)=>i===e?a:{...a,[i]:{...n[i],parents:n[i].parents.filter(u=>u!==e),includes:n[i].includes.filter(u=>u!==e)}},{}):n}function P4(e,n,r){const a=r[e],i=r[n];return!a||!i?r:{...r,[e]:{...r[e],includes:Gn(a.includes,n)},[n]:{...r[n],parents:Gn(i.parents,e)}}}function D4(e,n,r){const a=r[e],i=r[n];return!a||!i?r:{...r,[e]:{...r[e],includes:r[e].includes.filter(u=>u!==n)},[n]:{...r[n],parents:r[n].parents.filter(u=>u!==e)}}}function zx(e,n){vT(e),Object.entries(n).forEach(([,{privilege:a}])=>{if(e.toLowerCase()===a.toLowerCase())throw new Error(`There's already a Privilege with the name ${e}`)});const r=_d.generate();return{[r]:{id:r,privilege:e,includes:[],parents:[],resources:[]},...n}}function I4(e,n,r,a,i){let u=zx(e,i);const c=Object.entries(u).find(([,f])=>f.privilege===e);return c?(u=Vx(c[1].id,n,r,a,u),u):i}function M4(e,n,r){if(!e)throw new Error("Please enter a name");if(!r[n])throw new Error("Invalid privilege");return Object.entries(r).forEach(([,{privilege:a,id:i}])=>{if(e.toLowerCase()===a.toLowerCase()&&n!==i)throw new Error(`There's already a Privilege with the name ${e}`)}),{...r,[n]:{...r[n],privilege:e}}}function k4(e,n){return e.map(r=>Ha(r,n))}function Ha(e,n){return n[e]?n[e]:null}function Hx({applyTo:e,type:n,...r}){return Object.entries(r).reduce((a,[i,u])=>{const c=Bt.find(nw,["key",i]);return!c||!c.canApplyTo.includes(n)||(typeof u=="string"?u.split(","):u).forEach(p=>{a[p]=Gn(a[p]||[],i)}),a},{})}const o_=(e,n=!1)=>["read","create","update","delete"].includes(e.toLowerCase())?`All ${n?"dataclasses and ":""}attributes have the '${e.toLowerCase()}' permission`:e.toLowerCase()==="execute"?`All functions defined ${n?"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 ${n?"dataclasses, ":""}attributes and functions have the '${e.toLowerCase()}' permission`;function ow(e){return{permissions:nw.filter(({canApplyTo:n})=>n.includes(e.type)).map(({key:n,label:r})=>{const a={name:n,from:[]};switch(e.type){case gt.DATASTORE:return{...a,info:o_(r,!0)};case gt.DATACLASS:return{...a,info:o_(r)};default:return a}}),resource:e.applyTo,type:e.type}}function Gx(e,n){const r=qx(n),a={};return e.filter(({type:i})=>C4.includes(i)).forEach(i=>{const u=Hx(i);Object.entries(u).forEach(([c,f])=>{var m;const p=(m=r[c])==null?void 0:m.id;if(!p)return;a[p]=a[p]||{...n[p]};let h=Bt.find(a[p].resources,{resource:i.applyTo,type:i.type});h||(h=ow(i),a[p].resources.push(h)),h.permissions=h.permissions.map(b=>({...b,checked:b.checked||f.includes(b.name)}))})}),{...n,...a}}function qx(e){return Object.values(e).reduce((n,r)=>({...n,[r.privilege]:r}),{})}function ap(e){var r;const n=Bx(e.privileges||[]);return{privileges:Gx(((r=e.permissions)==null?void 0:r.allowed)||[],n),roles:(e.roles||[]).map(({id:a=_d.generate(),role:i,privileges:u=[]})=>({id:a,role:i,privileges:Gn(u).map(c=>{var f;return(f=Object.values(n).find(({privilege:p})=>p===c))==null?void 0:f.id}).filter(Boolean)})).reduce((a,i)=>({...a,[i.id]:{...i}}),{})}}function aw(e){const n=Object.values(e.privileges).filter(({includes:a})=>a.length===0).map(({id:a})=>a),r=[...n,...n.map(a=>op(a,e.privileges).reverse())].flat().filter((a,i,u)=>u.indexOf(a)===i).map(a=>e.privileges[a]);return{permissions:{allowed:Object.values(e.privileges).reduce((a,i)=>(i.resources.forEach(({permissions:u,resource:c,type:f})=>{let p=Bt.find(a,{applyTo:c,type:f});p||(p={applyTo:c,type:f},a.push(p)),u.forEach(({name:h,checked:m})=>{m&&p&&(p[h]=p[h]||[],p[h].push(i.privilege))})}),a),[])},privileges:r.filter(({privilege:a})=>a!==wd).map(({id:a,includes:i,privilege:u})=>({id:a,privilege:u,includes:i.map(c=>e.privileges[c].privilege)})),roles:Object.values(e.roles).map(a=>({...a,privileges:a.privileges.map(i=>{var u;return(u=e.privileges[i])==null?void 0:u.privilege}).filter(Boolean)}))}}function $4(e,n){const r=n[e],a={children:[],links:[],parents:[],selected:e};if(!r)return a;function i(f,p,h=[]){const m=f.reduce((b,E)=>[...b,...n[E][p]],[]);return m.length===0?h:(h.push(m),i(m,p,h))}function u(f){const p=[],h=[];for(let m=f.length-1;m>=0;m-=1){const b=f[m].filter(E=>p.includes(E)?!1:(p.push(E),!0));b.length>0&&h.unshift(Gn(b))}return h}function c(f,p){const h=[];return f.reduce((m,b)=>(b.forEach(E=>{n[E][p==="parents"?"includes":"parents"].forEach(R=>{h.includes(R)&&m.push(p==="parents"?{source:E,target:R}:{source:R,target:E})}),h.push(E)}),m),[])}return a.children=i([e],"includes"),a.children=u(a.children),a.parents=i([e],"parents"),a.parents=u(a.parents),a.links=[...c([[e],...a.parents],"parents"),...c([[e],...a.children],"includes")],a}function N4(e,n,r){const a=Ha(e,r);if(!a||Bt.find(a.resources,{resource:n.applyTo,type:n.type}))return r;const i={...a,resources:[...a.resources,ow(n)]};return{...r,[e]:i}}function j4(e,n,r){const a=Ha(e,r);if(!a)return r;const i={...a,resources:a.resources.filter(({resource:u,type:c})=>u!==n.applyTo||c!==n.type)};return{...r,[e]:i}}function L4(e,n){const r=Ha(e,n);if(!r)return n;const a={...r,resources:r.resources.filter(i=>i.permissions.some(u=>u.from.length)).map(i=>({...i,permissions:i.permissions.map(u=>({...u,checked:!1}))}))};return{...n,[e]:a}}function Vx(e,n,r,a,i){const u=Ha(e,i);if(!u)return i;const f=Bt.find(u.resources,{type:r,resource:n})?{...u,resources:u.resources.map(p=>p.type===r&&p.resource===n?{...p,permissions:p.permissions.map(h=>h.name===a?{...h,checked:!h.checked,from:[]}:h)}:p)}:{...u,resources:[...u.resources,{type:r,resource:n,permissions:nw.filter(p=>p.canApplyTo.includes(r)).map(p=>({from:[],name:p.key,checked:p.key===a,info:o_(p.key,r===gt.DATASTORE)}))}]};return{...i,[e]:f}}function F4(e,n,r,a){const i=Ha(e,a);if(!i)return a;const c=Bt.find(i.resources,{type:n.type,resource:n.resource})?{...i,resources:i.resources.map(f=>f.type===n.type&&f.resource===n.resource?{...f,permissions:n.permissions.map(p=>p.name===r.name?{...p,checked:!p.checked,from:[]}:p)}:f)}:{...i,resources:[...i.resources,{...n,permissions:n.permissions.map(f=>({...f,checked:r.name===f.name,from:[]}))}]};return{...a,[e]:c}}function W4(e,n){var p;const r=Yx(e,n)||[],a=((p=Ha(e,n))==null?void 0:p.resources)||[],c=([...r,...a].filter(({type:h})=>h===gt.METHOD)||[]).map(({resource:h})=>h);return Object.entries(n).reduce((h,[m,{resources:b}])=>(b.filter(({resource:E,type:O})=>O===gt.METHOD&&c.includes(E)).forEach(({permissions:E,resource:O})=>{var C;((C=E.find(({name:k})=>k==="promote"))==null?void 0:C.checked)&&(h[O]=Gn(h[O]||[],m))}),h),{})}function Yx(e,n){var c;const r=Ha(e,n);if(!r)return[];const a=(c=Object.values(n).find(f=>f.privilege===wd))==null?void 0:c.id;return(a&&a!==e?Gn(Ed(e,n),a):Ed(e,n)).reduce((f,p)=>(n[p].resources.forEach(m=>{if(m.permissions.filter(({checked:O})=>O).length===0)return;const E=Bt.find(f,{type:m.type,resource:m.resource});if(!E){f.push({...m,permissions:m.permissions.map(O=>({...O,from:O.checked?[p]:[],checked:!1}))});return}E.permissions=E.permissions.map((O,R)=>{let{from:C=[]}=O;return m.permissions[R].checked&&!C.includes(p)&&(C=[...C,p]),{...O,from:C,checked:O.checked}})}),f),Bt.clone(r.resources.map(f=>({...f,permissions:f.permissions.map(({checked:p,...h})=>({...h,checked:!!p}))}))))}const B4=e=>e.reduce((n,r)=>({...n,[r.id]:{...r}}),{}),U4=(e,n)=>n[e]?Object.values(n).reduce((r,a)=>e===a.id||a.role===""?r:{...r,[a.id]:a},{}):n,z4=(e,n,r)=>r[e]?Object.values(r).reduce((a,i)=>e===i.id?{...a,[i.id]:{...i,name:n}}:{...a,[i.id]:i},{}):r,H4=(e,n)=>{const r={id:e,role:"",privileges:[]};return{...n,[r.id]:r}},G4=(e,n)=>{if(vT(e.role),Object.values(n).find(a=>a.role===e.role))throw new Error(`a role with the name ${e.role} already exists`);return Object.values(n).reduce((a,i)=>e.id===i.id?{...a,[e.id]:e}:{...a,[i.id]:i},{})},q4={list:[]},kS=(e,n)=>e.list.filter(r=>r.id!==n),Kx=qn({name:"modals",initialState:q4,reducers:{createModal:(e,n)=>{e.list.push(n.payload)},editModal:(e,n)=>{const{id:r,...a}=n.payload,i=e.list.find(QM(r));i&&Object.assign(i,{...a})},removeModal:(e,n)=>{const r=n.payload;e.list=kS(e,r)},closeModal:(e,n)=>{const{id:r,reason:a}=n.payload;if(a){const i=e.list.find(u=>u.id===r);i&&(i.closeReason=a,i.isOpen=!1)}else e.list=kS(e,r)}}}),{createModal:Xx,removeModal:Jx,closeModal:V4,editModal:Y4}=Kx.actions;var Zx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$S=ie.createContext&&ie.createContext(Zx),ei=globalThis&&globalThis.__assign||function(){return ei=Object.assign||function(e){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ei.apply(this,arguments)},K4=globalThis&&globalThis.__rest||function(e,n){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)n.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]]);return r};function Qx(e){return e&&e.map(function(n,r){return ie.createElement(n.tag,ei({key:r},n.attr),Qx(n.child))})}function ip(e){return function(n){return ie.createElement(X4,ei({attr:ei({},e.attr)},n),Qx(e.child))}}function X4(e){var n=function(r){var a=e.attr,i=e.size,u=e.title,c=K4(e,["attr","size","title"]),f=i||r.size||"1em",p;return r.className&&(p=r.className),e.className&&(p=(p?p+" ":"")+e.className),ie.createElement("svg",ei({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,c,{className:p,style:ei(ei({color:e.color||r.color},r.style),e.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),u&&ie.createElement("title",null,u),e.children)};return $S!==void 0?ie.createElement($S.Consumer,null,function(r){return n(r)}):n(Zx)}function J4(e){return ip({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function Z4(e){return ip({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"}}]})(e)}function Q4(e){return ip({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z"}},{tag:"path",attr:{d:"M11 7h2v7h-2zm0 8h2v2h-2z"}}]})(e)}function e6(e){return ip({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"}}]})(e)}const t6={FaSave:J4,AiFillWarning:e6,BiErrorCircle:Q4,BsFillInfoCircleFill:Z4};var Hn=(e=>(e.ALERT="alert",e.CONFIRM="confirm",e))(Hn||{}),Ga=(e=>(e.PRIMARY="primary",e.WARNING="warning",e.DANGER="danger",e))(Ga||{}),iw=(e=>(e.CONFIRMED="confirmed",e.CANCELED="canceled",e))(iw||{});const Eo=xe("modals/open",async(e,{dispatch:n})=>{const{type:r=Hn.ALERT}=e,a=y_();switch(n(Xx({id:a,type:r,isOpen:!0,...e})),r){case Hn.CONFIRM:return new Promise(i=>{const u=Ds.subscribe(()=>{var p;const{modals:c}=Ds.getState(),f=c.list.find(h=>h.id===a);if(f&&!f.isOpen){const h=f.closeReason===iw.CONFIRMED,m=Bt.entries((p=f.views)==null?void 0:p.toggles).reduce((b,E)=>({...b,[E[0]]:E[1].value}),{});n(Jx(a)),u(),i({confirmed:h,options:m})}})});default:return{}}}),eC=()=>hk({name:Ur}),tC="Roles & Privileges",Sd=xe("roles/fetchRoles",async(e,{dispatch:n,rejectWithValue:r})=>{var u;let a;try{a=await eC()}catch(c){if(!Array.isArray((u=c==null?void 0:c.data)==null?void 0:u.__ERROR))return r("Error while loading the roles");a={name:Ur,date:new Date().toISOString(),content:{permissions:{allowed:[]},privileges:[],roles:[]}}}const i={name:tC,type:le.ROLES,date:a.date,view:{panel:{isOpen:!1,type:"",current:""}},path:Ur,flags:{},content:{}};return n(wn(i)),{...a,content:ap(a.content)}}),rC=xe("roles/fetchRolesChanges",async(e,{getState:n})=>{const{tabs:r}=n().root;if(r.find(i=>i.path===Ur)){const{date:i}=n().roles;if(i&&await sw(i))return{old:!0}}return{}}),sw=async e=>{if(!e)return!1;try{const n=await eC();if(n.date){const r=new Date(e),a=new Date(n.date);if(r>a)return!0}}catch(n){if(!Array.isArray(n==null?void 0:n.data.__ERROR))throw n}return!1},a_=xe("roles/saveRoles",async(e,{getState:n,rejectWithValue:r,dispatch:a})=>{try{const{flags:i,date:u}=n().roles;if(i.old||await sw(u)){const{confirmed:p}=await a(Eo({title:tC,message:"New content has been found on the server. Are you sure you want to continue?",type:Hn.CONFIRM,icon:"FaSave"})).unwrap();if(!p)return r({old:!0})}return await Gd({name:Ur,content:aw(e)})}catch{return r("Error while loading the roles")}}),r6=nu().roles,{roles:n6={},privileges:o6={},flags:a6={touched:!1},date:i6,selectedTab:s6="roles"}=r6||{},u6={flags:a6,roles:n6,privileges:o6,date:i6,selectedTab:s6},nC=qn({name:"roles",initialState:u6,reducers:{updatePrivileges:(e,n)=>{e.privileges=n.payload,e.flags.touched=!0},updateRoles:(e,n)=>{e.roles=n.payload,e.flags.touched=!0},updateRolesAndPrivileges:(e,n)=>{e.roles=n.payload.roles,e.privileges=n.payload.privileges},toggleTab:(e,n)=>{e.selectedTab=n.payload},setRolesContent(e,n){const{content:r,date:a}=n.payload,i=ap(r);return{...e,...i,date:a}}},extraReducers(e){e.addCase(Sd.fulfilled,(n,r)=>{const{content:a,date:i}=r.payload;n={...n,...a,date:i}}).addCase(Sd.rejected,n=>({...n,roles:{},privileges:{},flags:{touched:!1},date:void 0})).addCase(a_.fulfilled,(n,r)=>({...n,flags:{...n.flags,touched:!1,old:!1},date:r.payload.date})).addCase(a_.rejected,(n,r)=>FT.isString(r.payload)?n:{...n,flags:{...n.flags,...r.payload}}).addCase(rC.fulfilled,(n,r)=>({...n,flags:{...n.flags,...r.payload}})).addCase(Ys.fulfilled,(n,r)=>{!r.payload||r.payload.path!==Ur||(n.flags.touched=!1,n.flags.old=!1)}).addCase(hw.fulfilled,(n,r)=>{r.meta.arg!==Ur||!r.payload||(n.flags.touched=!1,n.flags.old=!1)})}}),{updatePrivileges:oC,updateRoles:aC,setRolesContent:uw,toggleTab:c6,updateRolesAndPrivileges:cw}=nC.actions,l6=nC.reducer,oi="qodlyApp.json",lw=xe("settings/fetch",async()=>await ni({verb:Zt.GET_INFO,path:oi,content:!0,as:"json"})),iC=xe("settings/app",uk),f6=IT(),NS={session:{"studio.tips":!0,"studio.notifications":!0,"webforms.tooltip.behavior":tw.SHOW_AFTER_TIMEOUT,"webforms.tooltip.timeout":3e3,"webforms.renderer.showPopOver":!0,"welcometour.active":!0,"webforms.properties.advanced-mode":!1,"monaco.zoom":0},project:{"webforms.renderer.indexPage":"","webforms.display-mode":"neutral"},server:{projectOpened:!1,remoteDebuggerMode:W_.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:"",lsp:""},isRestActive:!0}},d6={...NS,session:{...NS.session,...f6},welcometour:{}},sC=qn({name:"settings",initialState:d6,reducers:{setSetting(e,n){const{path:r,settingsKey:a,value:i}=n.payload;e[r][a]=i},setSettings(e,n){const{path:r,value:a}=n.payload;e[r]={...e[r],...a}},setSettingsAsText(e,n){const{path:r,settings:a}=n.payload;e[r]=a}},extraReducers(e){e.addCase(lw.fulfilled,(n,r)=>{n.project={...n.project,...r.payload.content}}),e.addCase(iC.fulfilled,(n,r)=>{n.server=r.payload,n.server.qodly&&(n.project["webforms.display-mode"]="airy")})}}),{setSetting:uC,setSettings:sp,setSettingsAsText:p6}=sC.actions,h6=sC.reducer,i_=e=>{const n=["folder","file"];return e.sort((r,a)=>r.type===a.type?r.name.localeCompare(a.name):n.indexOf(r.type)-n.indexOf(a.type))},ct=(e,n)=>e.reduce((r,a)=>a.path===n.path&&a.type===n.type?[...r,n]:a.children?[...r,{...a,children:i_(ct(a.children,n))}]:[...r,a],[]),Tr=(e,n)=>e.reduce((r,a)=>r||(a.path===n?a:a.children?Tr(a.children,n):null),null),v6=[{name:Wt.WEBFORMS,type:le.FOLDER,children:[],path:Wt.WEBFORMS,error:null,flags:{expanded:!1,loading:!1,cached:!1},tipKey:"editors:webform:explorer:webforms",config:{},isRoot:!0},{name:Wt.METHODS,type:le.FOLDER,children:[],path:Wt.METHODS,error:null,flags:{expanded:!1,loading:!1,cached:!1},config:{},isRoot:!0},{name:Wt.CLASSES,type:le.FOLDER,children:[],path:Wt.CLASSES,error:null,flags:{expanded:!1,loading:!1,cached:!1},config:{},isRoot:!0},{name:Wt.SHARED,type:le.FOLDER,children:[],path:Wt.SHARED,error:null,flags:{expanded:!1,loading:!1,cached:!1},config:{},isRoot:!0},{name:"Debugger",type:le.FOLDER,children:[],path:"Debugger",error:null,flags:{expanded:!1,cached:!0},config:{},isRoot:!0},{name:"Roles And Privileges",type:le.FILE,ext:"json",path:"roles",error:null,flags:{},config:{editor:{key:"editors:roles"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},isRoot:!0},{name:"Model",type:le.MODEL,ext:"4DModel",path:"model",error:null,flags:{},config:{editor:{key:"editors:model"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]}},{name:"Settings",type:le.FILE,ext:"json",path:"qodlyApp",error:null,flags:{},config:{editor:{key:"editors:settings"}},isRoot:!0}],cC=qn({name:"explorer",initialState:v6,reducers:{toggleExpandFolder:(e,n)=>(e=ct(e,{...n.payload,flags:{...n.payload.flags,expanded:!n.payload.flags.expanded}}),e),expandFolder:(e,n)=>(e=ct(e,{...n.payload,flags:{...n.payload.flags,expanded:!0}}),e),openAddFileInput:(e,n)=>ct(e,{...n.payload,flags:{...n.payload.flags,adding:!0}}),addNewFile:(e,n)=>{const{parent:r,child:a}=n.payload;return ct(e,{...r,children:[a,...r.children||[]]})},removeFile:(e,n)=>{const{parent:r,child:a}=n.payload;return ct(e,{...r,children:r.children.filter(i=>i.path!==a.path)})},refreshFile:(e,n)=>{const{parent:r,child:a}=n.payload,i=(r.children||[]).filter(u=>u.path!==a.path&&!a.error);return ct(e,{...r,children:[a,...i]})},setFolderChildren:(e,n)=>{const r=Tr(e,n.payload.parentPath);return r?ct(e,{...r,children:n.payload.children}):e}},extraReducers:e=>{e.addCase(Vs.pending,(n,r)=>{const{file:a,newname:i}=r.meta.arg,u=Tr(n,a.path);if(!u)return n;const c=a.path.split("/");c.pop();const f=`${c.join("/")}/${a.name}.${a.ext}`,p=`${c.join("/")}/${i}.${a.ext}`;switch(a.ext){case"4dm":case"4qs":Xa.next({action:ka.WILL_RENAME,payload:{oldPath:f,newPath:p}});break}return ct(n,{...u,flags:{...u.flags,loading:!0}})}),e.addCase(Vs.fulfilled,(n,r)=>{const{meta:{arg:{file:a}},payload:i}=r,u=Tr(n,a.path);if(!u)return n;switch(i.old.ext){case"4dm":case"4qs":Xa.next({action:ka.DID_RENAME,payload:{oldPath:i.old.path,newPath:i.new.path}});break}return ct(n,{...u,flags:{...u.flags,loading:!1}})}),e.addCase(Vs.rejected,(n,r)=>{const{file:a}=r.meta.arg,i=Tr(n,a.path);return i?ct(n,{...i,flags:{...i.flags,loading:!1}}):n}),e.addCase(Po.pending,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,flags:{...i.flags,loading:!0}}):n}),e.addCase(Po.fulfilled,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,children:i_(r.payload),flags:{...i.flags,loading:!1,cached:!0,expanded:!0},error:null}):n}),e.addCase(Po.rejected,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,error:{message:r.payload},flags:{...i.flags,loading:!1,cached:!0,expanded:!0}}):n}),e.addCase(zl.pending,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,flags:{...i.flags,loading:!0}}):n}),e.addCase(zl.fulfilled,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,children:i_(r.payload),flags:{...i.flags,loading:!1,cached:!0,expanded:!1},error:null}):n}),e.addCase(zl.rejected,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,error:{message:r.payload},flags:{...i.flags,loading:!1,cached:!0,expanded:!1}}):n}),e.addCase(qf.pending,(n,r)=>{const{fileName:a,parentNode:i,path:u,type:c}=r.meta.arg;return ct(n,{...i,children:[{name:a,path:`${u}/${a}`,type:c,error:null,flags:{loading:!0},config:{}},...i.children]})}),e.addCase(qf.fulfilled,(n,r)=>{const{path:a,fileName:i,type:u}=r.meta.arg,c=Ws(u),{editor:f,supportedEditors:p}=bo(`${a}${c?`.${c.toLowerCase()}`:""}`);return ct(n,{name:i,path:`${a}/${i}`,type:u,error:null,flags:{loading:!1},config:{editor:f,supportedEditors:p}})}),e.addCase(qf.rejected,(n,r)=>{const{path:a,fileName:i,type:u}=r.meta.arg;return ct(n,{name:i,path:`${a}/${i}`,type:u,error:{message:r.payload},flags:{loading:!1},config:{}})}),e.addCase(Vf.pending,(n,r)=>{const{node:a,parentNode:i}=r.meta.arg;return ct(n,{...i,children:[{name:`${a.name}_copy`,path:`${a.path}/${a.name}_copy`,type:a.type,error:null,flags:{loading:!0},permissions:{canRename:!0,canDelete:!0}},...i.children]})}),e.addCase(Vf.fulfilled,(n,r)=>{const{node:a}=r.payload,{node:{path:i,ext:u}}=r.meta.arg,{editor:c,supportedEditors:f}=bo(`${i}${u?`.${u.toLowerCase()}`:""}`);return ct(n,{name:`${a.name}`,path:`${i}/${a.name}`,type:a.type,error:null,flags:{loading:!1},config:{editor:c,supportedEditors:f}})}),e.addCase(Vf.rejected,(n,r)=>{const a=r.payload,{node:i}=r.meta.arg;return ct(n,{name:`${i.name}_copy`,path:`${i.path}/${i.name}_copy`,type:i.type,error:{message:a},flags:{loading:!1},config:{}})}),e.addCase(Gl.pending,(n,r)=>{}),e.addCase(Gl.fulfilled,(n,r)=>{var b;const{draggedNode:a,newLocation:i}=r.meta.arg,u=dx(a.path),c=Tr(n,u),f=Tr(n,i.path),p=(b=c==null?void 0:c.children)==null?void 0:b.filter(E=>E.path!==a.path),h=i.path.split("/").length,m=a.path.split("/").length;return h>=m?(n=ct(n,{...c,children:p}),n=ct(n,{...f,children:[{...a,path:`${f.path}/${a.name}`},...f!=null&&f.children?f==null?void 0:f.children:[]],flags:{...f.flags,expanded:!0}})):(n=ct(n,{...f,children:[{...a,path:`${f.path}/${a.name}`},...f!=null&&f.children?f==null?void 0:f.children:[]],flags:{...f.flags,expanded:!0}}),n=ct(n,{...c,children:p})),n}),e.addCase(Gl.rejected,(n,r)=>{Ao.next({message:"Error moving file",kind:"danger"})}),e.addCase(qs.pending,(n,r)=>{var C;const{fileName:a,parentNode:i,path:u,type:c,qodly:f}=r.meta.arg,p=Ws(c,f),h=`${u}/${a}${p?`.${p.toLowerCase()}`:""}`,{editor:m,supportedEditors:b}=bo(h);switch(c){case le.CLASS:case le.METHOD:Xa.next({action:ka.WILL_CREATE,payload:{filePath:h}});break}const E=(C=i.children)==null?void 0:C.filter(k=>k.path!==`${u}/${a}`),O=[{name:a,path:`${u}/${a}`,type:le.FILE,error:null,flags:{loading:!0},config:{editor:m,supportedEditors:b},ext:p,date:new Date().toISOString()},...E],R=ct(n,{...i,children:O});return FT.merge(n,R)}),e.addCase(qs.fulfilled,(n,r)=>{const{fileName:a,path:i,type:u,qodly:c}=r.meta.arg,f=Ws(u,c),p=`${i}/${a}${f?`.${f.toLowerCase()}`:""}`,{editor:h,supportedEditors:m}=bo(p),b=ct(n,{name:a,path:`${i}/${a}`,type:le.FILE,error:null,flags:{},config:{editor:h,supportedEditors:m},ext:f,date:new Date().toISOString()});switch(u){case le.CLASS:case le.METHOD:Xa.next({action:ka.DID_CREATE,payload:{filePath:p}});break}return n=b,n}),e.addCase(qs.rejected,(n,r)=>{const{fileName:a,path:i,type:u}=r.meta.arg,c=Ws(u),{editor:f,supportedEditors:p}=bo(`${i}${c?`.${c.toLowerCase()}`:""}`);return n=ct(n,{name:a,path:`${i}/${a}`,type:le.FILE,error:{message:"Failed creating file"},flags:{},config:{editor:f,supportedEditors:p},ext:c,date:new Date().toISOString()}),n}),e.addMatcher(iO(Hl),(n,r)=>{const a=Tr(n,r.meta.arg.file.path.split(".")[0]);return a&&(n=ct(n,{...a,flags:{...a.flags,loading:!0}})),n}),e.addMatcher(uO(Hl),(n,r)=>{const a=Tr(n,r.meta.arg.file.path.split(".")[0]);return a&&(n=ct(n,{...a,flags:{...a.flags,loading:!1}})),n}),e.addMatcher(sO(Hl),(n,r)=>{const a=Tr(n,r.meta.arg.file.path.split(".")[0]);return a&&(n=ct(n,{...a,flags:{...a.flags,loading:!1}})),Ao.next({message:"Failed to open file, try again",kind:"danger"}),n})}}),{toggleExpandFolder:g6,expandFolder:m6,openAddFileInput:y6,addNewFile:lC,refreshFile:b6,removeFile:s_,setFolderChildren:_6}=cC.actions;function fC(e){switch(e){case le.WEBFORMS:return Nx;case le.METHODS:return`//%attributes = {}
|
|
269
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function t_(e,n){if(e){var r=e.indexOf(n);0<=r&&e.splice(r,1)}}var Qd=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,r,a,i,u;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var f=e_(c),p=f.next();!p.done;p=f.next()){var h=p.value;h.remove(this)}}catch(C){n={error:C}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}else c.remove(this);var m=this.initialTeardown;if(ja(m))try{m()}catch(C){u=C instanceof s1?C.errors:[C]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var E=e_(b),O=E.next();!O.done;O=E.next()){var R=O.value;try{CS(R)}catch(C){u=u??[],C instanceof s1?u=bd(bd([],yd(u)),yd(C.errors)):u.push(C)}}}catch(C){a={error:C}}finally{try{O&&!O.done&&(i=E.return)&&i.call(E)}finally{if(a)throw a.error}}}if(u)throw new s1(u)}},e.prototype.add=function(n){var r;if(n&&n!==this)if(this.closed)CS(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(n)}},e.prototype._hasParent=function(n){var r=this._parentage;return r===n||Array.isArray(r)&&r.includes(n)},e.prototype._addParent=function(n){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(n),r):r?[r,n]:n},e.prototype._removeParent=function(n){var r=this._parentage;r===n?this._parentage=null:Array.isArray(r)&&t_(r,n)},e.prototype.remove=function(n){var r=this._finalizers;r&&t_(r,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}(),vx=Qd.EMPTY;function gx(e){return e instanceof Qd||e&&"closed"in e&&ja(e.remove)&&ja(e.add)&&ja(e.unsubscribe)}function CS(e){ja(e)?e():e.unsubscribe()}var mx={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},r_={setTimeout:function(e,n){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];var i=r_.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,bd([e,n],yd(r))):setTimeout.apply(void 0,bd([e,n],yd(r)))},clearTimeout:function(e){var n=r_.delegate;return((n==null?void 0:n.clearTimeout)||clearTimeout)(e)},delegate:void 0};function AL(e){r_.setTimeout(function(){throw e})}function RS(){}function Gf(e){e()}var yx=function(e){Zd(n,e);function n(r){var a=e.call(this)||this;return a.isStopped=!1,r?(a.destination=r,gx(r)&&r.add(a)):a.destination=ML,a}return n.create=function(r,a,i){return new n_(r,a,i)},n.prototype.next=function(r){this.isStopped||this._next(r)},n.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(r){this.destination.next(r)},n.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(Qd),PL=Function.prototype.bind;function u1(e,n){return PL.call(e,n)}var DL=function(){function e(n){this.partialObserver=n}return e.prototype.next=function(n){var r=this.partialObserver;if(r.next)try{r.next(n)}catch(a){Df(a)}},e.prototype.error=function(n){var r=this.partialObserver;if(r.error)try{r.error(n)}catch(a){Df(a)}else Df(n)},e.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(r){Df(r)}},e}(),n_=function(e){Zd(n,e);function n(r,a,i){var u=e.call(this)||this,c;if(ja(r)||!r)c={next:r??void 0,error:a??void 0,complete:i??void 0};else{var f;u&&mx.useDeprecatedNextContext?(f=Object.create(r),f.unsubscribe=function(){return u.unsubscribe()},c={next:r.next&&u1(r.next,f),error:r.error&&u1(r.error,f),complete:r.complete&&u1(r.complete,f)}):c=r}return u.destination=new DL(c),u}return n}(yx);function Df(e){AL(e)}function IL(e){throw e}var ML={closed:!0,next:RS,error:IL,complete:RS},kL=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $L(e){return e}function NL(e){return e.length===0?$L:e.length===1?e[0]:function(r){return e.reduce(function(a,i){return i(a)},r)}}var AS=function(){function e(n){n&&(this._subscribe=n)}return e.prototype.lift=function(n){var r=new e;return r.source=this,r.operator=n,r},e.prototype.subscribe=function(n,r,a){var i=this,u=LL(n)?n:new n_(n,r,a);return Gf(function(){var c=i,f=c.operator,p=c.source;u.add(f?f.call(u,p):p?i._subscribe(u):i._trySubscribe(u))}),u},e.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(r){n.error(r)}},e.prototype.forEach=function(n,r){var a=this;return r=PS(r),new r(function(i,u){var c=new n_({next:function(f){try{n(f)}catch(p){u(p),c.unsubscribe()}},error:u,complete:i});a.subscribe(c)})},e.prototype._subscribe=function(n){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(n)},e.prototype[kL]=function(){return this},e.prototype.pipe=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return NL(n)(this)},e.prototype.toPromise=function(n){var r=this;return n=PS(n),new n(function(a,i){var u;r.subscribe(function(c){return u=c},function(c){return i(c)},function(){return a(u)})})},e.create=function(n){return new e(n)},e}();function PS(e){var n;return(n=e??mx.Promise)!==null&&n!==void 0?n:Promise}function jL(e){return e&&ja(e.next)&&ja(e.error)&&ja(e.complete)}function LL(e){return e&&e instanceof yx||jL(e)&&gx(e)}var FL=hx(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),bx=function(e){Zd(n,e);function n(){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 n.prototype.lift=function(r){var a=new DS(this,this);return a.operator=r,a},n.prototype._throwIfClosed=function(){if(this.closed)throw new FL},n.prototype.next=function(r){var a=this;Gf(function(){var i,u;if(a._throwIfClosed(),!a.isStopped){a.currentObservers||(a.currentObservers=Array.from(a.observers));try{for(var c=e_(a.currentObservers),f=c.next();!f.done;f=c.next()){var p=f.value;p.next(r)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(i)throw i.error}}}})},n.prototype.error=function(r){var a=this;Gf(function(){if(a._throwIfClosed(),!a.isStopped){a.hasError=a.isStopped=!0,a.thrownError=r;for(var i=a.observers;i.length;)i.shift().error(r)}})},n.prototype.complete=function(){var r=this;Gf(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var a=r.observers;a.length;)a.shift().complete()}})},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},n.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},n.prototype._innerSubscribe=function(r){var a=this,i=this,u=i.hasError,c=i.isStopped,f=i.observers;return u||c?vx:(this.currentObservers=null,f.push(r),new Qd(function(){a.currentObservers=null,t_(f,r)}))},n.prototype._checkFinalizedStatuses=function(r){var a=this,i=a.hasError,u=a.thrownError,c=a.isStopped;i?r.error(u):c&&r.complete()},n.prototype.asObservable=function(){var r=new AS;return r.source=this,r},n.create=function(r,a){return new DS(r,a)},n}(AS),DS=function(e){Zd(n,e);function n(r,a){var i=e.call(this)||this;return i.destination=r,i.source=a,i}return n.prototype.next=function(r){var a,i;(i=(a=this.destination)===null||a===void 0?void 0:a.next)===null||i===void 0||i.call(a,r)},n.prototype.error=function(r){var a,i;(i=(a=this.destination)===null||a===void 0?void 0:a.error)===null||i===void 0||i.call(a,r)},n.prototype.complete=function(){var r,a;(a=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||a===void 0||a.call(r)},n.prototype._subscribe=function(r){var a,i;return(i=(a=this.source)===null||a===void 0?void 0:a.subscribe(r))!==null&&i!==void 0?i:vx},n}(bx);const _x=new bx,WL=()=>JT(),Ua=sL,J_=pe(e=>e,e=>e.catalog.state==="loaded"?e.catalog.model:null),BL=pe(J_,e=>e?e.dataClasses:[]),UL=pe(J_,e=>e?e.methods:[]),wx=e=>pe(n=>n,n=>{switch(n.catalog.state){case"loaded":const r=e?n.catalog.model.dataClasses[e]:n.catalog.model;return(r==null?void 0:r.methods)||[];default:return[]}}),zL=e=>Ua(wx(e),YT),HL=(e,n)=>pe(wx(e),r=>r.find(a=>`${a.applyTo}.${a.name}`===n)),GL=(e,n,r)=>Ua(HL(e,`${r}.${n}`),YT),Ex=pe(e=>e,e=>e),qL=e=>pe(za,n=>{var i;const r=n.tabs.find(({path:u})=>u===e),a=r==null?void 0:r.content.components;return!r||!a?[]:(i=Object.keys(a))==null?void 0:i.map(u=>({id:u,...a[u]}))}),Sx=e=>pe(za,n=>{var a,i;const r=n.tabs.find(({path:u})=>u===e);return((i=(a=r==null?void 0:r.content)==null?void 0:a.metadata)==null?void 0:i.datasources)||[]}),VL=(e,n,r)=>pe(Ex,a=>{var i,u;if(n){const c=a.sharedDatasources.sources[n];return c?c.find(f=>f.id===e):void 0}else{const c=a.root.tabs.find(p=>p.path===r);return c?(u=(i=c.content.metadata)==null?void 0:i.datasources)==null?void 0:u.find(p=>p.id===e):void 0}}),Ox=pe(e=>e,e=>{var n;return((n=e.sharedDatasources)==null?void 0:n.sources)||[]}),YL=(e,n,r,a)=>pe(Sx(e),Ox,(i,u)=>{const c=Bt.flatten(Bt.values(u)),f=[...n!=="private"?i:[],...n!=="shared"?c:[]];return r?f.filter(p=>(!a||a.every(({id:h,namespace:m=""})=>p.id!==h||(p.namespace||"")!==m))&&(r.includes(p.type)||p.dataType&&(r.includes(p.dataType)||r.includes("objectFromArray")&&p.dataType==="object"&&p.from))):f}),KL=pe(e=>e.debugger,e=>e.meta),Is=pe(e=>e.debugger,e=>e.list),En=pe(e=>e.debugger,e=>e.sessions),XL=pe(En,e=>e.length),Ps=(e,n,r,a)=>e.find(i=>i.filePath===n&&i.methodName===r&&(!a||i.className===a)),dr=(e,n)=>e.find(r=>r.threadId===n),Tx=(e,n)=>e.find(r=>r.tabPath===n),JL=(e,n)=>pe(Is,r=>{var a;return((a=Ps(r,e,n))==null?void 0:a.breakpoints.saved.locations)||[]}),ZL=(e,n)=>pe(Is,r=>{var a;return((a=Ps(r,e,n))==null?void 0:a.breakpoints.draft.locations)||[]}),QL=e=>pe(Is,n=>n.filter(r=>r.filePath===e).reduce((r,a)=>[...r,...a.breakpoints.saved.locations.map(i=>({...i,line:i.line+(a.breakpoints.saved.offset||0)}))],[]).sort((r,a)=>r.line-a.line)),e3=e=>pe(Is,n=>n.filter(r=>r.filePath===e).reduce((r,a)=>[...r,...a.breakpoints.draft.locations.map(i=>({...i,line:i.line+(a.breakpoints.draft.offset||0)}))],[]).sort((r,a)=>r.line-a.line)),t3=e=>pe(En,n=>{const r=dr(n,e);return r!=null&&r.stopped?r.highlightedLines:null}),r3=e=>pe(En,n=>{const r=dr(n,e);return r!=null&&r.stopped?r.activeLine:null}),n3=e=>pe(En,n=>{var r;return((r=dr(n,e))==null?void 0:r.expressions)||[]}),o3=e=>pe(En,n=>{var r;return((r=dr(n,e))==null?void 0:r.stopped)||!1}),a3=(e,n)=>pe(Is,r=>{var a;return(a=Ps(r,e,n))==null?void 0:a.source}),i3=e=>pe(En,n=>{var r;return((r=Tx(n,e))==null?void 0:r.threadId)||-1}),s3=e=>pe(En,n=>{var r,a;return(a=(r=dr(n,e))==null?void 0:r.currentStackFrame)==null?void 0:a.source}),u3=e=>pe(En,n=>{var r;return(r=dr(n,e))==null?void 0:r.currentStackFrame}),c3=pe(En,e=>e.map(({channelId:n,threadId:r})=>({id:n,threadId:r}))),l3=e=>pe(En,n=>{var r;return((r=dr(n,e))==null?void 0:r.stackFrames)||[]}),f3=e=>pe(En,n=>{var r,a;return((a=(r=dr(n,e))==null?void 0:r.variables)==null?void 0:a.callchain)||[]}),d3=e=>pe(En,n=>{var r,a;return((a=(r=dr(n,e))==null?void 0:r.variables)==null?void 0:a.expressions)||[]}),p3=(e,n="saved")=>pe(Is,r=>{const a=r.find(i=>i.filePath===e);return(a==null?void 0:a.breakpoints[n].offset)||0}),h3=(e,n,r,a)=>pe(En,i=>{var h;const u=((h=dr(i,e))==null?void 0:h.exceptions)||[],c=n===le.CLASS,f=c&&a?`${a}.${r}`:r;return(f?u.filter(m=>m.location===f):u).map(m=>({...m,locationLine:c?m.locationLine:m.locationLine+1}))}),za=pe(e=>e.root,e=>e),cu=pe(za,e=>e.tabs),v3=pe(za,e=>e.activeTab),g3=pe(za,e=>e.recent.filter(({type:n})=>n!==le.DEBUGGER)),m3=pe(za,({tabs:e,activeTab:n})=>e.find(({path:r})=>r===n)),y3=pe(za,({tabs:e})=>e.reduce((r,a)=>(a==null?void 0:a.weight)>((r==null?void 0:r.weight)||0)?a:r,null)),b3=pe(cu,e=>e.filter(({type:n,flags:r})=>n===le.WEBFORM&&r.enabled===!1).map(({path:n})=>n)),_3=pe(cu,e=>e.length>0),gf=e=>pe(za,n=>n.tabs.find(({path:r})=>r===e)),xx=(e,n="")=>pe(gf(e),r=>!r||!r.content||typeof r.content=="string"?r==null?void 0:r.content:Bt.get(r.content,n)),w3=e=>pe(gf(e),n=>n==null?void 0:n.extra),E3=(e,n=r=>r)=>pe(xx(e,"components"),r=>n(r||{})),Z_=pe(cu,e=>e.filter(n=>n.flags.touched)),S3=pe(Z_,e=>e.length),O3=pe(En,e=>e.map(({threadId:n,currentStackFrame:{source:r},tabPath:a})=>({name:WT(n,r),path:a,type:le.DEBUGGER,content:r==null?void 0:r.content,flags:{},extra:{source:r}}))),T3=pe(e=>e,e=>e.explorer||[]),Cx=pe(e=>e,e=>e.explorer.find(n=>n.path===Wt.WEBFORMS)),Rx=pe(e=>e,e=>e.explorer.find(n=>n.path===Wt.METHODS)),Ax=pe(e=>e,e=>e.explorer.find(n=>n.path===Wt.CLASSES)),x3=pe(Rx,e=>(e==null?void 0:e.children)||[]),C3=pe(Cx,e=>(e==null?void 0:e.children)||[]),R3=pe(Ax,e=>(e==null?void 0:e.children)||[]),A3=pe(e=>e.modals,e=>e.list),P3=pe(e=>e.roles,({roles:e})=>e),D3=pe(e=>e.roles,({privileges:e})=>e),I3=pe(e=>e.roles,({privileges:e})=>Object.values(e).find(({privilege:n})=>n==="guest")),M3=pe(e=>e.roles,({flags:e})=>e),k3=pe(e=>e.roles,({selectedTab:e})=>e),$3=pe(e=>e.roles,({date:e})=>e),Px=pe(e=>e.settings,e=>e.session),N3=pe(e=>e.settings,e=>e.project),j3=pe(e=>e.settings,e=>e),Q_=pe(e=>e.settings,e=>e.server),L3=pe(Q_,e=>e.remoteDebuggerMode),F3=pe(Q_,e=>e.qodly),W3=pe(Px,e=>e["monaco.zoom"]),Dx=["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"],Ix=Dx.map(e=>({id:y_(),content:"",name:e,parentId:null,scope:As.THEME})),ew=e=>pe(gf(e),n=>{var r,a;return((a=(r=n==null?void 0:n.content)==null?void 0:r.metadata)==null?void 0:a.styles)||[]}),B3=(e,n)=>pe(ew(e),r=>n.map(a=>{switch(!0){case a===As.LOCAL:return r.map(i=>({...i,scope:As.LOCAL}));case a===As.THEME:return Ix;default:return[]}}).flat()),U3=e=>pe(ew(e),n=>[...n.map(r=>({...r,scope:As.LOCAL})),...Ix]),z3=pe(e=>e,e=>{var n;return[...(((n=e.sharedCSS)==null?void 0:n.styles)||[]).map(r=>({...r,scope:As.SHARED}))]}),H3=e=>pe(gf(e),n=>n==null?void 0:n.flags),mf=pe(e=>e.webforms,e=>e),Mx=pe(mf,e=>(e==null?void 0:e.components)||[]),ep=pe(mf,e=>e.inspector),G3=pe(ep,e=>e.css),q3=pe(ep,e=>e.datasource),kx=pe(mf,e=>e.templates||{data:[]}),V3=pe(kx,e=>e.data||[]),Y3=e=>pe(Mx,n=>n.find(r=>r.id===e)),K3=e=>pe(ep,n=>n[e]),X3=pe(mf,e=>e.datasources.theme),J3=pe(e=>e.catalog,e=>e.sharedDatasources,e=>e.sharedCSS,(e,n,r)=>[e.state,n.state,r.state].every(a=>["loaded","error"].includes(a)));var tw=(e=>(e.SHOW_AFTER_TIMEOUT="show_after_timeout",e.HIDE_AFTER_TIMEOUT="hide_after_timeout",e))(tw||{}),$x=(e=>(e.AIRY="airy",e.COMPACT="neutral",e))($x||{});const Nx={metadata:{v:"1.0",datasources:[],styles:[]},components:{ROOT:{parent:"",type:{resolvedName:"Container"},isCanvas:!0,props:{className:"bg-white h-full w-full px-6",classNames:[],events:[],airyMode:!1},displayName:"App",custom:{},hidden:!1,nodes:[],linkedNodes:{}}}};var If,Z3=new Uint8Array(16);function jx(){if(!If&&(If=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!If))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return If(Z3)}const Q3=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function tp(e){return typeof e=="string"&&Q3.test(e)}var Fr=[];for(var c1=0;c1<256;++c1)Fr.push((c1+256).toString(16).substr(1));function rp(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(Fr[e[n+0]]+Fr[e[n+1]]+Fr[e[n+2]]+Fr[e[n+3]]+"-"+Fr[e[n+4]]+Fr[e[n+5]]+"-"+Fr[e[n+6]]+Fr[e[n+7]]+"-"+Fr[e[n+8]]+Fr[e[n+9]]+"-"+Fr[e[n+10]]+Fr[e[n+11]]+Fr[e[n+12]]+Fr[e[n+13]]+Fr[e[n+14]]+Fr[e[n+15]]).toLowerCase();if(!tp(r))throw TypeError("Stringified UUID is invalid");return r}var IS,l1,f1=0,d1=0;function e4(e,n,r){var a=n&&r||0,i=n||new Array(16);e=e||{};var u=e.node||IS,c=e.clockseq!==void 0?e.clockseq:l1;if(u==null||c==null){var f=e.random||(e.rng||jx)();u==null&&(u=IS=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),c==null&&(c=l1=(f[6]<<8|f[7])&16383)}var p=e.msecs!==void 0?e.msecs:Date.now(),h=e.nsecs!==void 0?e.nsecs:d1+1,m=p-f1+(h-d1)/1e4;if(m<0&&e.clockseq===void 0&&(c=c+1&16383),(m<0||p>f1)&&e.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f1=p,d1=h,l1=c,p+=122192928e5;var b=((p&268435455)*1e4+h)%4294967296;i[a++]=b>>>24&255,i[a++]=b>>>16&255,i[a++]=b>>>8&255,i[a++]=b&255;var E=p/4294967296*1e4&268435455;i[a++]=E>>>8&255,i[a++]=E&255,i[a++]=E>>>24&15|16,i[a++]=E>>>16&255,i[a++]=c>>>8|128,i[a++]=c&255;for(var O=0;O<6;++O)i[a+O]=u[O];return n||rp(i)}function Lx(e){if(!tp(e))throw TypeError("Invalid UUID");var n,r=new Uint8Array(16);return r[0]=(n=parseInt(e.slice(0,8),16))>>>24,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=n&255,r[4]=(n=parseInt(e.slice(9,13),16))>>>8,r[5]=n&255,r[6]=(n=parseInt(e.slice(14,18),16))>>>8,r[7]=n&255,r[8]=(n=parseInt(e.slice(19,23),16))>>>8,r[9]=n&255,r[10]=(n=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=n/4294967296&255,r[12]=n>>>24&255,r[13]=n>>>16&255,r[14]=n>>>8&255,r[15]=n&255,r}function t4(e){e=unescape(encodeURIComponent(e));for(var n=[],r=0;r<e.length;++r)n.push(e.charCodeAt(r));return n}var r4="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n4="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Fx(e,n,r){function a(i,u,c,f){if(typeof i=="string"&&(i=t4(i)),typeof u=="string"&&(u=Lx(u)),u.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var p=new Uint8Array(16+i.length);if(p.set(u),p.set(i,u.length),p=r(p),p[6]=p[6]&15|n,p[8]=p[8]&63|128,c){f=f||0;for(var h=0;h<16;++h)c[f+h]=p[h];return c}return rp(p)}try{a.name=e}catch{}return a.DNS=r4,a.URL=n4,a}function o4(e){if(typeof e=="string"){var n=unescape(encodeURIComponent(e));e=new Uint8Array(n.length);for(var r=0;r<n.length;++r)e[r]=n.charCodeAt(r)}return a4(i4(s4(e),e.length*8))}function a4(e){for(var n=[],r=e.length*32,a="0123456789abcdef",i=0;i<r;i+=8){var u=e[i>>5]>>>i%32&255,c=parseInt(a.charAt(u>>>4&15)+a.charAt(u&15),16);n.push(c)}return n}function Wx(e){return(e+64>>>9<<4)+14+1}function i4(e,n){e[n>>5]|=128<<n%32,e[Wx(n)-1]=n;for(var r=1732584193,a=-271733879,i=-1732584194,u=271733878,c=0;c<e.length;c+=16){var f=r,p=a,h=i,m=u;r=Vr(r,a,i,u,e[c],7,-680876936),u=Vr(u,r,a,i,e[c+1],12,-389564586),i=Vr(i,u,r,a,e[c+2],17,606105819),a=Vr(a,i,u,r,e[c+3],22,-1044525330),r=Vr(r,a,i,u,e[c+4],7,-176418897),u=Vr(u,r,a,i,e[c+5],12,1200080426),i=Vr(i,u,r,a,e[c+6],17,-1473231341),a=Vr(a,i,u,r,e[c+7],22,-45705983),r=Vr(r,a,i,u,e[c+8],7,1770035416),u=Vr(u,r,a,i,e[c+9],12,-1958414417),i=Vr(i,u,r,a,e[c+10],17,-42063),a=Vr(a,i,u,r,e[c+11],22,-1990404162),r=Vr(r,a,i,u,e[c+12],7,1804603682),u=Vr(u,r,a,i,e[c+13],12,-40341101),i=Vr(i,u,r,a,e[c+14],17,-1502002290),a=Vr(a,i,u,r,e[c+15],22,1236535329),r=Yr(r,a,i,u,e[c+1],5,-165796510),u=Yr(u,r,a,i,e[c+6],9,-1069501632),i=Yr(i,u,r,a,e[c+11],14,643717713),a=Yr(a,i,u,r,e[c],20,-373897302),r=Yr(r,a,i,u,e[c+5],5,-701558691),u=Yr(u,r,a,i,e[c+10],9,38016083),i=Yr(i,u,r,a,e[c+15],14,-660478335),a=Yr(a,i,u,r,e[c+4],20,-405537848),r=Yr(r,a,i,u,e[c+9],5,568446438),u=Yr(u,r,a,i,e[c+14],9,-1019803690),i=Yr(i,u,r,a,e[c+3],14,-187363961),a=Yr(a,i,u,r,e[c+8],20,1163531501),r=Yr(r,a,i,u,e[c+13],5,-1444681467),u=Yr(u,r,a,i,e[c+2],9,-51403784),i=Yr(i,u,r,a,e[c+7],14,1735328473),a=Yr(a,i,u,r,e[c+12],20,-1926607734),r=Kr(r,a,i,u,e[c+5],4,-378558),u=Kr(u,r,a,i,e[c+8],11,-2022574463),i=Kr(i,u,r,a,e[c+11],16,1839030562),a=Kr(a,i,u,r,e[c+14],23,-35309556),r=Kr(r,a,i,u,e[c+1],4,-1530992060),u=Kr(u,r,a,i,e[c+4],11,1272893353),i=Kr(i,u,r,a,e[c+7],16,-155497632),a=Kr(a,i,u,r,e[c+10],23,-1094730640),r=Kr(r,a,i,u,e[c+13],4,681279174),u=Kr(u,r,a,i,e[c],11,-358537222),i=Kr(i,u,r,a,e[c+3],16,-722521979),a=Kr(a,i,u,r,e[c+6],23,76029189),r=Kr(r,a,i,u,e[c+9],4,-640364487),u=Kr(u,r,a,i,e[c+12],11,-421815835),i=Kr(i,u,r,a,e[c+15],16,530742520),a=Kr(a,i,u,r,e[c+2],23,-995338651),r=Xr(r,a,i,u,e[c],6,-198630844),u=Xr(u,r,a,i,e[c+7],10,1126891415),i=Xr(i,u,r,a,e[c+14],15,-1416354905),a=Xr(a,i,u,r,e[c+5],21,-57434055),r=Xr(r,a,i,u,e[c+12],6,1700485571),u=Xr(u,r,a,i,e[c+3],10,-1894986606),i=Xr(i,u,r,a,e[c+10],15,-1051523),a=Xr(a,i,u,r,e[c+1],21,-2054922799),r=Xr(r,a,i,u,e[c+8],6,1873313359),u=Xr(u,r,a,i,e[c+15],10,-30611744),i=Xr(i,u,r,a,e[c+6],15,-1560198380),a=Xr(a,i,u,r,e[c+13],21,1309151649),r=Xr(r,a,i,u,e[c+4],6,-145523070),u=Xr(u,r,a,i,e[c+11],10,-1120210379),i=Xr(i,u,r,a,e[c+2],15,718787259),a=Xr(a,i,u,r,e[c+9],21,-343485551),r=Ja(r,f),a=Ja(a,p),i=Ja(i,h),u=Ja(u,m)}return[r,a,i,u]}function s4(e){if(e.length===0)return[];for(var n=e.length*8,r=new Uint32Array(Wx(n)),a=0;a<n;a+=8)r[a>>5]|=(e[a/8]&255)<<a%32;return r}function Ja(e,n){var r=(e&65535)+(n&65535),a=(e>>16)+(n>>16)+(r>>16);return a<<16|r&65535}function u4(e,n){return e<<n|e>>>32-n}function np(e,n,r,a,i,u){return Ja(u4(Ja(Ja(n,e),Ja(a,u)),i),r)}function Vr(e,n,r,a,i,u,c){return np(n&r|~n&a,e,n,i,u,c)}function Yr(e,n,r,a,i,u,c){return np(n&a|r&~a,e,n,i,u,c)}function Kr(e,n,r,a,i,u,c){return np(n^r^a,e,n,i,u,c)}function Xr(e,n,r,a,i,u,c){return np(r^(n|~a),e,n,i,u,c)}var c4=Fx("v3",48,o4);const l4=c4;function f4(e,n,r){e=e||{};var a=e.random||(e.rng||jx)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,n){r=r||0;for(var i=0;i<16;++i)n[r+i]=a[i];return n}return rp(a)}function d4(e,n,r,a){switch(e){case 0:return n&r^~n&a;case 1:return n^r^a;case 2:return n&r^n&a^r&a;case 3:return n^r^a}}function p1(e,n){return e<<n|e>>>32-n}function p4(e){var n=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var a=unescape(encodeURIComponent(e));e=[];for(var i=0;i<a.length;++i)e.push(a.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var u=e.length/4+2,c=Math.ceil(u/16),f=new Array(c),p=0;p<c;++p){for(var h=new Uint32Array(16),m=0;m<16;++m)h[m]=e[p*64+m*4]<<24|e[p*64+m*4+1]<<16|e[p*64+m*4+2]<<8|e[p*64+m*4+3];f[p]=h}f[c-1][14]=(e.length-1)*8/Math.pow(2,32),f[c-1][14]=Math.floor(f[c-1][14]),f[c-1][15]=(e.length-1)*8&4294967295;for(var b=0;b<c;++b){for(var E=new Uint32Array(80),O=0;O<16;++O)E[O]=f[b][O];for(var R=16;R<80;++R)E[R]=p1(E[R-3]^E[R-8]^E[R-14]^E[R-16],1);for(var C=r[0],k=r[1],j=r[2],F=r[3],D=r[4],M=0;M<80;++M){var S=Math.floor(M/20),q=p1(C,5)+d4(S,k,j,F)+D+n[S]+E[M]>>>0;D=F,F=j,j=p1(k,30)>>>0,k=C,C=q}r[0]=r[0]+C>>>0,r[1]=r[1]+k>>>0,r[2]=r[2]+j>>>0,r[3]=r[3]+F>>>0,r[4]=r[4]+D>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var h4=Fx("v5",80,p4);const v4=h4,g4="00000000-0000-0000-0000-000000000000";function m4(e){if(!tp(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}const y4=Object.freeze(Object.defineProperty({__proto__:null,NIL:g4,parse:Lx,stringify:rp,v1:e4,v3:l4,v4:f4,v5:v4,validate:tp,version:m4},Symbol.toStringTag,{value:"Module"})),b4=cA(y4);function rw(e,n){if(!e||!n||!e.length||!n.length)throw new Error("Bad alphabet");this.srcAlphabet=e,this.dstAlphabet=n}rw.prototype.convert=function(e){var n,r,a,i={},u=this.srcAlphabet.length,c=this.dstAlphabet.length,f=e.length,p=typeof e=="string"?"":[];if(!this.isValid(e))throw new Error('Number "'+e+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return e;for(n=0;n<f;n++)i[n]=this.srcAlphabet.indexOf(e[n]);do{for(r=0,a=0,n=0;n<f;n++)r=r*u+i[n],r>=c?(i[a++]=parseInt(r/c,10),r=r%c):a>0&&(i[a++]=0);f=a,p=this.dstAlphabet.slice(r,r+1).concat(p)}while(a!==0);return p};rw.prototype.isValid=function(e){for(var n=0;n<e.length;++n)if(this.srcAlphabet.indexOf(e[n])===-1)return!1;return!0};var _4=rw,w4=_4;function yf(e,n){var r=new w4(e,n);return function(a){return r.convert(a)}}yf.BIN="01";yf.OCT="01234567";yf.DEC="0123456789";yf.HEX="0123456789abcdef";var E4=yf;const{v4:h1}=b4,Mf=E4,v1="123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",S4="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",O4={consistentLength:!0};let g1;const MS=(e,n,r)=>{const a=n(e.toLowerCase().replace(/-/g,""));return!r||!r.consistentLength?a:a.padStart(r.shortIdLength,r.paddingChar)},T4=(e,n)=>{const a=n(e).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[a[1],a[2],a[3],a[4],a[5]].join("-")},x4=e=>Math.ceil(Math.log(2**128)/Math.log(e));var _d=(()=>{const e=(n,r)=>{const a=n||v1,i={...O4,...r};if([...new Set(Array.from(a))].length!==a.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const u=x4(a.length),c={shortIdLength:u,consistentLength:i.consistentLength,paddingChar:a[0]},f=Mf(Mf.HEX,a),p=Mf(a,Mf.HEX),h=()=>MS(h1(),f,c),m={new:h,generate:h,uuid:h1,fromUUID:b=>MS(b,f,c),toUUID:b=>T4(b,p),alphabet:a,maxLength:u};return Object.freeze(m),m};return e.constants={flickrBase58:v1,cookieBase90:S4},e.uuid=h1,e.generate=()=>(g1||(g1=e(v1).generate),g1()),e})(),gt=(e=>(e.DATACLASS="dataclass",e.METHOD="method",e.ATTRIBUTE="attribute",e.DATASTORE="datastore",e))(gt||{});const C4=[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE,gt.METHOD],wd="guest",nw=[{key:"read",label:"Read",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"create",label:"Create",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"update",label:"Update",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"drop",label:"Delete",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE]},{key:"describe",label:"Describe",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.ATTRIBUTE,gt.METHOD]},{key:"execute",label:"Execute",canApplyTo:[gt.DATASTORE,gt.DATACLASS,gt.METHOD]},{key:"promote",label:"Promote",canApplyTo:[gt.METHOD]}];function Gn(e,...n){return Array.from(new Set([...e,...n]))}function Bx(e){const n={},r=new Map;e.forEach(p=>{const h=p.id||_d.generate();n[h]={...p,id:h,parents:[],includes:Gn(p.includes||[]),resources:[]},r.set(p.privilege,h)}),Object.entries(n).forEach(([p,h])=>{const m=h.includes.map(b=>{const E=r.get(b);return E?(n[E].parents=Gn(n[E].parents,E),E):""}).filter(Boolean);n[p]={...h,includes:m}});const a=Ux(n),i=new Set;function u(p){i.add(p.id),p.includes=p.includes.filter(h=>!i.has(h))}if(a.forEach(u),a.forEach(p=>p.parents=[]),a.forEach(p=>{p.includes.forEach(h=>n[h].parents.push(p.id))}),Object.values(n).find(({privilege:p})=>p===wd))return n;const f=_d.generate();return{[f]:{id:f,privilege:wd,includes:[],parents:[],resources:[]},...n}}function Ux(e){return Object.values(e).sort((n,r)=>n.parents.length-r.parents.length)}function op(e,n){const r=n[e];let a=[];return r&&r.parents.forEach(i=>{a=Gn(a,...op(i,n),i)}),a}function Ed(e,n){const r=n[e];let a=[];return r&&r.includes.forEach(i=>{a=Gn(a,...Ed(i,n),i)}),a}function R4(e,n){const r=n[e];if(!r)return[];const a=[e,...op(e,n),...r.includes];return Object.keys(n).filter(i=>!a.includes(i))}function A4(e,n){return n[e]?Object.keys(n).reduce((a,i)=>i===e?a:{...a,[i]:{...n[i],parents:n[i].parents.filter(u=>u!==e),includes:n[i].includes.filter(u=>u!==e)}},{}):n}function P4(e,n,r){const a=r[e],i=r[n];return!a||!i?r:{...r,[e]:{...r[e],includes:Gn(a.includes,n)},[n]:{...r[n],parents:Gn(i.parents,e)}}}function D4(e,n,r){const a=r[e],i=r[n];return!a||!i?r:{...r,[e]:{...r[e],includes:r[e].includes.filter(u=>u!==n)},[n]:{...r[n],parents:r[n].parents.filter(u=>u!==e)}}}function zx(e,n){vT(e),Object.entries(n).forEach(([,{privilege:a}])=>{if(e.toLowerCase()===a.toLowerCase())throw new Error(`There's already a Privilege with the name ${e}`)});const r=_d.generate();return{[r]:{id:r,privilege:e,includes:[],parents:[],resources:[]},...n}}function I4(e,n,r,a,i){let u=zx(e,i);const c=Object.entries(u).find(([,f])=>f.privilege===e);return c?(u=Vx(c[1].id,n,r,a,u),u):i}function M4(e,n,r){if(!e)throw new Error("Please enter a name");if(!r[n])throw new Error("Invalid privilege");return Object.entries(r).forEach(([,{privilege:a,id:i}])=>{if(e.toLowerCase()===a.toLowerCase()&&n!==i)throw new Error(`There's already a Privilege with the name ${e}`)}),{...r,[n]:{...r[n],privilege:e}}}function k4(e,n){return e.map(r=>Ha(r,n))}function Ha(e,n){return n[e]?n[e]:null}function Hx({applyTo:e,type:n,...r}){return Object.entries(r).reduce((a,[i,u])=>{const c=Bt.find(nw,["key",i]);return!c||!c.canApplyTo.includes(n)||(typeof u=="string"?u.split(","):u).forEach(p=>{a[p]=Gn(a[p]||[],i)}),a},{})}const o_=(e,n=!1)=>["read","create","update","delete"].includes(e.toLowerCase())?`All ${n?"dataclasses and ":""}attributes have the '${e.toLowerCase()}' permission`:e.toLowerCase()==="execute"?`All functions defined ${n?"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 ${n?"dataclasses, ":""}attributes and functions have the '${e.toLowerCase()}' permission`;function ow(e){return{permissions:nw.filter(({canApplyTo:n})=>n.includes(e.type)).map(({key:n,label:r})=>{const a={name:n,from:[]};switch(e.type){case gt.DATASTORE:return{...a,info:o_(r,!0)};case gt.DATACLASS:return{...a,info:o_(r)};default:return a}}),resource:e.applyTo,type:e.type}}function Gx(e,n){const r=qx(n),a={};return e.filter(({type:i})=>C4.includes(i)).forEach(i=>{const u=Hx(i);Object.entries(u).forEach(([c,f])=>{var m;const p=(m=r[c])==null?void 0:m.id;if(!p)return;a[p]=a[p]||{...n[p]};let h=Bt.find(a[p].resources,{resource:i.applyTo,type:i.type});h||(h=ow(i),a[p].resources.push(h)),h.permissions=h.permissions.map(b=>({...b,checked:b.checked||f.includes(b.name)}))})}),{...n,...a}}function qx(e){return Object.values(e).reduce((n,r)=>({...n,[r.privilege]:r}),{})}function ap(e){var r;const n=Bx(e.privileges||[]);return{privileges:Gx(((r=e.permissions)==null?void 0:r.allowed)||[],n),roles:(e.roles||[]).map(({id:a=_d.generate(),role:i,privileges:u=[]})=>({id:a,role:i,privileges:Gn(u).map(c=>{var f;return(f=Object.values(n).find(({privilege:p})=>p===c))==null?void 0:f.id}).filter(Boolean)})).reduce((a,i)=>({...a,[i.id]:{...i}}),{})}}function aw(e){const n=Object.values(e.privileges).filter(({includes:a})=>a.length===0).map(({id:a})=>a),r=[...n,...n.map(a=>op(a,e.privileges).reverse())].flat().filter((a,i,u)=>u.indexOf(a)===i).map(a=>e.privileges[a]);return{permissions:{allowed:Object.values(e.privileges).reduce((a,i)=>(i.resources.forEach(({permissions:u,resource:c,type:f})=>{let p=Bt.find(a,{applyTo:c,type:f});p||(p={applyTo:c,type:f},a.push(p)),u.forEach(({name:h,checked:m})=>{m&&p&&(p[h]=p[h]||[],p[h].push(i.privilege))})}),a),[])},privileges:r.filter(({privilege:a})=>a!==wd).map(({id:a,includes:i,privilege:u})=>({id:a,privilege:u,includes:i.map(c=>e.privileges[c].privilege)})),roles:Object.values(e.roles).map(a=>({...a,privileges:a.privileges.map(i=>{var u;return(u=e.privileges[i])==null?void 0:u.privilege}).filter(Boolean)}))}}function $4(e,n){const r=n[e],a={children:[],links:[],parents:[],selected:e};if(!r)return a;function i(f,p,h=[]){const m=f.reduce((b,E)=>[...b,...n[E][p]],[]);return m.length===0?h:(h.push(m),i(m,p,h))}function u(f){const p=[],h=[];for(let m=f.length-1;m>=0;m-=1){const b=f[m].filter(E=>p.includes(E)?!1:(p.push(E),!0));b.length>0&&h.unshift(Gn(b))}return h}function c(f,p){const h=[];return f.reduce((m,b)=>(b.forEach(E=>{n[E][p==="parents"?"includes":"parents"].forEach(R=>{h.includes(R)&&m.push(p==="parents"?{source:E,target:R}:{source:R,target:E})}),h.push(E)}),m),[])}return a.children=i([e],"includes"),a.children=u(a.children),a.parents=i([e],"parents"),a.parents=u(a.parents),a.links=[...c([[e],...a.parents],"parents"),...c([[e],...a.children],"includes")],a}function N4(e,n,r){const a=Ha(e,r);if(!a||Bt.find(a.resources,{resource:n.applyTo,type:n.type}))return r;const i={...a,resources:[...a.resources,ow(n)]};return{...r,[e]:i}}function j4(e,n,r){const a=Ha(e,r);if(!a)return r;const i={...a,resources:a.resources.filter(({resource:u,type:c})=>u!==n.applyTo||c!==n.type)};return{...r,[e]:i}}function L4(e,n){const r=Ha(e,n);if(!r)return n;const a={...r,resources:r.resources.filter(i=>i.permissions.some(u=>u.from.length)).map(i=>({...i,permissions:i.permissions.map(u=>({...u,checked:!1}))}))};return{...n,[e]:a}}function Vx(e,n,r,a,i){const u=Ha(e,i);if(!u)return i;const f=Bt.find(u.resources,{type:r,resource:n})?{...u,resources:u.resources.map(p=>p.type===r&&p.resource===n?{...p,permissions:p.permissions.map(h=>h.name===a?{...h,checked:!h.checked,from:[]}:h)}:p)}:{...u,resources:[...u.resources,{type:r,resource:n,permissions:nw.filter(p=>p.canApplyTo.includes(r)).map(p=>({from:[],name:p.key,checked:p.key===a,info:o_(p.key,r===gt.DATASTORE)}))}]};return{...i,[e]:f}}function F4(e,n,r,a){const i=Ha(e,a);if(!i)return a;const c=Bt.find(i.resources,{type:n.type,resource:n.resource})?{...i,resources:i.resources.map(f=>f.type===n.type&&f.resource===n.resource?{...f,permissions:n.permissions.map(p=>p.name===r.name?{...p,checked:!p.checked,from:[]}:p)}:f)}:{...i,resources:[...i.resources,{...n,permissions:n.permissions.map(f=>({...f,checked:r.name===f.name,from:[]}))}]};return{...a,[e]:c}}function W4(e,n){var p;const r=Yx(e,n)||[],a=((p=Ha(e,n))==null?void 0:p.resources)||[],c=([...r,...a].filter(({type:h})=>h===gt.METHOD)||[]).map(({resource:h})=>h);return Object.entries(n).reduce((h,[m,{resources:b}])=>(b.filter(({resource:E,type:O})=>O===gt.METHOD&&c.includes(E)).forEach(({permissions:E,resource:O})=>{var C;((C=E.find(({name:k})=>k==="promote"))==null?void 0:C.checked)&&(h[O]=Gn(h[O]||[],m))}),h),{})}function Yx(e,n){var c;const r=Ha(e,n);if(!r)return[];const a=(c=Object.values(n).find(f=>f.privilege===wd))==null?void 0:c.id;return(a&&a!==e?Gn(Ed(e,n),a):Ed(e,n)).reduce((f,p)=>(n[p].resources.forEach(m=>{if(m.permissions.filter(({checked:O})=>O).length===0)return;const E=Bt.find(f,{type:m.type,resource:m.resource});if(!E){f.push({...m,permissions:m.permissions.map(O=>({...O,from:O.checked?[p]:[],checked:!1}))});return}E.permissions=E.permissions.map((O,R)=>{let{from:C=[]}=O;return m.permissions[R].checked&&!C.includes(p)&&(C=[...C,p]),{...O,from:C,checked:O.checked}})}),f),Bt.clone(r.resources.map(f=>({...f,permissions:f.permissions.map(({checked:p,...h})=>({...h,checked:!!p}))}))))}const B4=e=>e.reduce((n,r)=>({...n,[r.id]:{...r}}),{}),U4=(e,n)=>n[e]?Object.values(n).reduce((r,a)=>e===a.id||a.role===""?r:{...r,[a.id]:a},{}):n,z4=(e,n,r)=>r[e]?Object.values(r).reduce((a,i)=>e===i.id?{...a,[i.id]:{...i,name:n}}:{...a,[i.id]:i},{}):r,H4=(e,n)=>{const r={id:e,role:"",privileges:[]};return{...n,[r.id]:r}},G4=(e,n)=>{if(vT(e.role),Object.values(n).find(a=>a.role===e.role))throw new Error(`a role with the name ${e.role} already exists`);return Object.values(n).reduce((a,i)=>e.id===i.id?{...a,[e.id]:e}:{...a,[i.id]:i},{})},q4={list:[]},kS=(e,n)=>e.list.filter(r=>r.id!==n),Kx=qn({name:"modals",initialState:q4,reducers:{createModal:(e,n)=>{e.list.push(n.payload)},editModal:(e,n)=>{const{id:r,...a}=n.payload,i=e.list.find(QM(r));i&&Object.assign(i,{...a})},removeModal:(e,n)=>{const r=n.payload;e.list=kS(e,r)},closeModal:(e,n)=>{const{id:r,reason:a}=n.payload;if(a){const i=e.list.find(u=>u.id===r);i&&(i.closeReason=a,i.isOpen=!1)}else e.list=kS(e,r)}}}),{createModal:Xx,removeModal:Jx,closeModal:V4,editModal:Y4}=Kx.actions;var Zx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$S=ie.createContext&&ie.createContext(Zx),ei=globalThis&&globalThis.__assign||function(){return ei=Object.assign||function(e){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ei.apply(this,arguments)},K4=globalThis&&globalThis.__rest||function(e,n){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)n.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]]);return r};function Qx(e){return e&&e.map(function(n,r){return ie.createElement(n.tag,ei({key:r},n.attr),Qx(n.child))})}function ip(e){return function(n){return ie.createElement(X4,ei({attr:ei({},e.attr)},n),Qx(e.child))}}function X4(e){var n=function(r){var a=e.attr,i=e.size,u=e.title,c=K4(e,["attr","size","title"]),f=i||r.size||"1em",p;return r.className&&(p=r.className),e.className&&(p=(p?p+" ":"")+e.className),ie.createElement("svg",ei({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,c,{className:p,style:ei(ei({color:e.color||r.color},r.style),e.style),height:f,width:f,xmlns:"http://www.w3.org/2000/svg"}),u&&ie.createElement("title",null,u),e.children)};return $S!==void 0?ie.createElement($S.Consumer,null,function(r){return n(r)}):n(Zx)}function J4(e){return ip({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function Z4(e){return ip({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"}}]})(e)}function Q4(e){return ip({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z"}},{tag:"path",attr:{d:"M11 7h2v7h-2zm0 8h2v2h-2z"}}]})(e)}function e6(e){return ip({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"}}]})(e)}const t6={FaSave:J4,AiFillWarning:e6,BiErrorCircle:Q4,BsFillInfoCircleFill:Z4};var Hn=(e=>(e.ALERT="alert",e.CONFIRM="confirm",e))(Hn||{}),Ga=(e=>(e.PRIMARY="primary",e.WARNING="warning",e.DANGER="danger",e))(Ga||{}),iw=(e=>(e.CONFIRMED="confirmed",e.CANCELED="canceled",e))(iw||{});const Eo=xe("modals/open",async(e,{dispatch:n})=>{const{type:r=Hn.ALERT}=e,a=y_();switch(n(Xx({id:a,type:r,isOpen:!0,...e})),r){case Hn.CONFIRM:return new Promise(i=>{const u=Ds.subscribe(()=>{var p;const{modals:c}=Ds.getState(),f=c.list.find(h=>h.id===a);if(f&&!f.isOpen){const h=f.closeReason===iw.CONFIRMED,m=Bt.entries((p=f.views)==null?void 0:p.toggles).reduce((b,E)=>({...b,[E[0]]:E[1].value}),{});n(Jx(a)),u(),i({confirmed:h,options:m})}})});default:return{}}}),eC=()=>hk({name:Ur}),tC="Roles & Privileges",Sd=xe("roles/fetchRoles",async(e,{dispatch:n,rejectWithValue:r})=>{var u;let a;try{a=await eC()}catch(c){if(!Array.isArray((u=c==null?void 0:c.data)==null?void 0:u.__ERROR))return r("Error while loading the roles");a={name:Ur,date:new Date().toISOString(),content:{permissions:{allowed:[]},privileges:[],roles:[]}}}const i={name:tC,type:le.ROLES,date:a.date,view:{panel:{isOpen:!1,type:"",current:""}},path:Ur,flags:{},content:{}};return n(wn(i)),{...a,content:ap(a.content)}}),rC=xe("roles/fetchRolesChanges",async(e,{getState:n})=>{const{tabs:r}=n().root;if(r.find(i=>i.path===Ur)){const{date:i}=n().roles;if(i&&await sw(i))return{old:!0}}return{}}),sw=async e=>{if(!e)return!1;try{const n=await eC();if(n.date){const r=new Date(e),a=new Date(n.date);if(r>a)return!0}}catch(n){if(!Array.isArray(n==null?void 0:n.data.__ERROR))throw n}return!1},a_=xe("roles/saveRoles",async(e,{getState:n,rejectWithValue:r,dispatch:a})=>{try{const{flags:i,date:u}=n().roles;if(i.old||await sw(u)){const{confirmed:p}=await a(Eo({title:tC,message:"New content has been found on the server. Are you sure you want to continue?",type:Hn.CONFIRM,icon:"FaSave"})).unwrap();if(!p)return r({old:!0})}return await Gd({name:Ur,content:aw(e)})}catch{return r("Error while loading the roles")}}),r6=nu().roles,{roles:n6={},privileges:o6={},flags:a6={touched:!1},date:i6,selectedTab:s6="roles"}=r6||{},u6={flags:a6,roles:n6,privileges:o6,date:i6,selectedTab:s6},nC=qn({name:"roles",initialState:u6,reducers:{updatePrivileges:(e,n)=>{e.privileges=n.payload,e.flags.touched=!0},updateRoles:(e,n)=>{e.roles=n.payload,e.flags.touched=!0},updateRolesAndPrivileges:(e,n)=>{e.roles=n.payload.roles,e.privileges=n.payload.privileges},toggleTab:(e,n)=>{e.selectedTab=n.payload},setRolesContent(e,n){const{content:r,date:a}=n.payload,i=ap(r);return{...e,...i,date:a}}},extraReducers(e){e.addCase(Sd.fulfilled,(n,r)=>{const{content:a,date:i}=r.payload;n={...n,...a,date:i}}).addCase(Sd.rejected,n=>({...n,roles:{},privileges:{},flags:{touched:!1},date:void 0})).addCase(a_.fulfilled,(n,r)=>({...n,flags:{...n.flags,touched:!1,old:!1},date:r.payload.date})).addCase(a_.rejected,(n,r)=>FT.isString(r.payload)?n:{...n,flags:{...n.flags,...r.payload}}).addCase(rC.fulfilled,(n,r)=>({...n,flags:{...n.flags,...r.payload}})).addCase(Ys.fulfilled,(n,r)=>{!r.payload||r.payload.path!==Ur||(n.flags.touched=!1,n.flags.old=!1)}).addCase(hw.fulfilled,(n,r)=>{r.meta.arg!==Ur||!r.payload||(n.flags.touched=!1,n.flags.old=!1)})}}),{updatePrivileges:oC,updateRoles:aC,setRolesContent:uw,toggleTab:c6,updateRolesAndPrivileges:cw}=nC.actions,l6=nC.reducer,oi="qodlyApp.json",lw=xe("settings/fetch",async()=>await ni({verb:Zt.GET_INFO,path:oi,content:!0,as:"json"})),iC=xe("settings/app",uk),f6=IT(),NS={session:{"studio.tips":!0,"studio.notifications":!0,"webforms.tooltip.behavior":tw.SHOW_AFTER_TIMEOUT,"webforms.tooltip.timeout":3e3,"webforms.renderer.showPopOver":!0,"welcometour.active":!0,"webforms.properties.advanced-mode":!1,"monaco.zoom":0},project:{"webforms.renderer.indexPage":"","webforms.display-mode":"neutral"},server:{projectOpened:!1,remoteDebuggerMode:W_.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:"",lsp:""},isRestActive:!0}},d6={...NS,session:{...NS.session,...f6},welcometour:{}},sC=qn({name:"settings",initialState:d6,reducers:{setSetting(e,n){const{path:r,settingsKey:a,value:i}=n.payload;e[r][a]=i},setSettings(e,n){const{path:r,value:a}=n.payload;e[r]={...e[r],...a}},setSettingsAsText(e,n){const{path:r,settings:a}=n.payload;e[r]=a}},extraReducers(e){e.addCase(lw.fulfilled,(n,r)=>{n.project={...n.project,...r.payload.content}}),e.addCase(iC.fulfilled,(n,r)=>{n.server=r.payload,n.server.qodly&&(n.project["webforms.display-mode"]="airy")})}}),{setSetting:uC,setSettings:sp,setSettingsAsText:p6}=sC.actions,h6=sC.reducer,i_=e=>{const n=["folder","file"];return e.sort((r,a)=>r.type===a.type?r.name.localeCompare(a.name):n.indexOf(r.type)-n.indexOf(a.type))},ct=(e,n)=>e.reduce((r,a)=>a.path===n.path&&a.type===n.type?[...r,n]:a.children?[...r,{...a,children:i_(ct(a.children,n))}]:[...r,a],[]),Tr=(e,n)=>e.reduce((r,a)=>r||(a.path===n?a:a.children?Tr(a.children,n):null),null),v6=[{name:Wt.WEBFORMS,type:le.FOLDER,children:[],path:Wt.WEBFORMS,error:null,flags:{expanded:!1,loading:!1,cached:!1},tipKey:"editors:webform:explorer:webforms",config:{},isRoot:!0},{name:Wt.METHODS,type:le.FOLDER,children:[],path:Wt.METHODS,error:null,flags:{expanded:!1,loading:!1,cached:!1},config:{},isRoot:!0},{name:Wt.CLASSES,type:le.FOLDER,children:[],path:Wt.CLASSES,error:null,flags:{expanded:!1,loading:!1,cached:!1},config:{},isRoot:!0},{name:Wt.SHARED,type:le.FOLDER,children:[],path:Wt.SHARED,error:null,flags:{expanded:!1,loading:!1,cached:!1},config:{},isRoot:!0},{name:"Debugger",type:le.FOLDER,children:[],path:"Debugger",error:null,flags:{expanded:!1,cached:!0},config:{},isRoot:!0},{name:"Roles And Privileges",type:le.FILE,ext:"json",path:"roles",error:null,flags:{},config:{editor:{key:"editors:roles"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]},isRoot:!0},{name:"Model",type:le.MODEL,ext:"4DModel",path:"model",error:null,flags:{},config:{editor:{key:"editors:model"},supportedEditors:[{key:"editors:code",config:{language:"json",theme:"vs-dark"}}]}},{name:"Settings",type:le.FILE,ext:"json",path:"qodlyApp",error:null,flags:{},config:{editor:{key:"editors:settings"}},isRoot:!0}],cC=qn({name:"explorer",initialState:v6,reducers:{toggleExpandFolder:(e,n)=>(e=ct(e,{...n.payload,flags:{...n.payload.flags,expanded:!n.payload.flags.expanded}}),e),expandFolder:(e,n)=>(e=ct(e,{...n.payload,flags:{...n.payload.flags,expanded:!0}}),e),openAddFileInput:(e,n)=>ct(e,{...n.payload,flags:{...n.payload.flags,adding:!0}}),addNewFile:(e,n)=>{const{parent:r,child:a}=n.payload;return ct(e,{...r,children:[a,...r.children||[]]})},removeFile:(e,n)=>{const{parent:r,child:a}=n.payload;return ct(e,{...r,children:r.children.filter(i=>i.path!==a.path)})},refreshFile:(e,n)=>{const{parent:r,child:a}=n.payload,i=(r.children||[]).filter(u=>u.path!==a.path&&!a.error);return ct(e,{...r,children:[a,...i]})},setFolderChildren:(e,n)=>{const r=Tr(e,n.payload.parentPath);return r?ct(e,{...r,children:n.payload.children}):e}},extraReducers:e=>{e.addCase(Vs.pending,(n,r)=>{const{file:a,newname:i}=r.meta.arg,u=Tr(n,a.path);if(!u)return n;const c=a.path.split("/");c.pop();const f=`${c.join("/")}/${a.name}.${a.ext}`,p=`${c.join("/")}/${i}.${a.ext}`;switch(a.ext){case"4dm":case"4qs":Xa.next({action:ka.WILL_RENAME,payload:{oldPath:f,newPath:p}});break}return ct(n,{...u,flags:{...u.flags,loading:!0}})}),e.addCase(Vs.fulfilled,(n,r)=>{const{meta:{arg:{file:a}},payload:i}=r,u=Tr(n,a.path);if(!u)return n;switch(i.old.ext){case"4dm":case"4qs":Xa.next({action:ka.DID_RENAME,payload:{oldPath:i.old.path,newPath:i.new.path}});break}return ct(n,{...u,flags:{...u.flags,loading:!1}})}),e.addCase(Vs.rejected,(n,r)=>{const{file:a}=r.meta.arg,i=Tr(n,a.path);return i?ct(n,{...i,flags:{...i.flags,loading:!1}}):n}),e.addCase(Po.pending,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,flags:{...i.flags,loading:!0}}):n}),e.addCase(Po.fulfilled,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,children:i_(r.payload),flags:{...i.flags,loading:!1,cached:!0,expanded:!0},error:null}):n}),e.addCase(Po.rejected,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,error:{message:r.payload},flags:{...i.flags,loading:!1,cached:!0,expanded:!0}}):n}),e.addCase(zl.pending,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,flags:{...i.flags,loading:!0}}):n}),e.addCase(zl.fulfilled,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,children:i_(r.payload),flags:{...i.flags,loading:!1,cached:!0,expanded:!1},error:null}):n}),e.addCase(zl.rejected,(n,r)=>{const a=r.meta.arg,i=Tr(n,a);return i?ct(n,{...i,error:{message:r.payload},flags:{...i.flags,loading:!1,cached:!0,expanded:!1}}):n}),e.addCase(qf.pending,(n,r)=>{const{fileName:a,parentNode:i,path:u,type:c}=r.meta.arg;return ct(n,{...i,children:[{name:a,path:`${u}/${a}`,type:c,error:null,flags:{loading:!0},config:{}},...i.children]})}),e.addCase(qf.fulfilled,(n,r)=>{const{path:a,fileName:i,type:u}=r.meta.arg,c=Ws(u),{editor:f,supportedEditors:p}=bo(`${a}${c?`.${c.toLowerCase()}`:""}`);return ct(n,{name:i,path:`${a}/${i}`,type:u,error:null,flags:{loading:!1},config:{editor:f,supportedEditors:p}})}),e.addCase(qf.rejected,(n,r)=>{const{path:a,fileName:i,type:u}=r.meta.arg;return ct(n,{name:i,path:`${a}/${i}`,type:u,error:{message:r.payload},flags:{loading:!1},config:{}})}),e.addCase(Vf.pending,(n,r)=>{const{node:a,parentNode:i}=r.meta.arg;return ct(n,{...i,children:[{name:`${a.name}_copy`,path:`${a.path}/${a.name}_copy`,type:a.type,error:null,flags:{loading:!0},permissions:{canRename:!0,canDelete:!0}},...i.children]})}),e.addCase(Vf.fulfilled,(n,r)=>{const{node:a}=r.payload,{node:{path:i,ext:u}}=r.meta.arg,{editor:c,supportedEditors:f}=bo(`${i}${u?`.${u.toLowerCase()}`:""}`);return ct(n,{name:`${a.name}`,path:`${i}/${a.name}`,type:a.type,error:null,flags:{loading:!1},config:{editor:c,supportedEditors:f}})}),e.addCase(Vf.rejected,(n,r)=>{const a=r.payload,{node:i}=r.meta.arg;return ct(n,{name:`${i.name}_copy`,path:`${i.path}/${i.name}_copy`,type:i.type,error:{message:a},flags:{loading:!1},config:{}})}),e.addCase(Gl.pending,(n,r)=>{}),e.addCase(Gl.fulfilled,(n,r)=>{var b;const{draggedNode:a,newLocation:i}=r.meta.arg,u=dx(a.path),c=Tr(n,u),f=Tr(n,i.path),p=(b=c==null?void 0:c.children)==null?void 0:b.filter(E=>E.path!==a.path),h=i.path.split("/").length,m=a.path.split("/").length;return h>=m?(n=ct(n,{...c,children:p}),n=ct(n,{...f,children:[{...a,path:`${f.path}/${a.name}`},...f!=null&&f.children?f==null?void 0:f.children:[]],flags:{...f.flags,expanded:!0}})):(n=ct(n,{...f,children:[{...a,path:`${f.path}/${a.name}`},...f!=null&&f.children?f==null?void 0:f.children:[]],flags:{...f.flags,expanded:!0}}),n=ct(n,{...c,children:p})),n}),e.addCase(Gl.rejected,(n,r)=>{Ao.next({message:"Error moving file",kind:"danger"})}),e.addCase(qs.pending,(n,r)=>{var C;const{fileName:a,parentNode:i,path:u,type:c,qodly:f}=r.meta.arg,p=Ws(c,f),h=`${u}/${a}${p?`.${p.toLowerCase()}`:""}`,{editor:m,supportedEditors:b}=bo(h);switch(c){case le.CLASS:case le.METHOD:Xa.next({action:ka.WILL_CREATE,payload:{filePath:h}});break}const E=(C=i.children)==null?void 0:C.filter(k=>k.path!==`${u}/${a}`),O=[{name:a,path:`${u}/${a}`,type:le.FILE,error:null,flags:{loading:!0},config:{editor:m,supportedEditors:b},ext:p,date:new Date().toISOString()},...E],R=ct(n,{...i,children:O});return FT.merge(n,R)}),e.addCase(qs.fulfilled,(n,r)=>{const{fileName:a,path:i,type:u,qodly:c}=r.meta.arg,f=Ws(u,c),p=`${i}/${a}${f?`.${f.toLowerCase()}`:""}`,{editor:h,supportedEditors:m}=bo(p),b=ct(n,{name:a,path:`${i}/${a}`,type:le.FILE,error:null,flags:{},config:{editor:h,supportedEditors:m},ext:f,date:new Date().toISOString()});switch(u){case le.CLASS:case le.METHOD:Xa.next({action:ka.DID_CREATE,payload:{filePath:p}});break}return n=b,n}),e.addCase(qs.rejected,(n,r)=>{const{fileName:a,path:i,type:u}=r.meta.arg,c=Ws(u),{editor:f,supportedEditors:p}=bo(`${i}${c?`.${c.toLowerCase()}`:""}`);return n=ct(n,{name:a,path:`${i}/${a}`,type:le.FILE,error:{message:"Failed creating file"},flags:{},config:{editor:f,supportedEditors:p},ext:c,date:new Date().toISOString()}),n}),e.addMatcher(iO(Hl),(n,r)=>{const a=Tr(n,r.meta.arg.file.path.split(".")[0]);return a&&(n=ct(n,{...a,flags:{...a.flags,loading:!0}})),n}),e.addMatcher(uO(Hl),(n,r)=>{const a=Tr(n,r.meta.arg.file.path.split(".")[0]);return a&&(n=ct(n,{...a,flags:{...a.flags,loading:!1}})),n}),e.addMatcher(sO(Hl),(n,r)=>{const a=Tr(n,r.meta.arg.file.path.split(".")[0]);return a&&(n=ct(n,{...a,flags:{...a.flags,loading:!1}})),Ao.next({message:"Failed to open file, try again",kind:"danger"}),n})}}),{toggleExpandFolder:g6,expandFolder:m6,openAddFileInput:y6,addNewFile:lC,refreshFile:b6,removeFile:s_,setFolderChildren:_6}=cC.actions;function fC(e){switch(e){case le.WEBFORMS:return Nx;case le.METHODS:return`//%attributes = {}
|
|
270
270
|
`;default:return""}}function dC(e,n,r){switch(n){case le.MOBILEFORM:return`${e}.MForm`;case le.WEBFORM:return`${e}.WebForm`;case le.METHOD:case le.CLASS:return`${e}.${r?"4qs":"4dm"}`;default:return e}}function w6(e){switch(e){case Wt.WEBFORMS:return le.WEBFORMS;case Wt.METHODS:return le.METHODS;case Wt.CLASSES:return le.CLASSES;case"Mobile":return le.MOBILE;default:return e}}function pC(e){switch(e){case le.WEBFORMS:return le.WEBFORM;case le.CLASSES:return le.CLASS;case le.METHODS:return le.METHOD;case le.FOLDER:return le.FOLDER;case le.MOBILE:return le.MOBILEFORM;default:return e}}const E6=xe("files/tryEditMethod",async({method:e},{dispatch:n})=>{const r=e.filePath.split("/"),[a]=r[1].split("."),{editor:i}=bo(e.filePath);return await n(fw({file:{name:a,path:e.filePath,date:new Date().toISOString(),type:le.CLASS,editor:i},line:e.startingLine+1})).unwrap()}),u_=xe("explorer/createModelFiles",async(e,{dispatch:n,getState:r})=>{var b;const a=r(),i=Wt.CLASSES,u=a.settings.server.qodly,c=Tr(a.explorer,i);if(!c)return;await n(Po(i));const p=((b=r().explorer.find(E=>E.name===i))==null?void 0:b.children)||[];let h=[{content:"",name:""}];const m=E=>{switch(E){case"dataclass":return{name:e.type==="dataclass"?e.className:"DataStore",content:u?`extends DataClass
|
|
271
271
|
`:`Class extends DataClass
|
|
272
272
|
`};case"collection":return{name:e.type==="dataclass"?e.collectionName:"DataStore",content:u?`extends EntitySelection
|