@ws-ui/shared 0.2.32 → 0.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -202,5 +202,5 @@ function print() { __p += __j.call(arguments, '') }
202
202
  }`;var Pe=Bd(function(){return Fe(b,re+"return "+K).apply(n,x)});if(Pe.source=K,mu(Pe))throw Pe;return Pe}function f_(t){return He(t).toLowerCase()}function d_(t){return He(t).toUpperCase()}function p_(t,i,s){if(t=He(t),t&&(s||i===n))return Jc(t);if(!t||!(i=Jt(i)))return t;var c=_n(t),h=_n(i),b=Zc(c,h),x=Qc(c,h)+1;return dr(c,b,x).join("")}function h_(t,i,s){if(t=He(t),t&&(s||i===n))return t.slice(0,tf(t)+1);if(!t||!(i=Jt(i)))return t;var c=_n(t),h=Qc(c,_n(i))+1;return dr(c,0,h).join("")}function v_(t,i,s){if(t=He(t),t&&(s||i===n))return t.replace(F,"");if(!t||!(i=Jt(i)))return t;var c=_n(t),h=Zc(c,_n(i));return dr(c,h).join("")}function m_(t,i){var s=ee,c=ge;if(tt(i)){var h="separator"in i?i.separator:h;s="length"in i?Re(i.length):s,c="omission"in i?Jt(i.omission):c}t=He(t);var b=t.length;if(ui(t)){var x=_n(t);b=x.length}if(s>=b)return t;var R=s-li(c);if(R<1)return c;var M=x?dr(x,0,R).join(""):t.slice(0,R);if(h===n)return M+c;if(x&&(R+=M.length-R),gu(h)){if(t.slice(R).search(h)){var z,q=M;for(h.global||(h=Ms(h.source,He(ot.exec(h))+"g")),h.lastIndex=0;z=h.exec(q);)var K=z.index;M=M.slice(0,K===n?R:K)}}else if(t.indexOf(Jt(h),R)!=R){var Z=M.lastIndexOf(h);Z>-1&&(M=M.slice(0,Z))}return M+c}function g_(t){return t=He(t),t&&Pr.test(t)?t.replace(ii,Gg):t}var y_=mi(function(t,i,s){return t+(s?" ":"")+i.toUpperCase()}),bu=zf("toUpperCase");function Ud(t,i,s){return t=He(t),i=s?n:i,i===n?Hg(t)?Xg(t):Lg(t):t.match(i)||[]}var Bd=Ae(function(t,i){try{return Xt(t,n,i)}catch(s){return mu(s)?s:new Ee(s)}}),w_=Kn(function(t,i){return sn(i,function(s){s=Mn(s),qn(t,s,hu(t[s],t))}),t});function b_(t){var i=t==null?0:t.length,s=he();return t=i?et(t,function(c){if(typeof c[1]!="function")throw new un(l);return[s(c[0]),c[1]]}):[],Ae(function(c){for(var h=-1;++h<i;){var b=t[h];if(Xt(b[0],this,c))return Xt(b[1],this,c)}})}function __(t){return G0(cn(t,_))}function _u(t){return function(){return t}}function S_(t,i){return t==null||t!==t?i:t}var E_=Gf(),x_=Gf(!0);function zt(t){return t}function Su(t){return Sf(typeof t=="function"?t:cn(t,_))}function O_(t){return xf(cn(t,_))}function T_(t,i){return Of(t,cn(i,_))}var C_=Ae(function(t,i){return function(s){return Xi(s,t,i)}}),R_=Ae(function(t,i){return function(s){return Xi(t,s,i)}});function Eu(t,i,s){var c=yt(i),h=Qo(i,c);s==null&&!(tt(i)&&(h.length||!c.length))&&(s=i,i=t,t=this,h=Qo(i,yt(i)));var b=!(tt(s)&&"chain"in s)||!!s.chain,x=Xn(t);return sn(h,function(R){var M=i[R];t[R]=M,x&&(t.prototype[R]=function(){var z=this.__chain__;if(b||z){var q=t(this.__wrapped__),K=q.__actions__=Ht(this.__actions__);return K.push({func:M,args:arguments,thisArg:t}),q.__chain__=z,q}return M.apply(t,ar([this.value()],arguments))})}),t}function P_(){return _t._===this&&(_t._=t0),this}function xu(){}function A_(t){return t=Re(t),Ae(function(i){return Tf(i,t)})}var I_=tu(et),L_=tu(Gc),M_=tu(Ts);function zd(t){return uu(t)?Cs(Mn(t)):ly(t)}function D_(t){return function(i){return t==null?n:$r(t,i)}}var k_=Yf(),N_=Yf(!0);function Ou(){return[]}function Tu(){return!1}function $_(){return{}}function j_(){return""}function F_(){return!0}function W_(t,i){if(t=Re(t),t<1||t>We)return[];var s=X,c=Ct(t,X);i=he(i),t-=X;for(var h=As(c,i);++s<t;)i(s);return h}function H_(t){return Te(t)?et(t,Mn):Zt(t)?[t]:Ht(cd(He(t)))}function U_(t){var i=++Qg;return He(t)+i}var B_=oa(function(t,i){return t+i},0),z_=nu("ceil"),q_=oa(function(t,i){return t/i},1),G_=nu("floor");function K_(t){return t&&t.length?Zo(t,zt,Hs):n}function Y_(t,i){return t&&t.length?Zo(t,he(i,2),Hs):n}function X_(t){return Xc(t,zt)}function V_(t,i){return Xc(t,he(i,2))}function J_(t){return t&&t.length?Zo(t,zt,qs):n}function Z_(t,i){return t&&t.length?Zo(t,he(i,2),qs):n}var Q_=oa(function(t,i){return t*i},1),eS=nu("round"),tS=oa(function(t,i){return t-i},0);function nS(t){return t&&t.length?Ps(t,zt):0}function rS(t,i){return t&&t.length?Ps(t,he(i,2)):0}return w.after=Ow,w.ary=_d,w.assign=db,w.assignIn=kd,w.assignInWith=ya,w.assignWith=pb,w.at=hb,w.before=Sd,w.bind=hu,w.bindAll=w_,w.bindKey=Ed,w.castArray=$w,w.chain=yd,w.chunk=Gy,w.compact=Ky,w.concat=Yy,w.cond=b_,w.conforms=__,w.constant=_u,w.countBy=nw,w.create=vb,w.curry=xd,w.curryRight=Od,w.debounce=Td,w.defaults=mb,w.defaultsDeep=gb,w.defer=Tw,w.delay=Cw,w.difference=Xy,w.differenceBy=Vy,w.differenceWith=Jy,w.drop=Zy,w.dropRight=Qy,w.dropRightWhile=e1,w.dropWhile=t1,w.fill=n1,w.filter=iw,w.flatMap=sw,w.flatMapDeep=uw,w.flatMapDepth=lw,w.flatten=hd,w.flattenDeep=r1,w.flattenDepth=i1,w.flip=Rw,w.flow=E_,w.flowRight=x_,w.fromPairs=o1,w.functions=xb,w.functionsIn=Ob,w.groupBy=cw,w.initial=s1,w.intersection=u1,w.intersectionBy=l1,w.intersectionWith=c1,w.invert=Cb,w.invertBy=Rb,w.invokeMap=dw,w.iteratee=Su,w.keyBy=pw,w.keys=yt,w.keysIn=Bt,w.map=da,w.mapKeys=Ab,w.mapValues=Ib,w.matches=O_,w.matchesProperty=T_,w.memoize=ha,w.merge=Lb,w.mergeWith=Nd,w.method=C_,w.methodOf=R_,w.mixin=Eu,w.negate=va,w.nthArg=A_,w.omit=Mb,w.omitBy=Db,w.once=Pw,w.orderBy=hw,w.over=I_,w.overArgs=Aw,w.overEvery=L_,w.overSome=M_,w.partial=vu,w.partialRight=Cd,w.partition=vw,w.pick=kb,w.pickBy=$d,w.property=zd,w.propertyOf=D_,w.pull=h1,w.pullAll=md,w.pullAllBy=v1,w.pullAllWith=m1,w.pullAt=g1,w.range=k_,w.rangeRight=N_,w.rearg=Iw,w.reject=yw,w.remove=y1,w.rest=Lw,w.reverse=du,w.sampleSize=bw,w.set=$b,w.setWith=jb,w.shuffle=_w,w.slice=w1,w.sortBy=xw,w.sortedUniq=T1,w.sortedUniqBy=C1,w.split=s_,w.spread=Mw,w.tail=R1,w.take=P1,w.takeRight=A1,w.takeRightWhile=I1,w.takeWhile=L1,w.tap=K1,w.throttle=Dw,w.thru=fa,w.toArray=Ld,w.toPairs=jd,w.toPairsIn=Fd,w.toPath=H_,w.toPlainObject=Dd,w.transform=Fb,w.unary=kw,w.union=M1,w.unionBy=D1,w.unionWith=k1,w.uniq=N1,w.uniqBy=$1,w.uniqWith=j1,w.unset=Wb,w.unzip=pu,w.unzipWith=gd,w.update=Hb,w.updateWith=Ub,w.values=wi,w.valuesIn=Bb,w.without=F1,w.words=Ud,w.wrap=Nw,w.xor=W1,w.xorBy=H1,w.xorWith=U1,w.zip=B1,w.zipObject=z1,w.zipObjectDeep=q1,w.zipWith=G1,w.entries=jd,w.entriesIn=Fd,w.extend=kd,w.extendWith=ya,Eu(w,w),w.add=B_,w.attempt=Bd,w.camelCase=Kb,w.capitalize=Wd,w.ceil=z_,w.clamp=zb,w.clone=jw,w.cloneDeep=Ww,w.cloneDeepWith=Hw,w.cloneWith=Fw,w.conformsTo=Uw,w.deburr=Hd,w.defaultTo=S_,w.divide=q_,w.endsWith=Yb,w.eq=En,w.escape=Xb,w.escapeRegExp=Vb,w.every=rw,w.find=ow,w.findIndex=dd,w.findKey=yb,w.findLast=aw,w.findLastIndex=pd,w.findLastKey=wb,w.floor=G_,w.forEach=wd,w.forEachRight=bd,w.forIn=bb,w.forInRight=_b,w.forOwn=Sb,w.forOwnRight=Eb,w.get=yu,w.gt=Bw,w.gte=zw,w.has=Tb,w.hasIn=wu,w.head=vd,w.identity=zt,w.includes=fw,w.indexOf=a1,w.inRange=qb,w.invoke=Pb,w.isArguments=Wr,w.isArray=Te,w.isArrayBuffer=qw,w.isArrayLike=Ut,w.isArrayLikeObject=ct,w.isBoolean=Gw,w.isBuffer=pr,w.isDate=Kw,w.isElement=Yw,w.isEmpty=Xw,w.isEqual=Vw,w.isEqualWith=Jw,w.isError=mu,w.isFinite=Zw,w.isFunction=Xn,w.isInteger=Rd,w.isLength=ma,w.isMap=Pd,w.isMatch=Qw,w.isMatchWith=eb,w.isNaN=tb,w.isNative=nb,w.isNil=ib,w.isNull=rb,w.isNumber=Ad,w.isObject=tt,w.isObjectLike=at,w.isPlainObject=to,w.isRegExp=gu,w.isSafeInteger=ob,w.isSet=Id,w.isString=ga,w.isSymbol=Zt,w.isTypedArray=yi,w.isUndefined=ab,w.isWeakMap=sb,w.isWeakSet=ub,w.join=f1,w.kebabCase=Jb,w.last=dn,w.lastIndexOf=d1,w.lowerCase=Zb,w.lowerFirst=Qb,w.lt=lb,w.lte=cb,w.max=K_,w.maxBy=Y_,w.mean=X_,w.meanBy=V_,w.min=J_,w.minBy=Z_,w.stubArray=Ou,w.stubFalse=Tu,w.stubObject=$_,w.stubString=j_,w.stubTrue=F_,w.multiply=Q_,w.nth=p1,w.noConflict=P_,w.noop=xu,w.now=pa,w.pad=e_,w.padEnd=t_,w.padStart=n_,w.parseInt=r_,w.random=Gb,w.reduce=mw,w.reduceRight=gw,w.repeat=i_,w.replace=o_,w.result=Nb,w.round=eS,w.runInContext=A,w.sample=ww,w.size=Sw,w.snakeCase=a_,w.some=Ew,w.sortedIndex=b1,w.sortedIndexBy=_1,w.sortedIndexOf=S1,w.sortedLastIndex=E1,w.sortedLastIndexBy=x1,w.sortedLastIndexOf=O1,w.startCase=u_,w.startsWith=l_,w.subtract=tS,w.sum=nS,w.sumBy=rS,w.template=c_,w.times=W_,w.toFinite=Vn,w.toInteger=Re,w.toLength=Md,w.toLower=f_,w.toNumber=pn,w.toSafeInteger=fb,w.toString=He,w.toUpper=d_,w.trim=p_,w.trimEnd=h_,w.trimStart=v_,w.truncate=m_,w.unescape=g_,w.uniqueId=U_,w.upperCase=y_,w.upperFirst=bu,w.each=wd,w.eachRight=bd,w.first=vd,Eu(w,function(){var t={};return In(w,function(i,s){ze.call(w.prototype,s)||(t[s]=i)}),t}(),{chain:!1}),w.VERSION=o,sn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){w[t].placeholder=w}),sn(["drop","take"],function(t,i){ke.prototype[t]=function(s){s=s===n?1:vt(Re(s),0);var c=this.__filtered__&&!i?new ke(this):this.clone();return c.__filtered__?c.__takeCount__=Ct(s,c.__takeCount__):c.__views__.push({size:Ct(s,X),type:t+(c.__dir__<0?"Right":"")}),c},ke.prototype[t+"Right"]=function(s){return this.reverse()[t](s).reverse()}}),sn(["filter","map","takeWhile"],function(t,i){var s=i+1,c=s==se||s==we;ke.prototype[t]=function(h){var b=this.clone();return b.__iteratees__.push({iteratee:he(h,3),type:s}),b.__filtered__=b.__filtered__||c,b}}),sn(["head","last"],function(t,i){var s="take"+(i?"Right":"");ke.prototype[t]=function(){return this[s](1).value()[0]}}),sn(["initial","tail"],function(t,i){var s="drop"+(i?"":"Right");ke.prototype[t]=function(){return this.__filtered__?new ke(this):this[s](1)}}),ke.prototype.compact=function(){return this.filter(zt)},ke.prototype.find=function(t){return this.filter(t).head()},ke.prototype.findLast=function(t){return this.reverse().find(t)},ke.prototype.invokeMap=Ae(function(t,i){return typeof t=="function"?new ke(this):this.map(function(s){return Xi(s,t,i)})}),ke.prototype.reject=function(t){return this.filter(va(he(t)))},ke.prototype.slice=function(t,i){t=Re(t);var s=this;return s.__filtered__&&(t>0||i<0)?new ke(s):(t<0?s=s.takeRight(-t):t&&(s=s.drop(t)),i!==n&&(i=Re(i),s=i<0?s.dropRight(-i):s.take(i-t)),s)},ke.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ke.prototype.toArray=function(){return this.take(X)},In(ke.prototype,function(t,i){var s=/^(?:filter|find|map|reject)|While$/.test(i),c=/^(?:head|last)$/.test(i),h=w[c?"take"+(i=="last"?"Right":""):i],b=c||/^find/.test(i);h&&(w.prototype[i]=function(){var x=this.__wrapped__,R=c?[1]:arguments,M=x instanceof ke,z=R[0],q=M||Te(x),K=function(De){var Ne=h.apply(w,ar([De],R));return c&&Z?Ne[0]:Ne};q&&s&&typeof z=="function"&&z.length!=1&&(M=q=!1);var Z=this.__chain__,re=!!this.__actions__.length,ve=b&&!Z,Pe=M&&!re;if(!b&&q){x=Pe?x:new ke(this);var me=t.apply(x,R);return me.__actions__.push({func:fa,args:[K],thisArg:n}),new ln(me,Z)}return ve&&Pe?t.apply(this,R):(me=this.thru(K),ve?c?me.value()[0]:me.value():me)})}),sn(["pop","push","shift","sort","splice","unshift"],function(t){var i=$o[t],s=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",c=/^(?:pop|shift)$/.test(t);w.prototype[t]=function(){var h=arguments;if(c&&!this.__chain__){var b=this.value();return i.apply(Te(b)?b:[],h)}return this[s](function(x){return i.apply(Te(x)?x:[],h)})}}),In(ke.prototype,function(t,i){var s=w[i];if(s){var c=s.name+"";ze.call(pi,c)||(pi[c]=[]),pi[c].push({name:i,func:s})}}),pi[ia(n,D).name]=[{name:"wrapper",func:n}],ke.prototype.clone=g0,ke.prototype.reverse=y0,ke.prototype.value=w0,w.prototype.at=Y1,w.prototype.chain=X1,w.prototype.commit=V1,w.prototype.next=J1,w.prototype.plant=Q1,w.prototype.reverse=ew,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=tw,w.prototype.first=w.prototype.head,Ui&&(w.prototype[Ui]=Z1),w},ci=Vg();Lr?((Lr.exports=ci)._=ci,Ss._=ci):_t._=ci}).call(zr)})(es,es.exports);var pt=es.exports;const Dl={FdSave:IE,FdWarningDanger:Yl,FdInfoCircle:RE,FdInfoBold:wl};var dc=(e=>(e.ALERT="alert",e.CONFIRM="confirm",e))(dc||{}),Vr=(e=>(e.PRIMARY="primary",e.WARNING="warning",e.DANGER="danger",e))(Vr||{}),Ti=(e=>(e.CONFIRMED="confirmed",e.CANCELED="canceled",e))(Ti||{});const sm={[Vr.PRIMARY]:{icon:"blue-500",button:"primary-dark"},[Vr.DANGER]:{icon:"red-500",button:"primary-dark"},[Vr.WARNING]:{icon:"yellow-400",button:"primary-dark"}},al=({color:e=Vr.PRIMARY,variant:r="solid",children:n,autoFocus:o,...a})=>{const u=sm[e].button,l=r==="outlined"?`bg-transparent text-white border border-white hover:border-white hover:bg-white hover:text-${u}`:`text-white bg-${u} border border-${u} hover:border-white hover:bg-white hover:text-${u}`;return $.jsx("button",{autoFocus:o,className:Ot("w-28 rounded p-1.5 text-xs font-medium hover:font-bold focus:outline-none",l),...a,children:n})},uP=({name:e,color:r=Vr.PRIMARY,className:n="w-10 h-10"})=>{const o=Dl[e]||Dl.FdInfoCircle,a=`text-${sm[r].icon}`;return $.jsx(o,{className:Ot(n,a)})},lP=({id:e,title:r,message:n,icon:o,type:a,color:u,zIndex:l=3e3,views:f,width:d=520,hasOverlay:v=!0,onClose:g,onEdit:_})=>{const O=y=>{g({id:e,reason:y})};N.useEffect(()=>{function y(E){E.key==="Escape"&&O(Ti.CANCELED)}return window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}},[]);const m=pt.merge(pt.values(f==null?void 0:f.toggles).flatMap(y=>y.value?y.warnings||[]:[]),f==null?void 0:f.tips),S=(y,E)=>{var I;if(!(f!=null&&f.toggles))return;const D=pt.cloneDeep(f);(I=D.toggles)!=null&&I[y]&&(D.toggles[y].value=E),_({id:e,views:D})};return yo.createPortal($.jsx(Qa,{appear:!0,show:!0,as:N.Fragment,children:$.jsx("div",{className:Ot("absolute inset-0 flex h-full w-full items-center justify-center overflow-y-auto",{"bg-black bg-opacity-80":v}),style:{zIndex:l},onClick:()=>O(Ti.CANCELED),children:$.jsx(Qa.Child,{as:N.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:$.jsx("div",{"data-cy":"confirmation-modal-cy",className:"relative rounded-md border border-grey-200 bg-grey-500",style:{width:d},onClick:y=>y.stopPropagation(),children:$.jsxs("div",{className:"flex flex-col items-center gap-5 p-6 px-12",children:[o?$.jsx("div",{className:"flex items-center justify-center",children:$.jsx(uP,{name:o,color:u})}):null,$.jsx(cP,{condition:r,children:$.jsx("h4",{className:"w-full text-wrap text-lg font-bold leading-6 text-white text-center",children:r})}),$.jsx("p",{className:"w-full text-wrap text-center text-sm font-medium text-white",children:n}),$.jsx("div",{className:"text-xs text-white",children:pt.values(f==null?void 0:f.toggles).map(y=>$.jsx("div",{children:$.jsxs("label",{htmlFor:y.key,className:"flex items-center",children:[$.jsx(om,{size:"xs",value:y.value,onChange:E=>S(y.key,E)}),$.jsx("span",{className:"ml-1",children:y.title})]})},y.key))}),$.jsx(fP,{warnings:m}),$.jsx("div",{className:"flex items-center gap-4 p-1",children:a===dc.CONFIRM?$.jsxs($.Fragment,{children:[$.jsx(al,{autoFocus:!0,color:u,onClick:()=>O(Ti.CONFIRMED),children:"Confirm"}),$.jsx(al,{color:u,variant:"outlined",onClick:()=>O(Ti.CANCELED),children:"Cancel"})]}):$.jsx(al,{autoFocus:!0,onClick:()=>O(),children:"OK"})})]})})})})}),document.querySelector("body"))},cP=e=>e.condition?$.jsx($.Fragment,{children:e.children}):null,fP=e=>e.warnings?$.jsx(Qa,{appear:!0,show:!!e.warnings.length,as:N.Fragment,children:$.jsx("div",{className:"flex flex-col gap-1 rounded-sm bg-grey-600 p-2 text-xs text-white",children:e.warnings.map((r,n)=>$.jsx(Qa.Child,{as:N.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:$.jsxs("div",{className:"flex flex-1 items-center gap-1 rounded-sm px-2 py-1",children:[$.jsx(Yl,{className:Ot({"h-3 w-3":!0,"text-orange-400":r.type==="warning","text-red-400":r.type==="error","text-primary-dark":r.type==="info"},"mr-3")}),$.jsx("div",{className:"flex-1",children:r.message})]})},`modal-warnings-${n}`))})}):null;function dP(e,r){const n=N.useRef(!1);N.useEffect(()=>{if(n.current)return e();n.current=!0},r)}var sl=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function ul(e,r,n,o){e.addEventListener?e.addEventListener(r,n,o):e.attachEvent&&e.attachEvent("on".concat(r),function(){n(window.event)})}function um(e,r){for(var n=r.slice(0,r.length-1),o=0;o<n.length;o++)n[o]=e[n[o].toLowerCase()];return n}function lm(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var r=e.split(","),n=r.lastIndexOf("");n>=0;)r[n-1]+=",",r.splice(n,1),n=r.lastIndexOf("");return r}function pP(e,r){for(var n=e.length>=r.length?e:r,o=e.length>=r.length?r:e,a=!0,u=0;u<n.length;u++)o.indexOf(n[u])===-1&&(a=!1);return a}var vo={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":sl?173:189,"=":sl?61:187,";":sl?59:186,"'":222,"[":219,"]":221,"\\":220},Hn={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},kl={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},xt={16:!1,18:!1,17:!1,91:!1},st={};for(var ka=1;ka<20;ka++)vo["f".concat(ka)]=111+ka;var Ve=[],hh=!1,cm="all",fm=[],Po=function(r){return vo[r.toLowerCase()]||Hn[r.toLowerCase()]||r.toUpperCase().charCodeAt(0)},hP=function(r){return Object.keys(vo).find(function(n){return vo[n]===r})},vP=function(r){return Object.keys(Hn).find(function(n){return Hn[n]===r})};function dm(e){cm=e||"all"}function mo(){return cm||"all"}function mP(){return Ve.slice(0)}function gP(){return Ve.map(function(e){return hP(e)||vP(e)||String.fromCharCode(e)})}function yP(){var e=[];return Object.keys(st).forEach(function(r){st[r].forEach(function(n){var o=n.key,a=n.scope,u=n.mods,l=n.shortcut;e.push({scope:a,shortcut:l,mods:u,keys:o.split("+").map(function(f){return Po(f)})})})}),e}function wP(e){var r=e.target||e.srcElement,n=r.tagName,o=!0;return(r.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!r.readOnly)&&(o=!1),o}function bP(e){return typeof e=="string"&&(e=Po(e)),Ve.indexOf(e)!==-1}function _P(e,r){var n,o;e||(e=mo());for(var a in st)if(Object.prototype.hasOwnProperty.call(st,a))for(n=st[a],o=0;o<n.length;)n[o].scope===e?n.splice(o,1):o++;mo()===e&&dm(r||"all")}function SP(e){var r=e.keyCode||e.which||e.charCode,n=Ve.indexOf(r);if(n>=0&&Ve.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ve.splice(0,Ve.length),(r===93||r===224)&&(r=91),r in xt){xt[r]=!1;for(var o in Hn)Hn[o]===r&&(Pn[o]=!1)}}function EP(e){if(typeof e>"u")Object.keys(st).forEach(function(l){return delete st[l]});else if(Array.isArray(e))e.forEach(function(l){l.key&&ll(l)});else if(typeof e=="object")e.key&&ll(e);else if(typeof e=="string"){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var a=n[0],u=n[1];typeof a=="function"&&(u=a,a=""),ll({key:e,scope:a,method:u,splitKey:"+"})}}var ll=function(r){var n=r.key,o=r.scope,a=r.method,u=r.splitKey,l=u===void 0?"+":u,f=lm(n);f.forEach(function(d){var v=d.split(l),g=v.length,_=v[g-1],O=_==="*"?"*":Po(_);if(st[O]){o||(o=mo());var m=g>1?um(Hn,v):[];st[O]=st[O].filter(function(S){var y=a?S.method===a:!0;return!(y&&S.scope===o&&pP(S.mods,m))})}})};function vh(e,r,n,o){if(r.element===o){var a;if(r.scope===n||r.scope==="all"){a=r.mods.length>0;for(var u in xt)Object.prototype.hasOwnProperty.call(xt,u)&&(!xt[u]&&r.mods.indexOf(+u)>-1||xt[u]&&r.mods.indexOf(+u)===-1)&&(a=!1);(r.mods.length===0&&!xt[16]&&!xt[18]&&!xt[17]&&!xt[91]||a||r.shortcut==="*")&&(r.keys=[],r.keys=r.keys.concat(Ve),r.method(e,r)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}}function mh(e,r){var n=st["*"],o=e.keyCode||e.which||e.charCode;if(Pn.filter.call(this,e)){if((o===93||o===224)&&(o=91),Ve.indexOf(o)===-1&&o!==229&&Ve.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var y=kl[S];e[S]&&Ve.indexOf(y)===-1?Ve.push(y):!e[S]&&Ve.indexOf(y)>-1?Ve.splice(Ve.indexOf(y),1):S==="metaKey"&&e[S]&&Ve.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ve=Ve.slice(Ve.indexOf(y))))}),o in xt){xt[o]=!0;for(var a in Hn)Hn[a]===o&&(Pn[a]=!0);if(!n)return}for(var u in xt)Object.prototype.hasOwnProperty.call(xt,u)&&(xt[u]=e[kl[u]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ve.indexOf(17)===-1&&Ve.push(17),Ve.indexOf(18)===-1&&Ve.push(18),xt[17]=!0,xt[18]=!0);var l=mo();if(n)for(var f=0;f<n.length;f++)n[f].scope===l&&(e.type==="keydown"&&n[f].keydown||e.type==="keyup"&&n[f].keyup)&&vh(e,n[f],l,r);if(o in st){for(var d=0;d<st[o].length;d++)if((e.type==="keydown"&&st[o][d].keydown||e.type==="keyup"&&st[o][d].keyup)&&st[o][d].key){for(var v=st[o][d],g=v.splitKey,_=v.key.split(g),O=[],m=0;m<_.length;m++)O.push(Po(_[m]));O.sort().join("")===Ve.sort().join("")&&vh(e,v,l,r)}}}}function xP(e){return fm.indexOf(e)>-1}function Pn(e,r,n){Ve=[];var o=lm(e),a=[],u="all",l=document,f=0,d=!1,v=!0,g="+",_=!1;for(n===void 0&&typeof r=="function"&&(n=r),Object.prototype.toString.call(r)==="[object Object]"&&(r.scope&&(u=r.scope),r.element&&(l=r.element),r.keyup&&(d=r.keyup),r.keydown!==void 0&&(v=r.keydown),r.capture!==void 0&&(_=r.capture),typeof r.splitKey=="string"&&(g=r.splitKey)),typeof r=="string"&&(u=r);f<o.length;f++)e=o[f].split(g),a=[],e.length>1&&(a=um(Hn,e)),e=e[e.length-1],e=e==="*"?"*":Po(e),e in st||(st[e]=[]),st[e].push({keyup:d,keydown:v,scope:u,mods:a,shortcut:o[f],method:n,key:o[f],splitKey:g,element:l});typeof l<"u"&&!xP(l)&&window&&(fm.push(l),ul(l,"keydown",function(O){mh(O,l)},_),hh||(hh=!0,ul(window,"focus",function(){Ve=[]},_)),ul(l,"keyup",function(O){mh(O,l),SP(O)},_))}function OP(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(st).forEach(function(n){var o=st[n].filter(function(a){return a.scope===r&&a.shortcut===e});o.forEach(function(a){a&&a.method&&a.method()})})}var cl={getPressedKeyString:gP,setScope:dm,getScope:mo,deleteScope:_P,getPressedKeyCodes:mP,getAllKeyCodes:yP,isPressed:bP,filter:wP,trigger:OP,unbind:EP,keyMap:vo,modifier:Hn,modifierMap:kl};for(var fl in cl)Object.prototype.hasOwnProperty.call(cl,fl)&&(Pn[fl]=cl[fl]);if(typeof window<"u"){var TP=window.hotkeys;Pn.noConflict=function(e){return e&&window.hotkeys===Pn&&(window.hotkeys=TP),Pn},window.hotkeys=Pn}Pn.filter=()=>!0;function CP(e,r,n,o){n instanceof Array&&(o=n,n=void 0),o=o||[],n=n||{};const{preventDefault:a=!0}=n,u=N.useCallback((f,d)=>{a&&f.preventDefault(),setTimeout(()=>r(f,d))},o),l=()=>{Pn.unbind(e,u)};N.useEffect(()=>(Pn(e,n,u),l),[e,n,u])}const RP=e=>{const r=N.useRef(null);return N.useEffect(()=>{const n=o=>{r.current&&!r.current.contains(o.target)&&e(o)};return document.addEventListener("click",n,!0),()=>{document.removeEventListener("click",n,!0)}},[e]),r};function PP(e){const r=N.useRef();return N.useEffect(()=>{r.current=e},[e]),r.current}function AP(e){const r=N.useRef(e);return N.useEffect(()=>{r.current=e},[e]),r}function IP(e){const r=N.useRef(null);return N.useEffect(()=>{e&&(typeof e=="function"?e(r.current):e.current=r.current)}),r}function LP(e){const[r,n]=N.useState(e),o=(u,l)=>{n(f=>({...f,features:{...f.features,[u]:{enabled:l}}}))},a=N.useCallback((...u)=>u.every(l=>{var f;return(f=r.features[l])==null?void 0:f.enabled}),[r.features]);return{setFeature:o,isFeatureEnabled:a}}const pm=N.createContext(""),MP=e=>$.jsx(pm.Provider,{value:e.value,children:e.children}),DP=()=>{const e=N.useContext(pm);if(typeof e!="string")throw new Error("Error while calling useIdentity! Context has incorrect type (expected string)");return e};function kP(e){const[r,n]=N.useState(e),o=N.useMemo(()=>NP(r,n),[]);return{state:r,actions:{...o,set:a=>{n(typeof a=="function"?a:u=>({...u,...a}))}}}}function NP(e,r=()=>{}){return Object.keys(e).reduce((o,a)=>({...o,[`set${pt.upperFirst(a)}`]:u=>r(l=>({...l,[a]:u}))}),{})}const $P=(e,r,n={})=>{n={timeout:200,...n};const o=N.useRef(),a=()=>{o.current&&(clearTimeout(o.current),o.current=null)};return N.useCallback((u,...l)=>{a(),r&&u.detail===1&&(o.current=setTimeout(()=>{r(u,...l)},n.timeout)),u.detail%2===0&&e(u,...l)},[r,e,n.timeout])};function tr(e){return typeof e=="function"}function hm(e){var r=function(o){Error.call(o),o.stack=new Error().stack},n=e(r);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var dl=hm(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
203
203
  `+n.map(function(o,a){return a+1+") "+o.toString()}).join(`
204
204
  `):"",this.name="UnsubscriptionError",this.errors=n}});function Nl(e,r){if(e){var n=e.indexOf(r);0<=n&&e.splice(n,1)}}var hs=function(){function e(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var r,n,o,a,u;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var f=El(l),d=f.next();!d.done;d=f.next()){var v=d.value;v.remove(this)}}catch(y){r={error:y}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}else l.remove(this);var g=this.initialTeardown;if(tr(g))try{g()}catch(y){u=y instanceof dl?y.errors:[y]}var _=this._finalizers;if(_){this._finalizers=null;try{for(var O=El(_),m=O.next();!m.done;m=O.next()){var S=m.value;try{gh(S)}catch(y){u=u??[],y instanceof dl?u=po(po([],Ya(u)),Ya(y.errors)):u.push(y)}}}catch(y){o={error:y}}finally{try{m&&!m.done&&(a=O.return)&&a.call(O)}finally{if(o)throw o.error}}}if(u)throw new dl(u)}},e.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)gh(r);else{if(r instanceof e){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(r)}},e.prototype._hasParent=function(r){var n=this._parentage;return n===r||Array.isArray(n)&&n.includes(r)},e.prototype._addParent=function(r){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(r),n):n?[n,r]:r},e.prototype._removeParent=function(r){var n=this._parentage;n===r?this._parentage=null:Array.isArray(n)&&Nl(n,r)},e.prototype.remove=function(r){var n=this._finalizers;n&&Nl(n,r),r instanceof e&&r._removeParent(this)},e.EMPTY=function(){var r=new e;return r.closed=!0,r}(),e}(),vm=hs.EMPTY;function mm(e){return e instanceof hs||e&&"closed"in e&&tr(e.remove)&&tr(e.add)&&tr(e.unsubscribe)}function gh(e){tr(e)?e():e.unsubscribe()}var gm={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},$l={setTimeout:function(e,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=$l.delegate;return a!=null&&a.setTimeout?a.setTimeout.apply(a,po([e,r],Ya(n))):setTimeout.apply(void 0,po([e,r],Ya(n)))},clearTimeout:function(e){var r=$l.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0};function jP(e){$l.setTimeout(function(){throw e})}function yh(){}function Ba(e){e()}var ym=function(e){os(r,e);function r(n){var o=e.call(this)||this;return o.isStopped=!1,n?(o.destination=n,mm(n)&&n.add(o)):o.destination=UP,o}return r.create=function(n,o,a){return new jl(n,o,a)},r.prototype.next=function(n){this.isStopped||this._next(n)},r.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(n){this.destination.next(n)},r.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(hs),FP=Function.prototype.bind;function pl(e,r){return FP.call(e,r)}var WP=function(){function e(r){this.partialObserver=r}return e.prototype.next=function(r){var n=this.partialObserver;if(n.next)try{n.next(r)}catch(o){Na(o)}},e.prototype.error=function(r){var n=this.partialObserver;if(n.error)try{n.error(r)}catch(o){Na(o)}else Na(r)},e.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(n){Na(n)}},e}(),jl=function(e){os(r,e);function r(n,o,a){var u=e.call(this)||this,l;if(tr(n)||!n)l={next:n??void 0,error:o??void 0,complete:a??void 0};else{var f;u&&gm.useDeprecatedNextContext?(f=Object.create(n),f.unsubscribe=function(){return u.unsubscribe()},l={next:n.next&&pl(n.next,f),error:n.error&&pl(n.error,f),complete:n.complete&&pl(n.complete,f)}):l=n}return u.destination=new WP(l),u}return r}(ym);function Na(e){jP(e)}function HP(e){throw e}var UP={closed:!0,next:yh,error:HP,complete:yh},BP=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function zP(e){return e}function qP(e){return e.length===0?zP:e.length===1?e[0]:function(n){return e.reduce(function(o,a){return a(o)},n)}}var wh=function(){function e(r){r&&(this._subscribe=r)}return e.prototype.lift=function(r){var n=new e;return n.source=this,n.operator=r,n},e.prototype.subscribe=function(r,n,o){var a=this,u=KP(r)?r:new jl(r,n,o);return Ba(function(){var l=a,f=l.operator,d=l.source;u.add(f?f.call(u,d):d?a._subscribe(u):a._trySubscribe(u))}),u},e.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(n){r.error(n)}},e.prototype.forEach=function(r,n){var o=this;return n=bh(n),new n(function(a,u){var l=new jl({next:function(f){try{r(f)}catch(d){u(d),l.unsubscribe()}},error:u,complete:a});o.subscribe(l)})},e.prototype._subscribe=function(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)},e.prototype[BP]=function(){return this},e.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return qP(r)(this)},e.prototype.toPromise=function(r){var n=this;return r=bh(r),new r(function(o,a){var u;n.subscribe(function(l){return u=l},function(l){return a(l)},function(){return o(u)})})},e.create=function(r){return new e(r)},e}();function bh(e){var r;return(r=e??gm.Promise)!==null&&r!==void 0?r:Promise}function GP(e){return e&&tr(e.next)&&tr(e.error)&&tr(e.complete)}function KP(e){return e&&e instanceof ym||GP(e)&&mm(e)}var YP=hm(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ni=function(e){os(r,e);function r(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return r.prototype.lift=function(n){var o=new _h(this,this);return o.operator=n,o},r.prototype._throwIfClosed=function(){if(this.closed)throw new YP},r.prototype.next=function(n){var o=this;Ba(function(){var a,u;if(o._throwIfClosed(),!o.isStopped){o.currentObservers||(o.currentObservers=Array.from(o.observers));try{for(var l=El(o.currentObservers),f=l.next();!f.done;f=l.next()){var d=f.value;d.next(n)}}catch(v){a={error:v}}finally{try{f&&!f.done&&(u=l.return)&&u.call(l)}finally{if(a)throw a.error}}}})},r.prototype.error=function(n){var o=this;Ba(function(){if(o._throwIfClosed(),!o.isStopped){o.hasError=o.isStopped=!0,o.thrownError=n;for(var a=o.observers;a.length;)a.shift().error(n)}})},r.prototype.complete=function(){var n=this;Ba(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var o=n.observers;o.length;)o.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},r.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},r.prototype._innerSubscribe=function(n){var o=this,a=this,u=a.hasError,l=a.isStopped,f=a.observers;return u||l?vm:(this.currentObservers=null,f.push(n),new hs(function(){o.currentObservers=null,Nl(f,n)}))},r.prototype._checkFinalizedStatuses=function(n){var o=this,a=o.hasError,u=o.thrownError,l=o.isStopped;a?n.error(u):l&&n.complete()},r.prototype.asObservable=function(){var n=new wh;return n.source=this,n},r.create=function(n,o){return new _h(n,o)},r}(wh),_h=function(e){os(r,e);function r(n,o){var a=e.call(this)||this;return a.destination=n,a.source=o,a}return r.prototype.next=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.next)===null||a===void 0||a.call(o,n)},r.prototype.error=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.error)===null||a===void 0||a.call(o,n)},r.prototype.complete=function(){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||o===void 0||o.call(n)},r.prototype._subscribe=function(n){var o,a;return(a=(o=this.source)===null||o===void 0?void 0:o.subscribe(n))!==null&&a!==void 0?a:vm},r}(ni),wm=(e=>(e.RELOAD="reload",e))(wm||{}),bm=(e=>(e.RENAME="rename",e.TYPE_CHANGE="type-change",e))(bm||{});const XP=new ni,VP=new ni,JP=new ni;var _m=(e=>(e.SAVE_ALL="save-all",e))(_m||{});const ZP=new ni;var Sm=(e=>(e.WILL_SAVE="will-save",e.DID_SAVE="did-save",e.WILL_CREATE="will-create",e.WILL_RENAME="will-rename",e.WILL_DELETE="will-delete",e.DID_CREATE="did-create",e.DID_RENAME="did-rename",e.DID_DELETE="did-delete",e.DIAGNOSTIC_REFRESH="diagnostic-refresh",e))(Sm||{});const QP=new ni;var Em=(e=>(e.RESEND_BREAKPOINTS="resend-breakpoints",e))(Em||{});const eA=new ni,pc=31;var hc=(e=>(e.EMPTY="Please enter a valid name",e[e.LENGTH_EXCEEDED=`The name is too long, it should not exceed ${pc} characters`]="LENGTH_EXCEEDED",e.SHOULD_START_WITH_LETTER="The name can only start with a letter or a Japanese character",e.INVALID="Invalid name",e))(hc||{});function xm(e){if(e==="")throw new Error("Please enter a valid name");if(e.length>pc)throw new Error(hc.LENGTH_EXCEEDED);if(!/^[a-zA-Z\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF]/.test(e))throw new Error("The name can only start with a letter or a Japanese character");if(!/^[\w\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FAF-]+$/i.test(e))throw new Error("Invalid name");return!0}function tA(e){if(!e)return null;if(typeof e=="string")try{xm(e)}catch(r){return r.message}}function nA(e,r){let n="";if(["array","object"].includes(r))try{const o=JSON.parse(e);r==="array"&&(!Array.isArray(o)||!pt.isObject(o))&&(n=`Invalid value for type ${r}`),r==="object"&&(!pt.isObject(o)||Array.isArray(o))&&(n=`Invalid value for type ${r}`)}catch{n=`Invalid value for type ${r}`}return r==="date"&&(new RegExp(/^(0?[1-9]|[12][0-9]|3[01])[/-](0?[1-9]|1[012])[/-]\d{4}$/).test(e)||(n=`Invalid value for type ${r}`)),r==="number"&&isNaN(+e)&&(n=`Invalid value for type ${r}`),["boolean","bool"].includes(r)&&typeof e!="boolean"&&!["true","false"].includes(e)&&(n=`Invalid value for type ${r}`),n}function vs(e){const r=new RegExp(':(?!4D\\.\\w+)[CPK]?\\d+(?=(?:[^"{}\\[\\]\\\\]*(?:\\\\.|"(?:[^"{}\\[\\]\\\\]*\\\\.)*[^"{}\\[\\]\\\\]*"))*[^"}\\]]*$)',"gm");return e.replace(r,"")}var vc=(e=>(e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.WELCOME="welcome",e.SETTINGS="settings",e.ROOT="root",e.REPORTS="report",e))(vc||{});const br={CLASSES:"Classes",METHODS:"Methods",SHARED:"Shared",WEBFORMS:"WebForms",CLASSES_FOLDER:"ClassesFolder",REPORTS:"Reports",DEBUGGER:"Debugger"};var Cn=(e=>(e.FOLDER="folder",e.WEBFORM="webform",e.REPORT="report",e.METHOD="method",e.CLASS="class",e.CLASS_FOLDER="classfolder",e.DEBUGGER="debugger",e.WELCOME="welcome",e.SETTINGS="settings",e.METHODS="method",e.WEBFORMS="webform",e.CLASSES="class",e.DEBUGGERS="debugger",e.MODELS="models",e.ROLES="roles",e.MODEL="model",e.DATA_EXPLORER="dataexplorer",e.MOBILE="mobile",e.MOBILEFORM="mform",e.FILE="file",e.TEXT="text",e))(Cn||{}),ri=(e=>(e.GET_FOLDER="getFolder",e.GET="get",e.SAVE="save",e.RENAME="rename",e.DROP="drop",e.ADD_FOLDER="addFolder",e.CREATE_FOLDER="mkdir",e.RENAME_FOLDER="renameFolder",e.DROP_FOLDER="dropFolder",e.REMOVE_ITEM="removeItem",e.MOVE_ITEM="moveItem",e.GET_INFO="getInfo",e.SAVE_CONTENT="save",e.UPDATE_CHECK="update:check",e.UPDATE_INSTALL="update:install",e.GET_APP_SETTINGS="getWebServerInfo",e.GET_FILE_CONTENT="getFileContent",e.SET_FILE_CONTENT="setFileContent",e.GET_FILES_INFO="getFilesInfo",e))(ri||{}),mc=(e=>(e[e.DISABLED=0]="DISABLED",e[e.ENABLED=1]="ENABLED",e))(mc||{});const Om="roles.json",Tm="qodlyApp.json",rA="model.4DModel",iA="HTTPHandlers.json";function Cm(e){const r=e.split("."),n=r.pop(),o=r.join(".").split("/")[0];switch(!0){case n==="4DModel":return Cn.MODEL;case n==="WebForm":return Cn.WEBFORM;case(["4dm","4qs","4qm"].includes(n)&&o===br.METHODS):return Cn.METHOD;case(["4dm","4qs","4qm"].includes(n)&&o===br.CLASSES):return Cn.CLASS;case e===Om:return Cn.ROLES;case e===Tm:return Cn.SETTINGS;default:return Cn.TEXT}}function oA(e,r=!1){switch(e){case br.REPORTS:case"report":return"QoDoc";case br.WEBFORMS:case"webform":return"WebForm";case"Mobile":case"mform":return"MForm";case"class":case"method":case br.CLASSES:case br.METHODS:return r?"4qs":"4dm";default:return""}}function aA(e,r=""){const n=new RegExp("(?<=\\/)(\\w+)(?=\\.)").exec(e);return n?n[1]:r}class Rm{constructor(){Gd(this,"current",Promise.resolve())}lock(){let r;const n=new Promise(a=>{r=a}),o=this.current.then(()=>r);return this.current=n,o}}function Pm(){const e=new Rm;return async r=>{const n=await e.lock();try{const o=await r();return n(),o}catch(o){console.error(o),n();return}}}const Am=pt.curry((e,r,n)=>e&&pt.get(n,e)===r),sA=pt.curry((e,r,n)=>pt.get(n,e)!==r),uA=pt.curry((e,r)=>pt.get(r,"id")!==e),lA=pt.curry((e,r)=>pt.get(r,"id")===e),cA=pt.curry((e,r)=>pt.get(r,"path")===e);function fA(e="id",r,n){return n.findIndex(Am(e,r))!==-1}function dA(e){if(!e)return"";const{id:r,namespace:n}=e;return n&&r?`${n}:${r}`:r}function Im(e){return["bool","word","string","text","uuid","short","long","number","long64","duration","object","date","image","blob"].includes(e.type||"")}function pA(e){return e.type==="object"}function Lm(e){var r;return e.kind==="relatedEntities"||((r=e.type)==null?void 0:r.includes("Selection"))||e.behavior==="relatedEntities"}function Mm(e){return e.kind==="relatedEntity"||e.behavior==="relatedEntity"||!Im(e)}function hA(e){return Lm(e)||Mm(e)}function vA(e){return e.applyTo==="dataStore"}function mA(e){return e.applyTo==="dataClass"}function gA(e){return e.applyTo==="entity"}function yA(e){return e.applyTo==="entityCollection"}function wA(e){return e.type==="entity"}function bA(e){return e.type==="entitysel"}function Dm(e){return e.dataType==="array"}function km(e){return e.dataType==="object"}function Nm(e){return e.type==="scalar"}function _A(e){return Dm(e)||km(e)||Nm(e)}const SA=e=>e!=null&&e.type==="entity",EA=e=>e.type==="entitysel",xA=e=>e.type==="array"||e.type==="scalar"&&e.dataType==="array",OA=e=>e.type==="object"||e.type==="scalar"&&e.dataType==="object",TA=e=>e.type==="scalar"&&e.dataType==="date";function CA(){return new Promise((e,r)=>{window.addEventListener("bundle:ready",n=>n.data?e():r(n.caughtErr))})}var go=(e=>(e.capable="capable",e.incapable="incapable",e.indifferent="indifferent",e))(go||{}),$m=(e=>(e.soap="soap",e.web="web",e.sql="sql",e.rest="rest",e))($m||{}),gc=(e=>(e.table="table",e.catalog="catalog",e.currentRecord="currentRecord",e.currentSelection="currentSelection",e))(gc||{});const RA={publishedSoap:"soap",publishedWeb:"web",publishedSql:"sql",publishedRest:"rest"};function PA(e){var u;let r={};try{const l=((u=e.match(/\/\/%attributes = (.*)/))==null?void 0:u[1])||"";r=JSON.parse(l)}catch{}const{published4DMobile:n,...o}=r;return{...{invisible:!1,shared:!1,executedOnServer:!1,preemptive:go.indifferent,publishedSoap:!1,publishedWsdl:!1,publishedWeb:!1,publishedSql:!1,publishedRest:!!n,publishedRestOptions:n||{table:"",scope:gc.table}},...o}}function jm(e){const r={};return e.invisible&&(r.invisible=!0),e.shared&&(r.shared=!0),e.executedOnServer&&(r.executedOnServer=!0),e.preemptive&&[go.capable,go.incapable].includes(e.preemptive)&&(r.preemptive=e.preemptive),e.publishedSoap&&(r.publishedSoap=!0,e.publishedWsdl&&(r.publishedWsdl=!0)),e.publishedWeb&&(r.publishedWeb=!0),e.publishedSql&&(r.publishedSql=!0),e.publishedRest&&e.publishedRestOptions&&(r.published4DMobile=e.publishedRestOptions),JSON.stringify(r).replace(/"(true|false)"/g,"$1")}function AA(e,r,n=!1){const o=pt.isString(r)?r:jm(r);if(!n&&Fm(e))return e;const a=Wm(e);return`//%attributes = ${o}\r
205
- ${a}`}function Fm(e){return/^\/\/%attributes.*(?:\r\n|\n)?/g.test(e)}function Wm(e){return e.replace(/^\/\/%attributes.*(?:\r\n|\n)?/g,"")}const IA=()=>Zl.uuid().replaceAll("-","").toUpperCase(),mt="/rest/$designer",Ao="/rest/$designer-ext";function LA(...e){return r=>{if(e.length===0)return r;const n={...r};return e.forEach(o=>{typeof n[o]=="string"&&(n[o]=new Date(n[o]))}),n}}class Fl extends Error{constructor(r,n,o){super(),this.url=r,this.response=n,this.data=o}log(){console.error("Error while sending the request",this)}}async function Ge(e,r){const n=await window.fetch(e,r);if(/401/.test(n.status.toString())&&(window.location.href="/login.html?redirect=studio"),/^[45]/.test(n.status.toString())){let a;try{const u=await n.json();a=new Fl(e,n,u)}catch{a=new Fl(e,n)}throw a.log(),a}return await n.json()}const Kr="/$shared",Sh={[`${Kr}/saved_conditions.json`]:{},[`${Kr}/shared_datasources.json`]:[],[`${Kr}/shared_css.json`]:{},[`${Kr}/CustomComponents/manifest.json`]:[],"WebForms/crafted_components.json":[]};function yc(e){if(!Object.keys(Sh).includes(e))return;const r=e.replace(`${Kr}/`,"Shared/"),n=Sh[e];wc({name:r,content:n,asText:typeof n=="string"})}function ms({path:e,createIfNotExists:r=!1}){const n=`${Kr}/${e}`;return Ge(`${n}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(o=>typeof o=="string"?JSON.parse(o):o).catch(o=>{var a;throw((a=o==null?void 0:o.response)==null?void 0:a.status)===404&&r&&yc(n),o})}function MA(e){return Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function DA(e){return Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const Hm=()=>{const{host:e,protocol:r}=window.location,n=r==="https:";return{projectOpened:!1,remoteDebuggerMode:mc.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${n?"s":""}://${e}/remoteDebugger`,lsp:`ws${n?"s":""}://${e}/LSP`},isRestActive:!0}};async function kA(){const{hostname:e,host:r,protocol:n}=window.location,o=n==="https:";try{const a=await Ge(mt,{method:"POST",body:JSON.stringify({verb:ri.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),u=(()=>{if(a.rendererPath)return a.rendererPath;const l=`http://${e}:${a.webServerHTTPPort}`,f=`https://${e}:${a.webServerHTTPSPort}`;return a.webServerHTTPPort&&a.webServerHTTPSPort?o?f:l:a.webServerHTTPPort?l:f})();return{projectOpened:a.webServerHTTPSPort>0||a.webServerHTTPPort>0,remoteDebuggerMode:a.remoteDebuggerMode,baseUrl:u,qodly:typeof a.qodly>"u"?!0:a.qodly,urls:{renderer:a.rendererPath||`${u}/$lib/renderer/`,debugger:`ws${o?"s":""}://${r}/remoteDebugger`,lsp:`ws${o?"s":""}://${r}/LSP`},isRestActive:a.isRESTActive}}catch(a){return console.error(a),Hm()}}async function Um(e){return await Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function NA(...e){return(await Promise.all(e.map(o=>Um({root:o,verb:ri.GET_FOLDER})))).map(({children:o})=>o.map(({name:a,date:u,type:l})=>({name:a,type:l,date:u,path:`${l}/${a}`}))).flat()}function $A(e,r={}){const{sanitize:n=!0}=r;return Ge(`/rest/$getWebForm/${e}`,{method:"GET"}).then(o=>{if(!(o!=null&&o.components)||!n)return o;const a=new Map;return{...o,components:pt.entries(o.components).map(([u,l])=>{const{resolvedName:f}=l.type;if(f==="WebformLoader"){const d=Zl.generate();a.set(u,d),u=d}return[u,l]}).reduce((u,[l,f])=>{var d;return f.nodes&&(f.nodes=f.nodes.map(v=>a.get(v)||v)),f.linkedNodes&&(f.linkedNodes=pt.entries(f.linkedNodes).reduce((v,[g,_])=>({...v,[g]:a.get(_)||_}),{})),(d=f.props)!=null&&d.events&&(f.props.events=f.props.events.map(v=>(v.type==="navigation"&&v.loader&&(v.loader=a.get(v.loader)||v.loader),v))),{...u,[l]:f}},{})}})}function jA(e){return Ge(mt,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(r=>({...r,content:[Cn.METHOD,Cn.CLASS].includes(r.type)?vs(r.content):r.content}))}function FA(e){return e.type==="folder"?Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function WA(e){return e.type==="folder"?(await Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function HA(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function UA(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function BA(e){return(await Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function zA(...e){return await Ge(mt,{method:"POST",body:JSON.stringify({verb:ri.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function qA(e){const r=await Ge("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return r.isLogged&&r.success}async function GA(){return await Ge("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function KA({name:e,path:r="",root:n="root",asText:o=!1}){return Ge(mt,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:n,path:r,name:e,asText:o}),headers:new Headers({"Content-Type":"application/json"})})}async function YA(e={}){try{return await ms({path:"shared_datasources.json",...e})}catch{return{}}}async function XA(e={}){try{return await ms({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function VA(e={}){try{return await ms({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function JA(){try{return await Ge("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function ZA(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const QA=Pm(),eI=async e=>{const r={verb:ri.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:e};return QA(async()=>(await Ge(mt,{method:"POST",body:JSON.stringify(r),headers:new Headers({"Content-Type":"application/json"})}),e))},wc=async e=>{const r=await Ge(mt,{method:"POST",body:JSON.stringify({...e,verb:ri.SET_FILE_CONTENT,root:vc.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),n=Cm(`${e.path||"Sources"}/${e.name}`);return{...r,type:n,size:0}},tI=async e=>await wc({name:"crafted_components.json",path:br.WEBFORMS,content:e});function nI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function rI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function iI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function oI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}).then(r=>Array.isArray(r)?r:{...r,content:["4dm","4qm","4qs"].includes(r.ext)?vs(r.content):r.content}).catch(r=>{var n,o;((o=(n=r.data)==null?void 0:n.__ERROR[0])==null?void 0:o.errCode)===1839&&yc(e.path)})}function aI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function sI(e){const r=new RegExp(/^\((.+)(?=\))/gi).exec(e);return r!==null?r[1]:""}function uI(e){const r=new RegExp(/(->)(.*)/gi).exec(e);if(r!==null)return r[0].replace("->","");const n=/:([^)]*)$/.exec(e);return n!==null?`result : ${n[1].trim()}`:""}function lI(e){const r=sI(e).split(/[;,]/g).filter(Boolean).map(a=>{const u=a.split(":")[0].trim(),l=a.split(":")[1].trim();return{name:u,type:l}}),n=uI(e),o=n?{name:n.split(":")[0].trim(),type:n.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:r,result:o}}async function cI(e,r){const o=e.split(".").pop();try{const a=await Ge(mt,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:r,functionName:o}),headers:new Headers({"Content-Type":"application/json"})});a.content=vs(a.content);const{params:u,result:l}=lI(a.parameters);return{...a,params:u,returns:l}}catch(a){return console.error(a),{className:r,functionName:o,filePath:e,content:"",params:[]}}}var Bm=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))(Bm||{});function fI(e,r){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...r}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(n=>{})}var zm=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(zm||{}),qm=(e=>(e.WelCome="WelCome",e.ActionPanel="ActionPanel",e.SideBar="SideBar",e.Settings="Settings",e.Main="Main",e.Explorer="Explorer",e.Header="Header",e.ComponentList="ComponentList",e))(qm||{}),Gm=(e=>(e[e.FILE_NOT_FOUND=1839]="FILE_NOT_FOUND",e[e.JSON_MALFORMED=554]="JSON_MALFORMED",e[e.JSON_MALFORMED_AT_LINE=550]="JSON_MALFORMED_AT_LINE",e))(Gm||{});const dI={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},pI={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}};exports.API_PREFIX=mt;exports.AppLoader=sP;exports.ControlledSwitch=om;exports.DATASOURCE_THEMES=dI;exports.DatasourcesActions=bm;exports.DebuggerActions=Em;exports.DesignerRequestVerb=ri;exports.Dialog=EE;exports.DialogBody=$h;exports.EActivity=Bm;exports.EDITOR=pI;exports.EIDENTIFIERS=qm;exports.ERROR_CODES=Gm;exports.EWebFormStyleClassScope=zm;exports.EXT_API_PREFIX=Ao;exports.FileFolderType=Cn;exports.FolderRootPath=br;exports.FolderRootType=vc;exports.HTTPError=Fl;exports.HTTP_HANDLERS_PATH=iA;exports.IPreemptive=go;exports.IPublished=$m;exports.IPublishedRestScope=gc;exports.IdentityProvider=MP;exports.Incase=vO;exports.IndentLines=dv;exports.LogoSVG=am;exports.LspActions=Sm;exports.MAX_FILE_NAME_LENGTH=pc;exports.MODEL_TAB_PATH=rA;exports.Modal=lP;exports.ModalCloseReason=Ti;exports.ModalColor=Vr;exports.ModalIcons=Dl;exports.ModalType=dc;exports.Mutex=Rm;exports.NameError=hc;exports.Overlay=Nh;exports.Portal=Oh;exports.PublishOptions=RA;exports.ROLES_TAB_PATH=Om;exports.RemoteDebuggerMode=mc;exports.SETTINGS_TAB_PATH=Tm;exports.SHARED_API_PREFIX=Kr;exports.Switcher=pv;exports.TabEventsActions=_m;exports.Tip=lR;exports.TipsProvider=sR;exports.Toast=kx;exports.Tooltip=oP;exports.Tree=hO;exports.TreeIcon=sv;exports.TreeNode=Ql;exports.WebformActions=wm;exports._isArrayDatasource=xA;exports._isObjectDatasource=OA;exports.addAttributesToContent=AA;exports.addFolder=HA;exports.by=Am;exports.byId=lA;exports.byPath=cA;exports.checkUpdates=MA;exports.createFolder=nI;exports.datasourcesSubject=XP;exports.debuggerSubject=eA;exports.dropFile=WA;exports.dropFolder=BA;exports.exists=fA;exports.extractWebformName=aA;exports.generateUUID=IA;exports.getAppSettings=kA;exports.getCatalog=GA;exports.getDatasourceId=dA;exports.getDefaultAppSettings=Hm;exports.getFile=jA;exports.getFileContent=KA;exports.getFileExtentionFromType=oA;exports.getFilesInfo=zA;exports.getFolder=Um;exports.getFolders=NA;exports.getFunctionContent=cI;exports.getMonacoTheme=ZA;exports.getNodeInfo=oI;exports.getSavedConditions=VA;exports.getSharedCSS=XA;exports.getSharedDatasources=YA;exports.getSharedResource=ms;exports.getTypeFromExtension=Cm;exports.getUserPrivileges=JA;exports.getWebForm=$A;exports.hasAttributesString=Fm;exports.http=Ge;exports.installUpdates=DA;exports.isArrayDatasource=Dm;exports.isDataClassMethod=mA;exports.isDataStoreMethod=vA;exports.isDateDatasource=TA;exports.isEntity=SA;exports.isEntityDatasource=wA;exports.isEntityMethod=gA;exports.isEntitySelection=EA;exports.isEntitySelectionDatasource=bA;exports.isEntitySelectionMethod=yA;exports.isObjectAttribute=pA;exports.isObjectDatasource=km;exports.isRelatedAttribute=hA;exports.isRelatedEntitiesAttribute=Lm;exports.isRelatedEntityAttribute=Mm;exports.isScalarDatasource=Nm;exports.isSimpleAttribute=Im;exports.isSimpleDatasource=_A;exports.loadDS=CA;exports.log=fI;exports.login=qA;exports.lspSubject=QP;exports.moveItem=iI;exports.outBy=sA;exports.outById=uA;exports.parseAttributes=PA;exports.queue=Pm;exports.removeAttributesString=Wm;exports.removeItem=rI;exports.renameFile=FA;exports.renameFolder=UA;exports.sanitizeContent=vs;exports.saveContent=aI;exports.setCraftedComponents=tI;exports.setFileContent=wc;exports.setSharedSources=eI;exports.stringifyAttributes=jm;exports.tabEventsSubject=ZP;exports.toastSubject=JP;exports.transformDates=LA;exports.tryCreateSharedResource=yc;exports.useDidMountEffect=dP;exports.useDoubleClick=$P;exports.useFeatureFlags=LP;exports.useForwardedRef=IP;exports.useHotkeys=CP;exports.useIdentity=DP;exports.useOutsideClick=RP;exports.usePrevious=PP;exports.useStateObject=kP;exports.useStateRef=AP;exports.useTip=Kv;exports.validateName=xm;exports.validateServerSide=tA;exports.validateValue=nA;exports.webformSubject=VP;
205
+ ${a}`}function Fm(e){return/^\/\/%attributes.*(?:\r\n|\n)?/g.test(e)}function Wm(e){return e.replace(/^\/\/%attributes.*(?:\r\n|\n)?/g,"")}const IA=()=>Zl.uuid().replaceAll("-","").toUpperCase(),mt="/rest/$designer",Ao="/rest/$designer-ext";function LA(...e){return r=>{if(e.length===0)return r;const n={...r};return e.forEach(o=>{typeof n[o]=="string"&&(n[o]=new Date(n[o]))}),n}}class Fl extends Error{constructor(r,n,o){super(),this.url=r,this.response=n,this.data=o}log(){console.error("Error while sending the request",this)}}async function Ge(e,r){const n=await window.fetch(e,r);if(/401/.test(n.status.toString())&&(window.location.href="/login.html?redirect=studio"),/^[45]/.test(n.status.toString())){let a;try{const u=await n.json();a=new Fl(e,n,u)}catch{a=new Fl(e,n)}throw a.log(),a}return await n.json()}const Kr="/$shared",Sh={[`${Kr}/saved_conditions.json`]:{},[`${Kr}/shared_datasources.json`]:[],[`${Kr}/shared_css.json`]:{},[`${Kr}/CustomComponents/manifest.json`]:[],"WebForms/crafted_components.json":[]};function yc(e){if(!Object.keys(Sh).includes(e))return;const r=e.replace(`${Kr}/`,"Shared/"),n=Sh[e];wc({name:r,content:n,asText:typeof n=="string"})}function ms({path:e,createIfNotExists:r=!1}){const n=`${Kr}/${e}`;return Ge(`${n}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(o=>typeof o=="string"?JSON.parse(o):o).catch(o=>{var a;throw((a=o==null?void 0:o.response)==null?void 0:a.status)===404&&r&&yc(n),o})}function MA(e){return Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function DA(e){return Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const Hm=()=>{const{host:e,protocol:r}=window.location,n=r==="https:";return{projectOpened:!1,remoteDebuggerMode:mc.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${n?"s":""}://${e}/remoteDebugger`,lsp:`ws${n?"s":""}://${e}/LSP`},isRestActive:!0}};async function kA(){const{hostname:e,host:r,protocol:n}=window.location,o=n==="https:";try{const a=await Ge(mt,{method:"POST",body:JSON.stringify({verb:ri.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),u=(()=>{if(a.rendererPath)return a.rendererPath;const l=`http://${e}:${a.webServerHTTPPort}`,f=`https://${e}:${a.webServerHTTPSPort}`;return a.webServerHTTPPort&&a.webServerHTTPSPort?o?f:l:a.webServerHTTPPort?l:f})();return{projectOpened:a.webServerHTTPSPort>0||a.webServerHTTPPort>0,remoteDebuggerMode:a.remoteDebuggerMode,baseUrl:u,qodly:typeof a.qodly>"u"?!0:a.qodly,urls:{renderer:a.rendererPath||`${u}/$lib/renderer/`,debugger:`ws${o?"s":""}://${r}/remoteDebugger`,lsp:`ws${o?"s":""}://${r}/LSP`},isRestActive:a.isRESTActive}}catch(a){return console.error(a),Hm()}}async function Um(e){return await Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function NA(...e){return(await Promise.all(e.map(o=>Um({root:o,verb:ri.GET_FOLDER})))).map(({children:o})=>o.map(({name:a,date:u,type:l})=>({name:a,type:l,date:u,path:`${l}/${a}`}))).flat()}function $A(e,r={}){const{sanitize:n=!0}=r;return Ge(`/rest/$getWebForm/${e}`,{method:"GET"}).then(o=>{if(!(o!=null&&o.components)||!n)return o;const a=new Map;return{...o,components:pt.entries(o.components).map(([u,l])=>{const{resolvedName:f}=l.type;if(f==="WebformLoader"){const d=Zl.generate();a.set(u,d),u=d}return[u,l]}).reduce((u,[l,f])=>{var d;return f.nodes&&(f.nodes=f.nodes.map(v=>a.get(v)||v)),f.linkedNodes&&(f.linkedNodes=pt.entries(f.linkedNodes).reduce((v,[g,_])=>({...v,[g]:a.get(_)||_}),{})),(d=f.props)!=null&&d.events&&(f.props.events=f.props.events.map(v=>(v.type==="navigation"&&v.loader&&(v.loader=a.get(v.loader)||v.loader),v))),{...u,[l]:f}},{})}})}function jA(e){return Ge(mt,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(r=>({...r,content:[Cn.METHOD,Cn.CLASS].includes(r.type)?vs(r.content):r.content}))}function FA(e){return e.type==="folder"?Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function WA(e){return e.type==="folder"?(await Ge(Ao,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function HA(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function UA(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function BA(e){return(await Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function zA(...e){return await Ge(mt,{method:"POST",body:JSON.stringify({verb:ri.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function qA(e){const r=await Ge("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return r.isLogged&&r.success}async function GA(){return await Ge("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function KA({name:e,path:r="",root:n="root",asText:o=!1}){return Ge(mt,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:n,path:r,name:e,asText:o}),headers:new Headers({"Content-Type":"application/json"})})}async function YA(e={}){try{return await ms({path:"shared_datasources.json",...e})}catch{return{}}}async function XA(e={}){try{return await ms({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function VA(e={}){try{return await ms({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function JA(){try{return await Ge("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function ZA(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const QA=Pm(),eI=async e=>{const r={verb:ri.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:e};return QA(async()=>(await Ge(mt,{method:"POST",body:JSON.stringify(r),headers:new Headers({"Content-Type":"application/json"})}),e))},wc=async e=>{const r=await Ge(mt,{method:"POST",body:JSON.stringify({...e,verb:ri.SET_FILE_CONTENT,root:vc.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),n=Cm(`${e.path||"Sources"}/${e.name}`);return{...r,type:n,size:0}},tI=async e=>await wc({name:"crafted_components.json",path:br.WEBFORMS,content:e});function nI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function rI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function iI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function oI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}).then(r=>Array.isArray(r)?r:{...r,content:["4dm","4qm","4qs"].includes(r.ext)?vs(r.content):r.content}).catch(r=>{var n,o;throw((o=(n=r.data)==null?void 0:n.__ERROR[0])==null?void 0:o.errCode)===1839&&yc(e.path),r})}function aI(e){return Ge(mt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function sI(e){const r=new RegExp(/^\((.+)(?=\))/gi).exec(e);return r!==null?r[1]:""}function uI(e){const r=new RegExp(/(->)(.*)/gi).exec(e);if(r!==null)return r[0].replace("->","");const n=/:([^)]*)$/.exec(e);return n!==null?`result : ${n[1].trim()}`:""}function lI(e){const r=sI(e).split(/[;,]/g).filter(Boolean).map(a=>{const u=a.split(":")[0].trim(),l=a.split(":")[1].trim();return{name:u,type:l}}),n=uI(e),o=n?{name:n.split(":")[0].trim(),type:n.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:r,result:o}}async function cI(e,r){const o=e.split(".").pop();try{const a=await Ge(mt,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:r,functionName:o}),headers:new Headers({"Content-Type":"application/json"})});a.content=vs(a.content);const{params:u,result:l}=lI(a.parameters);return{...a,params:u,returns:l}}catch(a){return console.error(a),{className:r,functionName:o,filePath:e,content:"",params:[]}}}var Bm=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))(Bm||{});function fI(e,r){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...r}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(n=>{})}var zm=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(zm||{}),qm=(e=>(e.WelCome="WelCome",e.ActionPanel="ActionPanel",e.SideBar="SideBar",e.Settings="Settings",e.Main="Main",e.Explorer="Explorer",e.Header="Header",e.ComponentList="ComponentList",e))(qm||{}),Gm=(e=>(e[e.FILE_NOT_FOUND=1839]="FILE_NOT_FOUND",e[e.JSON_MALFORMED=554]="JSON_MALFORMED",e[e.JSON_MALFORMED_AT_LINE=550]="JSON_MALFORMED_AT_LINE",e))(Gm||{});const dI={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},pI={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}};exports.API_PREFIX=mt;exports.AppLoader=sP;exports.ControlledSwitch=om;exports.DATASOURCE_THEMES=dI;exports.DatasourcesActions=bm;exports.DebuggerActions=Em;exports.DesignerRequestVerb=ri;exports.Dialog=EE;exports.DialogBody=$h;exports.EActivity=Bm;exports.EDITOR=pI;exports.EIDENTIFIERS=qm;exports.ERROR_CODES=Gm;exports.EWebFormStyleClassScope=zm;exports.EXT_API_PREFIX=Ao;exports.FileFolderType=Cn;exports.FolderRootPath=br;exports.FolderRootType=vc;exports.HTTPError=Fl;exports.HTTP_HANDLERS_PATH=iA;exports.IPreemptive=go;exports.IPublished=$m;exports.IPublishedRestScope=gc;exports.IdentityProvider=MP;exports.Incase=vO;exports.IndentLines=dv;exports.LogoSVG=am;exports.LspActions=Sm;exports.MAX_FILE_NAME_LENGTH=pc;exports.MODEL_TAB_PATH=rA;exports.Modal=lP;exports.ModalCloseReason=Ti;exports.ModalColor=Vr;exports.ModalIcons=Dl;exports.ModalType=dc;exports.Mutex=Rm;exports.NameError=hc;exports.Overlay=Nh;exports.Portal=Oh;exports.PublishOptions=RA;exports.ROLES_TAB_PATH=Om;exports.RemoteDebuggerMode=mc;exports.SETTINGS_TAB_PATH=Tm;exports.SHARED_API_PREFIX=Kr;exports.Switcher=pv;exports.TabEventsActions=_m;exports.Tip=lR;exports.TipsProvider=sR;exports.Toast=kx;exports.Tooltip=oP;exports.Tree=hO;exports.TreeIcon=sv;exports.TreeNode=Ql;exports.WebformActions=wm;exports._isArrayDatasource=xA;exports._isObjectDatasource=OA;exports.addAttributesToContent=AA;exports.addFolder=HA;exports.by=Am;exports.byId=lA;exports.byPath=cA;exports.checkUpdates=MA;exports.createFolder=nI;exports.datasourcesSubject=XP;exports.debuggerSubject=eA;exports.dropFile=WA;exports.dropFolder=BA;exports.exists=fA;exports.extractWebformName=aA;exports.generateUUID=IA;exports.getAppSettings=kA;exports.getCatalog=GA;exports.getDatasourceId=dA;exports.getDefaultAppSettings=Hm;exports.getFile=jA;exports.getFileContent=KA;exports.getFileExtentionFromType=oA;exports.getFilesInfo=zA;exports.getFolder=Um;exports.getFolders=NA;exports.getFunctionContent=cI;exports.getMonacoTheme=ZA;exports.getNodeInfo=oI;exports.getSavedConditions=VA;exports.getSharedCSS=XA;exports.getSharedDatasources=YA;exports.getSharedResource=ms;exports.getTypeFromExtension=Cm;exports.getUserPrivileges=JA;exports.getWebForm=$A;exports.hasAttributesString=Fm;exports.http=Ge;exports.installUpdates=DA;exports.isArrayDatasource=Dm;exports.isDataClassMethod=mA;exports.isDataStoreMethod=vA;exports.isDateDatasource=TA;exports.isEntity=SA;exports.isEntityDatasource=wA;exports.isEntityMethod=gA;exports.isEntitySelection=EA;exports.isEntitySelectionDatasource=bA;exports.isEntitySelectionMethod=yA;exports.isObjectAttribute=pA;exports.isObjectDatasource=km;exports.isRelatedAttribute=hA;exports.isRelatedEntitiesAttribute=Lm;exports.isRelatedEntityAttribute=Mm;exports.isScalarDatasource=Nm;exports.isSimpleAttribute=Im;exports.isSimpleDatasource=_A;exports.loadDS=CA;exports.log=fI;exports.login=qA;exports.lspSubject=QP;exports.moveItem=iI;exports.outBy=sA;exports.outById=uA;exports.parseAttributes=PA;exports.queue=Pm;exports.removeAttributesString=Wm;exports.removeItem=rI;exports.renameFile=FA;exports.renameFolder=UA;exports.sanitizeContent=vs;exports.saveContent=aI;exports.setCraftedComponents=tI;exports.setFileContent=wc;exports.setSharedSources=eI;exports.stringifyAttributes=jm;exports.tabEventsSubject=ZP;exports.toastSubject=JP;exports.transformDates=LA;exports.tryCreateSharedResource=yc;exports.useDidMountEffect=dP;exports.useDoubleClick=$P;exports.useFeatureFlags=LP;exports.useForwardedRef=IP;exports.useHotkeys=CP;exports.useIdentity=DP;exports.useOutsideClick=RP;exports.usePrevious=PP;exports.useStateObject=kP;exports.useStateRef=AP;exports.useTip=Kv;exports.validateName=xm;exports.validateServerSide=tA;exports.validateValue=nA;exports.webformSubject=VP;
206
206
  //# sourceMappingURL=index.cjs.js.map