@nocobase/app 2.0.0-alpha.25 → 2.0.0-alpha.26

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.
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[5505],{18589:function(U,e){var _;_=!0,_=void 0;var j=`
2
+ `,v="\r",k=function(){function f(c){this.string=c;for(var s=[0],l=0;l<c.length;)switch(c[l]){case j:l+=j.length,s.push(l);break;case v:l+=v.length,c[l]===j&&(l+=j.length),s.push(l);break;default:l++;break}this.offsets=s}return f.prototype.locationForIndex=function(c){if(c<0||c>this.string.length)return null;for(var s=0,l=this.offsets;l[s+1]<=c;)s++;var o=c-l[s];return{line:s,column:o}},f.prototype.indexForLocation=function(c){var s=c.line,l=c.column;return s<0||s>=this.offsets.length||l<0||l>this.lengthOfLine(s)?null:this.offsets[s]+l},f.prototype.lengthOfLine=function(c){var s=this.offsets[c],l=c===this.offsets.length-1?this.string.length:this.offsets[c+1];return l-s},f}();_=k,e.ZP=k},41074:function(U,e,_){var j=this&&this.__spreadArrays||function(){for(var o=0,u=0,h=arguments.length;u<h;u++)o+=arguments[u].length;for(var g=Array(o),d=0,u=0;u<h;u++)for(var O=arguments[u],E=0,I=O.length;E<I;E++,d++)g[d]=O[E];return g};Object.defineProperty(e,"__esModule",{value:!0}),e.Checker=e.createCheckers=void 0;var v=_(22746),k=_(67180),f=_(22746);Object.defineProperty(e,"TArray",{enumerable:!0,get:function(){return f.TArray}}),Object.defineProperty(e,"TEnumType",{enumerable:!0,get:function(){return f.TEnumType}}),Object.defineProperty(e,"TEnumLiteral",{enumerable:!0,get:function(){return f.TEnumLiteral}}),Object.defineProperty(e,"TFunc",{enumerable:!0,get:function(){return f.TFunc}}),Object.defineProperty(e,"TIface",{enumerable:!0,get:function(){return f.TIface}}),Object.defineProperty(e,"TLiteral",{enumerable:!0,get:function(){return f.TLiteral}}),Object.defineProperty(e,"TName",{enumerable:!0,get:function(){return f.TName}}),Object.defineProperty(e,"TOptional",{enumerable:!0,get:function(){return f.TOptional}}),Object.defineProperty(e,"TParam",{enumerable:!0,get:function(){return f.TParam}}),Object.defineProperty(e,"TParamList",{enumerable:!0,get:function(){return f.TParamList}}),Object.defineProperty(e,"TProp",{enumerable:!0,get:function(){return f.TProp}}),Object.defineProperty(e,"TTuple",{enumerable:!0,get:function(){return f.TTuple}}),Object.defineProperty(e,"TType",{enumerable:!0,get:function(){return f.TType}}),Object.defineProperty(e,"TUnion",{enumerable:!0,get:function(){return f.TUnion}}),Object.defineProperty(e,"TIntersection",{enumerable:!0,get:function(){return f.TIntersection}}),Object.defineProperty(e,"array",{enumerable:!0,get:function(){return f.array}}),Object.defineProperty(e,"enumlit",{enumerable:!0,get:function(){return f.enumlit}}),Object.defineProperty(e,"enumtype",{enumerable:!0,get:function(){return f.enumtype}}),Object.defineProperty(e,"func",{enumerable:!0,get:function(){return f.func}}),Object.defineProperty(e,"iface",{enumerable:!0,get:function(){return f.iface}}),Object.defineProperty(e,"lit",{enumerable:!0,get:function(){return f.lit}}),Object.defineProperty(e,"name",{enumerable:!0,get:function(){return f.name}}),Object.defineProperty(e,"opt",{enumerable:!0,get:function(){return f.opt}}),Object.defineProperty(e,"param",{enumerable:!0,get:function(){return f.param}}),Object.defineProperty(e,"tuple",{enumerable:!0,get:function(){return f.tuple}}),Object.defineProperty(e,"union",{enumerable:!0,get:function(){return f.union}}),Object.defineProperty(e,"intersection",{enumerable:!0,get:function(){return f.intersection}}),Object.defineProperty(e,"BasicType",{enumerable:!0,get:function(){return f.BasicType}});var c=_(67180);Object.defineProperty(e,"VError",{enumerable:!0,get:function(){return c.VError}});function s(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];for(var h=Object.assign.apply(Object,j([{},v.basicTypes],o)),g={},d=0,O=o;d<O.length;d++)for(var E=O[d],I=0,S=Object.keys(E);I<S.length;I++){var M=S[I];g[M]=new l(h,E[M])}return g}e.createCheckers=s;var l=function(){function o(u,h,g){if(g===void 0&&(g="value"),this.suite=u,this.ttype=h,this._path=g,this.props=new Map,h instanceof v.TIface)for(var d=0,O=h.props;d<O.length;d++){var E=O[d];this.props.set(E.name,E.ttype)}this.checkerPlain=this.ttype.getChecker(u,!1),this.checkerStrict=this.ttype.getChecker(u,!0)}return o.prototype.setReportedPath=function(u){this._path=u},o.prototype.check=function(u){return this._doCheck(this.checkerPlain,u)},o.prototype.test=function(u){return this.checkerPlain(u,new k.NoopContext)},o.prototype.validate=function(u){return this._doValidate(this.checkerPlain,u)},o.prototype.strictCheck=function(u){return this._doCheck(this.checkerStrict,u)},o.prototype.strictTest=function(u){return this.checkerStrict(u,new k.NoopContext)},o.prototype.strictValidate=function(u){return this._doValidate(this.checkerStrict,u)},o.prototype.getProp=function(u){var h=this.props.get(u);if(!h)throw new Error("Type has no property "+u);return new o(this.suite,h,this._path+"."+u)},o.prototype.methodArgs=function(u){var h=this._getMethod(u);return new o(this.suite,h.paramList)},o.prototype.methodResult=function(u){var h=this._getMethod(u);return new o(this.suite,h.result)},o.prototype.getArgs=function(){if(!(this.ttype instanceof v.TFunc))throw new Error("getArgs() applied to non-function");return new o(this.suite,this.ttype.paramList)},o.prototype.getResult=function(){if(!(this.ttype instanceof v.TFunc))throw new Error("getResult() applied to non-function");return new o(this.suite,this.ttype.result)},o.prototype.getType=function(){return this.ttype},o.prototype._doCheck=function(u,h){var g=new k.NoopContext;if(!u(h,g)){var d=new k.DetailContext;throw u(h,d),d.getError(this._path)}},o.prototype._doValidate=function(u,h){var g=new k.NoopContext;if(u(h,g))return null;var d=new k.DetailContext;return u(h,d),d.getErrorDetail(this._path)},o.prototype._getMethod=function(u){var h=this.props.get(u);if(!h)throw new Error("Type has no property "+u);if(!(h instanceof v.TFunc))throw new Error("Property "+u+" is not a method");return h},o}();e.Checker=l},22746:function(U,e,_){var j=_(48764).lW,v=this&&this.__extends||function(){var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var p in a)a.hasOwnProperty(p)&&(i[p]=a[p])},t(n,r)};return function(n,r){t(n,r);function i(){this.constructor=n}n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.basicTypes=e.BasicType=e.TParamList=e.TParam=e.param=e.TFunc=e.func=e.TProp=e.TOptional=e.opt=e.TIface=e.iface=e.TEnumLiteral=e.enumlit=e.TEnumType=e.enumtype=e.TIntersection=e.intersection=e.TUnion=e.union=e.TTuple=e.tuple=e.TArray=e.array=e.TLiteral=e.lit=e.TName=e.name=e.TType=void 0;var k=_(67180),f=function(){function t(){}return t}();e.TType=f;function c(t){return typeof t=="string"?l(t):t}function s(t,n){var r=t[n];if(!r)throw new Error("Unknown type "+n);return r}function l(t){return new o(t)}e.name=l;var o=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.name=r,i._failMsg="is not a "+r,i}return n.prototype.getChecker=function(r,i,a){var p=this,y=s(r,this.name),m=y.getChecker(r,i,a);return y instanceof C||y instanceof n?m:function(b,T){return m(b,T)?!0:T.fail(null,p._failMsg,0)}},n}(f);e.TName=o;function u(t){return new h(t)}e.lit=u;var h=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.value=r,i.name=JSON.stringify(r),i._failMsg="is not "+i.name,i}return n.prototype.getChecker=function(r,i){var a=this;return function(p,y){return p===a.value?!0:y.fail(null,a._failMsg,-1)}},n}(f);e.TLiteral=h;function g(t){return new d(c(t))}e.array=g;var d=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.ttype=r,i}return n.prototype.getChecker=function(r,i){var a=this.ttype.getChecker(r,i);return function(p,y){if(!Array.isArray(p))return y.fail(null,"is not an array",0);for(var m=0;m<p.length;m++){var b=a(p[m],y);if(!b)return y.fail(m,null,1)}return!0}},n}(f);e.TArray=d;function O(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new E(t.map(function(r){return c(r)}))}e.tuple=O;var E=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.ttypes=r,i}return n.prototype.getChecker=function(r,i){var a=this.ttypes.map(function(y){return y.getChecker(r,i)}),p=function(y,m){if(!Array.isArray(y))return m.fail(null,"is not an array",0);for(var b=0;b<a.length;b++){var T=a[b](y[b],m);if(!T)return m.fail(b,null,1)}return!0};return i?function(y,m){return p(y,m)?y.length<=a.length?!0:m.fail(a.length,"is extraneous",2):!1}:p},n}(f);e.TTuple=E;function I(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new S(t.map(function(r){return c(r)}))}e.union=I;var S=function(t){v(n,t);function n(r){var i=t.call(this)||this;i.ttypes=r;var a=r.map(function(y){return y instanceof o||y instanceof h?y.name:null}).filter(function(y){return y}),p=r.length-a.length;return a.length?(p>0&&a.push(p+" more"),i._failMsg="is none of "+a.join(", ")):i._failMsg="is none of "+p+" types",i}return n.prototype.getChecker=function(r,i){var a=this,p=this.ttypes.map(function(y){return y.getChecker(r,i)});return function(y,m){for(var b=m.unionResolver(),T=0;T<p.length;T++){var P=p[T](y,b.createContext());if(P)return!0}return m.resolveUnion(b),m.fail(null,a._failMsg,0)}},n}(f);e.TUnion=S;function M(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new J(t.map(function(r){return c(r)}))}e.intersection=M;var J=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.ttypes=r,i}return n.prototype.getChecker=function(r,i){var a=new Set,p=this.ttypes.map(function(y){return y.getChecker(r,i,a)});return function(y,m){var b=p.every(function(T){return T(y,m)});return b?!0:m.fail(null,null,0)}},n}(f);e.TIntersection=J;function Y(t){return new R(t)}e.enumtype=Y;var R=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.members=r,i.validValues=new Set,i._failMsg="is not a valid enum value",i.validValues=new Set(Object.keys(r).map(function(a){return r[a]})),i}return n.prototype.getChecker=function(r,i){var a=this;return function(p,y){return a.validValues.has(p)?!0:y.fail(null,a._failMsg,0)}},n}(f);e.TEnumType=R;function $(t,n){return new W(t,n)}e.enumlit=$;var W=function(t){v(n,t);function n(r,i){var a=t.call(this)||this;return a.enumName=r,a.prop=i,a._failMsg="is not "+r+"."+i,a}return n.prototype.getChecker=function(r,i){var a=this,p=s(r,this.enumName);if(!(p instanceof R))throw new Error("Type "+this.enumName+" used in enumlit is not an enum type");var y=p.members[this.prop];if(!p.members.hasOwnProperty(this.prop))throw new Error("Unknown value "+this.enumName+"."+this.prop+" used in enumlit");return function(m,b){return m===y?!0:b.fail(null,a._failMsg,-1)}},n}(f);e.TEnumLiteral=W;function q(t){return Object.keys(t).map(function(n){return x(n,t[n])})}function x(t,n){return n instanceof D?new V(t,n.ttype,!0):new V(t,c(n),!1)}function tt(t,n){return new Z(t,q(n))}e.iface=tt;var Z=function(t){v(n,t);function n(r,i){var a=t.call(this)||this;return a.bases=r,a.props=i,a.propSet=new Set(i.map(function(p){return p.name})),a}return n.prototype.getChecker=function(r,i,a){var p=this,y=this.bases.map(function(w){return s(r,w).getChecker(r,i)}),m=this.props.map(function(w){return w.ttype.getChecker(r,i)}),b=new k.NoopContext,T=this.props.map(function(w,A){return!w.isOpt&&!m[A](void 0,b)}),P=function(w,A){if(typeof w!="object"||w===null)return A.fail(null,"is not an object",0);for(var N=0;N<y.length;N++)if(!y[N](w,A))return!1;for(var N=0;N<m.length;N++){var F=p.props[N].name,X=w[F];if(X===void 0){if(T[N])return A.fail(F,"is missing",1)}else{var at=m[N](X,A);if(!at)return A.fail(F,null,1)}}return!0};if(!i)return P;var L=this.propSet;return a&&(this.propSet.forEach(function(w){return a.add(w)}),L=a),function(w,A){if(!P(w,A))return!1;for(var N in w)if(!L.has(N))return A.fail(N,"is extraneous",2);return!0}},n}(f);e.TIface=Z;function et(t){return new D(c(t))}e.opt=et;var D=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.ttype=r,i}return n.prototype.getChecker=function(r,i){var a=this.ttype.getChecker(r,i);return function(p,y){return p===void 0||a(p,y)}},n}(f);e.TOptional=D;var V=function(){function t(n,r,i){this.name=n,this.ttype=r,this.isOpt=i}return t}();e.TProp=V;function nt(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return new z(new H(n),c(t))}e.func=nt;var z=function(t){v(n,t);function n(r,i){var a=t.call(this)||this;return a.paramList=r,a.result=i,a}return n.prototype.getChecker=function(r,i){return function(a,p){return typeof a=="function"?!0:p.fail(null,"is not a function",0)}},n}(f);e.TFunc=z;function rt(t,n,r){return new G(t,c(n),!!r)}e.param=rt;var G=function(){function t(n,r,i){this.name=n,this.ttype=r,this.isOpt=i}return t}();e.TParam=G;var H=function(t){v(n,t);function n(r){var i=t.call(this)||this;return i.params=r,i}return n.prototype.getChecker=function(r,i){var a=this,p=this.params.map(function(T){return T.ttype.getChecker(r,i)}),y=new k.NoopContext,m=this.params.map(function(T,P){return!T.isOpt&&!p[P](void 0,y)}),b=function(T,P){if(!Array.isArray(T))return P.fail(null,"is not an array",0);for(var L=0;L<p.length;L++){var w=a.params[L];if(T[L]===void 0){if(m[L])return P.fail(w.name,"is missing",1)}else{var A=p[L](T[L],P);if(!A)return P.fail(w.name,null,1)}}return!0};return i?function(T,P){return b(T,P)?T.length<=p.length?!0:P.fail(p.length,"is extraneous",2):!1}:b},n}(f);e.TParamList=H;var C=function(t){v(n,t);function n(r,i){var a=t.call(this)||this;return a.validator=r,a.message=i,a}return n.prototype.getChecker=function(r,i){var a=this;return function(p,y){return a.validator(p)?!0:y.fail(null,a.message,0)}},n}(f);e.BasicType=C,e.basicTypes={any:new C(function(t){return!0},"is invalid"),number:new C(function(t){return typeof t=="number"},"is not a number"),object:new C(function(t){return typeof t=="object"&&t},"is not an object"),boolean:new C(function(t){return typeof t=="boolean"},"is not a boolean"),string:new C(function(t){return typeof t=="string"},"is not a string"),symbol:new C(function(t){return typeof t=="symbol"},"is not a symbol"),void:new C(function(t){return t==null},"is not void"),undefined:new C(function(t){return t===void 0},"is not undefined"),null:new C(function(t){return t===null},"is not null"),never:new C(function(t){return!1},"is unexpected"),Date:new C(K("[object Date]"),"is not a Date"),RegExp:new C(K("[object RegExp]"),"is not a RegExp")};var it=Object.prototype.toString;function K(t){return function(n){return typeof n=="object"&&n&&it.call(n)===t}}typeof j<"u"&&(e.basicTypes.Buffer=new C(function(t){return j.isBuffer(t)},"is not a Buffer"));for(var ut=function(t){e.basicTypes[t.name]=new C(function(n){return n instanceof t},"is not a "+t.name)},B=0,Q=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,ArrayBuffer];B<Q.length;B++){var ot=Q[B];ut(ot)}},67180:function(U,e){var _=this&&this.__extends||function(){var c=function(s,l){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var h in u)u.hasOwnProperty(h)&&(o[h]=u[h])},c(s,l)};return function(s,l){c(s,l);function o(){this.constructor=s}s.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.DetailContext=e.NoopContext=e.VError=void 0;var j=function(c){_(s,c);function s(l,o){var u=c.call(this,o)||this;return u.path=l,Object.setPrototypeOf(u,s.prototype),u}return s}(Error);e.VError=j;var v=function(){function c(){}return c.prototype.fail=function(s,l,o){return!1},c.prototype.unionResolver=function(){return this},c.prototype.createContext=function(){return this},c.prototype.resolveUnion=function(s){},c}();e.NoopContext=v;var k=function(){function c(){this._propNames=[""],this._messages=[null],this._score=0}return c.prototype.fail=function(s,l,o){return this._propNames.push(s),this._messages.push(l),this._score+=o,!1},c.prototype.unionResolver=function(){return new f},c.prototype.resolveUnion=function(s){for(var l,o,u=s,h=null,g=0,d=u.contexts;g<d.length;g++){var O=d[g];(!h||O._score>=h._score)&&(h=O)}h&&h._score>0&&((l=this._propNames).push.apply(l,h._propNames),(o=this._messages).push.apply(o,h._messages))},c.prototype.getError=function(s){for(var l=[],o=this._propNames.length-1;o>=0;o--){var u=this._propNames[o];s+=typeof u=="number"?"["+u+"]":u?"."+u:"";var h=this._messages[o];h&&l.push(s+" "+h)}return new j(s,l.join("; "))},c.prototype.getErrorDetail=function(s){for(var l=[],o=this._propNames.length-1;o>=0;o--){var u=this._propNames[o];s+=typeof u=="number"?"["+u+"]":u?"."+u:"";var h=this._messages[o];h&&l.push({path:s,message:h})}for(var g=null,o=l.length-1;o>=0;o--)g&&(l[o].nested=[g]),g=l[o];return g},c}();e.DetailContext=k;var f=function(){function c(){this.contexts=[]}return c.prototype.createContext=function(){var s=new k;return this.contexts.push(s),s},c}()}}]);
@@ -1,11 +1,10 @@
1
- "use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[645,95],{10095:function(a,n,e){e.r(n),e.d(n,{JSBlockRunJSContext:function(){return s}});var o=e(72004),r=e.n(o),l=e(12444),_=e.n(l),i=e(31996),c=e.n(i),u=e(26037),d=e.n(u),m=e(1772),s=function(b){c()(t,b);var h=d()(t);function t(){return _()(this,t),h.apply(this,arguments)}return r()(t)}(m.Uo);s.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
1
+ "use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[645,95],{10095:function(a,n,e){e.r(n),e.d(n,{JSBlockRunJSContext:function(){return s}});var o=e(72004),r=e.n(o),l=e(12444),_=e.n(l),i=e(31996),u=e.n(i),c=e(26037),d=e.n(c),m=e(1772),s=function(b){u()(t,b);var p=d()(t);function t(){return _()(this,t),p.apply(this,arguments)}return r()(t)}(m.Uo);s.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
2
2
  Supports innerHTML, append, and other DOM manipulation methods.
3
3
  Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
4
4
  Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
5
5
  Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
6
6
  Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),s.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},10645:function(a,n,e){e.r(n);var o=e(10095),r={contexts:[o.JSBlockRunJSContext],prefix:"sn-jsb-stats",label:"Render statistics cards",description:"Display multiple statistic cards with numbers from API",locales:{"zh-CN":{label:"\u6E32\u67D3\u7EDF\u8BA1\u5361\u7247",description:"\u663E\u793A\u591A\u4E2A\u7EDF\u8BA1\u6570\u5B57\u5361\u7247\uFF08\u4ECE API \u83B7\u53D6\u6570\u636E\uFF09"}},content:`
7
7
  const { Card, Statistic, Row, Col } = ctx.antd;
8
- const { createElement: h } = ctx.React;
9
8
 
10
9
  const res = await ctx.api.request({
11
10
  url: 'users:list',
@@ -29,32 +28,28 @@ const distinctRoles = new Set(
29
28
  .filter(Boolean),
30
29
  ).size;
31
30
 
32
- ctx.ReactDOM.createRoot(ctx.element).render(
33
- h(Row, { gutter: 16 },
34
- h(Col, { span: 6 },
35
- h(Card, {},
36
- h(Statistic, { title: ctx.t('Total users'), value: total, valueStyle: { color: '#3f8600' } })
37
- )
38
- ),
39
- h(Col, { span: 6 },
40
- h(Card, {},
41
- h(Statistic, { title: ctx.t('Administrators'), value: adminCount, valueStyle: { color: '#1890ff' } })
42
- )
43
- ),
44
- h(Col, { span: 6 },
45
- h(Card, {},
46
- h(Statistic, { title: ctx.t('Users with email'), value: withEmail, valueStyle: { color: '#faad14' } })
47
- )
48
- ),
49
- h(Col, { span: 6 },
50
- h(Card, {},
51
- h(Statistic, {
52
- title: ctx.t('Distinct roles'),
53
- value: distinctRoles,
54
- valueStyle: { color: '#cf1322' },
55
- })
56
- )
57
- )
58
- )
31
+ ctx.render(
32
+ <Row gutter={16}>
33
+ <Col span={6}>
34
+ <Card>
35
+ <Statistic title={ctx.t('Total users')} value={total} valueStyle={{ color: '#3f8600' }} />
36
+ </Card>
37
+ </Col>
38
+ <Col span={6}>
39
+ <Card>
40
+ <Statistic title={ctx.t('Administrators')} value={adminCount} valueStyle={{ color: '#1890ff' }} />
41
+ </Card>
42
+ </Col>
43
+ <Col span={6}>
44
+ <Card>
45
+ <Statistic title={ctx.t('Users with email')} value={withEmail} valueStyle={{ color: '#faad14' }} />
46
+ </Card>
47
+ </Col>
48
+ <Col span={6}>
49
+ <Card>
50
+ <Statistic title={ctx.t('Distinct roles')} value={distinctRoles} valueStyle={{ color: '#cf1322' }} />
51
+ </Card>
52
+ </Col>
53
+ </Row>
59
54
  );
60
55
  `};n.default=r}}]);
@@ -1,17 +1,17 @@
1
- "use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[703,95],{10095:function(r,n,e){e.r(n),e.d(n,{JSBlockRunJSContext:function(){return a}});var o=e(72004),_=e.n(o),l=e(12444),s=e.n(l),c=e(31996),i=e.n(c),d=e(26037),u=e.n(d),m=e(1772),a=function(b){i()(t,b);var R=u()(t);function t(){return s()(this,t),R.apply(this,arguments)}return _()(t)}(m.Uo);a.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
1
+ "use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[703,95],{10095:function(a,n,e){e.r(n),e.d(n,{JSBlockRunJSContext:function(){return r}});var o=e(72004),_=e.n(o),s=e(12444),l=e.n(s),c=e(31996),i=e.n(c),u=e(26037),d=e.n(u),m=e(1772),r=function(b){i()(t,b);var p=d()(t);function t(){return l()(this,t),p.apply(this,arguments)}return _()(t)}(m.Uo);r.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
2
2
  Supports innerHTML, append, and other DOM manipulation methods.
3
3
  Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
4
4
  Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
5
5
  Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
6
- Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),a.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},70703:function(r,n,e){e.r(n);var o=e(10095),_={contexts:[o.JSBlockRunJSContext],prefix:"sn-jsb-react",label:"Render React",description:"Render a React element inside the block container",locales:{"zh-CN":{label:"\u6E32\u67D3 React",description:"\u5728\u533A\u5757\u5BB9\u5668\u4E2D\u6E32\u67D3 React \u7EC4\u4EF6"}},content:`
6
+ Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),r.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},70703:function(a,n,e){e.r(n);var o=e(10095),_={contexts:[o.JSBlockRunJSContext],prefix:"sn-jsb-react",label:"Render React",description:"Render a React element inside the block container",locales:{"zh-CN":{label:"\u6E32\u67D3 React",description:"\u5728\u533A\u5757\u5BB9\u5668\u4E2D\u6E32\u67D3 React \u7EC4\u4EF6"}},content:`
7
7
  // Render a React element into ctx.element via ReactDOM
8
- const { React, ReactDOM, antd } = ctx;
9
- const { Button } = antd;
8
+ const { Button } = ctx.antd;
10
9
 
11
- const node = React.createElement(
12
- 'div',
13
- { style: { padding: 12 } },
14
- React.createElement(Button, { type: 'primary', onClick: () => ctx.message.success(ctx.t('Clicked!')) }, ctx.t('Click')),
10
+ ctx.render(
11
+ <div style={{ padding: 12 }}>
12
+ <Button type="primary" onClick={() => ctx.message.success(ctx.t('Clicked!'))}>
13
+ {ctx.t('Click')}
14
+ </Button>
15
+ </div>
15
16
  );
16
- ReactDOM.createRoot(ctx.element).render(node);
17
17
  `};n.default=_}}]);
@@ -18,6 +18,6 @@
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
21
- <script src="/umi.a3b197ea.js"></script>
21
+ <script src="/umi.497b9e1c.js"></script>
22
22
 
23
23
  </body></html>
@@ -18,6 +18,6 @@
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
21
- <script src="/umi.a3b197ea.js"></script>
21
+ <script src="/umi.497b9e1c.js"></script>
22
22
 
23
23
  </body></html>
@@ -0,0 +1 @@
1
+ (self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[8977],{92509:function(oe,B,y){(function(d,g){g(B,y(22208),y(92297),y(9806))})(this,function(d,g,I,D){"use strict";d.addSegment=void 0,d.addMapping=void 0,d.maybeAddSegment=void 0,d.maybeAddMapping=void 0,d.setSourceContent=void 0,d.toDecodedMap=void 0,d.toEncodedMap=void 0,d.fromMap=void 0,d.allMappings=void 0;let P;class X{constructor({file:c,sourceRoot:o}={}){this._names=new g.SetArray,this._sources=new g.SetArray,this._sourcesContent=[],this._mappings=[],this.file=c,this.sourceRoot=o}}d.addSegment=(n,c,o,f,h,C,v,b)=>P(!1,n,c,o,f,h,C,v,b),d.maybeAddSegment=(n,c,o,f,h,C,v,b)=>P(!0,n,c,o,f,h,C,v,b),d.addMapping=(n,c)=>S(!1,n,c),d.maybeAddMapping=(n,c)=>S(!0,n,c),d.setSourceContent=(n,c,o)=>{const{_sources:f,_sourcesContent:h}=n;h[g.put(f,c)]=o},d.toDecodedMap=n=>{const{file:c,sourceRoot:o,_mappings:f,_sources:h,_sourcesContent:C,_names:v}=n;return l(f),{version:3,file:c||void 0,names:v.array,sourceRoot:o||void 0,sources:h.array,sourcesContent:C,mappings:f}},d.toEncodedMap=n=>{const c=d.toDecodedMap(n);return Object.assign(Object.assign({},c),{mappings:I.encode(c.mappings)})},d.allMappings=n=>{const c=[],{_mappings:o,_sources:f,_names:h}=n;for(let C=0;C<o.length;C++){const v=o[C];for(let b=0;b<v.length;b++){const U=v[b],ee={line:C+1,column:U[0]};let ne,k,te;U.length!==1&&(ne=f.array[U[1]],k={line:U[2]+1,column:U[3]},U.length===5&&(te=h.array[U[4]])),c.push({generated:ee,source:ne,original:k,name:te})}}return c},d.fromMap=n=>{const c=new D.TraceMap(n),o=new X({file:c.file,sourceRoot:c.sourceRoot});return i(o._names,c.names),i(o._sources,c.sources),o._sourcesContent=c.sourcesContent||c.sources.map(()=>null),o._mappings=D.decodedMappings(c),o},P=(n,c,o,f,h,C,v,b,U)=>{const{_mappings:ee,_sources:ne,_sourcesContent:k,_names:te}=c,Z=V(ee,o),$=Q(Z,f);if(!h)return n&&s(Z,$)?void 0:J(Z,$,[f]);const W=g.put(ne,h),Y=b?g.put(te,b):-1;if(W===k.length&&(k[W]=U??null),!(n&&M(Z,$,W,C,v,Y)))return J(Z,$,b?[f,W,C,v,Y]:[f,W,C,v])};function V(n,c){for(let o=n.length;o<=c;o++)n[o]=[];return n[c]}function Q(n,c){let o=n.length;for(let f=o-1;f>=0;o=f--){const h=n[f];if(c>=h[0])break}return o}function J(n,c,o){for(let f=n.length;f>c;f--)n[f]=n[f-1];n[c]=o}function l(n){const{length:c}=n;let o=c;for(let f=o-1;f>=0&&!(n[f].length>0);o=f,f--);o<c&&(n.length=o)}function i(n,c){for(let o=0;o<c.length;o++)g.put(n,c[o])}function s(n,c){return c===0?!0:n[c-1].length===1}function M(n,c,o,f,h,C){if(c===0)return!1;const v=n[c-1];return v.length===1?!1:o===v[1]&&f===v[2]&&h===v[3]&&C===(v.length===5?v[4]:-1)}function S(n,c,o){const{generated:f,source:h,original:C,name:v,content:b}=o;if(!h)return P(n,c,f.line-1,f.column,null,null,null,null,null);const U=h;return P(n,c,f.line-1,f.column,U,C.line-1,C.column,v,b)}d.GenMapping=X,Object.defineProperty(d,"__esModule",{value:!0})})},9806:function(oe,B,y){(function(d,g){g(B,y(92297),y(48435))})(this,function(d,g,I){"use strict";function D(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var j=D(I);function T(t,e){return e&&!e.endsWith("/")&&(e+="/"),j.default(t,e)}function q(t){if(!t)return"";const e=t.lastIndexOf("/");return t.slice(0,e+1)}const N=0,K=1,H=2,P=3,X=4,V=1,Q=2;function J(t,e){const r=l(t,0);if(r===t.length)return t;e||(t=t.slice());for(let u=r;u<t.length;u=l(t,u+1))t[u]=s(t[u],e);return t}function l(t,e){for(let r=e;r<t.length;r++)if(!i(t[r]))return r;return t.length}function i(t){for(let e=1;e<t.length;e++)if(t[e][N]<t[e-1][N])return!1;return!0}function s(t,e){return e||(t=t.slice()),t.sort(M)}function M(t,e){return t[N]-e[N]}let S=!1;function n(t,e,r,u){for(;r<=u;){const m=r+(u-r>>1),a=t[m][N]-e;if(a===0)return S=!0,m;a<0?r=m+1:u=m-1}return S=!1,r-1}function c(t,e,r){for(let u=r+1;u<t.length&&t[u][N]===e;r=u++);return r}function o(t,e,r){for(let u=r-1;u>=0&&t[u][N]===e;r=u--);return r}function f(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function h(t,e,r,u){const{lastKey:m,lastNeedle:a,lastIndex:_}=r;let R=0,E=t.length-1;if(u===m){if(e===a)return S=_!==-1&&t[_][N]===e,_;e>=a?R=_===-1?0:_:E=_}return r.lastKey=u,r.lastNeedle=e,r.lastIndex=n(t,e,R,E)}function C(t,e){const r=e.map(b);for(let u=0;u<t.length;u++){const m=t[u];for(let a=0;a<m.length;a++){const _=m[a];if(_.length===1)continue;const R=_[K],E=_[H],O=_[P],w=r[R],A=w[E]||(w[E]=[]),L=e[R],p=c(A,O,h(A,O,L,E));v(A,L.lastIndex=p+1,[O,u,_[N]])}}return r}function v(t,e,r){for(let u=t.length;u>e;u--)t[u]=t[u-1];t[e]=r}function b(){return{__proto__:null}}const U=function(t,e){const r=typeof t=="string"?JSON.parse(t):t;if(!("sections"in r))return new se(r,e);const u=[],m=[],a=[],_=[];ee(r,e,u,m,a,_,0,0,1/0,1/0);const R={version:3,file:r.file,names:_,sources:m,sourcesContent:a,mappings:u};return d.presortedDecodedMap(R)};function ee(t,e,r,u,m,a,_,R,E,O){const{sections:w}=t;for(let A=0;A<w.length;A++){const{map:L,offset:p}=w[A];let F=E,z=O;if(A+1<w.length){const G=w[A+1].offset;F=Math.min(E,_+G.line),F===E?z=Math.min(O,R+G.column):F<E&&(z=R+G.column)}ne(L,e,r,u,m,a,_+p.line,R+p.column,F,z)}}function ne(t,e,r,u,m,a,_,R,E,O){if("sections"in t)return ee(...arguments);const w=new se(t,e),A=u.length,L=a.length,p=d.decodedMappings(w),{resolvedSources:F,sourcesContent:z}=w;if(k(u,F),k(a,w.names),z)k(m,z);else for(let G=0;G<F.length;G++)m.push(null);for(let G=0;G<p.length;G++){const de=_+G;if(de>E)return;const ae=te(r,de),Se=G===0?R:0,he=p[G];for(let fe=0;fe<he.length;fe++){const x=he[fe],ue=Se+x[N];if(de===E&&ue>=O)return;if(x.length===1){ae.push([ue]);continue}const ge=A+x[K],_e=x[H],me=x[P];ae.push(x.length===4?[ue,ge,_e,me]:[ue,ge,_e,me,L+x[X]])}}}function k(t,e){for(let r=0;r<e.length;r++)t.push(e[r])}function te(t,e){for(let r=t.length;r<=e;r++)t[r]=[];return t[e]}const Z="`line` must be greater than 0 (lines start at line 1)",$="`column` must be greater than or equal to 0 (columns start at column 0)",W=-1,Y=1;d.encodedMappings=void 0,d.decodedMappings=void 0,d.traceSegment=void 0,d.originalPositionFor=void 0,d.generatedPositionFor=void 0,d.allGeneratedPositionsFor=void 0,d.eachMapping=void 0,d.sourceContentFor=void 0,d.presortedDecodedMap=void 0,d.decodedMap=void 0,d.encodedMap=void 0;class se{constructor(e,r){const u=typeof e=="string";if(!u&&e._decodedMemo)return e;const m=u?JSON.parse(e):e,{version:a,file:_,names:R,sourceRoot:E,sources:O,sourcesContent:w}=m;this.version=a,this.file=_,this.names=R||[],this.sourceRoot=E,this.sources=O,this.sourcesContent=w;const A=T(E||"",q(r));this.resolvedSources=O.map(p=>T(p||"",A));const{mappings:L}=m;typeof L=="string"?(this._encoded=L,this._decoded=void 0):(this._encoded=void 0,this._decoded=J(L,u)),this._decodedMemo=f(),this._bySources=void 0,this._bySourceMemos=void 0}}(()=>{d.encodedMappings=e=>{var r;return(r=e._encoded)!==null&&r!==void 0?r:e._encoded=g.encode(e._decoded)},d.decodedMappings=e=>e._decoded||(e._decoded=g.decode(e._encoded)),d.traceSegment=(e,r,u)=>{const m=d.decodedMappings(e);if(r>=m.length)return null;const a=m[r],_=ie(a,e._decodedMemo,r,u,Y);return _===-1?null:a[_]},d.originalPositionFor=(e,{line:r,column:u,bias:m})=>{if(r--,r<0)throw new Error(Z);if(u<0)throw new Error($);const a=d.decodedMappings(e);if(r>=a.length)return ce(null,null,null,null);const _=a[r],R=ie(_,e._decodedMemo,r,u,m||Y);if(R===-1)return ce(null,null,null,null);const E=_[R];if(E.length===1)return ce(null,null,null,null);const{names:O,resolvedSources:w}=e;return ce(w[E[K]],E[H]+1,E[P],E.length===5?O[E[X]]:null)},d.allGeneratedPositionsFor=(e,{source:r,line:u,column:m,bias:a})=>t(e,r,u,m,a||W,!0),d.generatedPositionFor=(e,{source:r,line:u,column:m,bias:a})=>t(e,r,u,m,a||Y,!1),d.eachMapping=(e,r)=>{const u=d.decodedMappings(e),{names:m,resolvedSources:a}=e;for(let _=0;_<u.length;_++){const R=u[_];for(let E=0;E<R.length;E++){const O=R[E],w=_+1,A=O[0];let L=null,p=null,F=null,z=null;O.length!==1&&(L=a[O[1]],p=O[2]+1,F=O[3]),O.length===5&&(z=m[O[4]]),r({generatedLine:w,generatedColumn:A,source:L,originalLine:p,originalColumn:F,name:z})}}},d.sourceContentFor=(e,r)=>{const{sources:u,resolvedSources:m,sourcesContent:a}=e;if(a==null)return null;let _=u.indexOf(r);return _===-1&&(_=m.indexOf(r)),_===-1?null:a[_]},d.presortedDecodedMap=(e,r)=>{const u=new se(le(e,[]),r);return u._decoded=e.mappings,u},d.decodedMap=e=>le(e,d.decodedMappings(e)),d.encodedMap=e=>le(e,d.encodedMappings(e));function t(e,r,u,m,a,_){if(u--,u<0)throw new Error(Z);if(m<0)throw new Error($);const{sources:R,resolvedSources:E}=e;let O=R.indexOf(r);if(O===-1&&(O=E.indexOf(r)),O===-1)return _?[]:re(null,null);const A=(e._bySources||(e._bySources=C(d.decodedMappings(e),e._bySourceMemos=R.map(f))))[O][u];if(A==null)return _?[]:re(null,null);const L=e._bySourceMemos[O];if(_)return Me(A,L,u,m,a);const p=ie(A,L,u,m,a);if(p===-1)return re(null,null);const F=A[p];return re(F[V]+1,F[Q])}})();function le(t,e){return{version:t.version,file:t.file,names:t.names,sourceRoot:t.sourceRoot,sources:t.sources,sourcesContent:t.sourcesContent,mappings:e}}function ce(t,e,r,u){return{source:t,line:e,column:r,name:u}}function re(t,e){return{line:t,column:e}}function ie(t,e,r,u,m){let a=h(t,u,e,r);return S?a=(m===W?c:o)(t,u,a):m===W&&a++,a===-1||a===t.length?-1:a}function Me(t,e,r,u,m){let a=ie(t,e,r,u,Y);if(!S&&m===W&&a++,a===-1||a===t.length)return[];const _=S?u:t[a][N];S||(a=o(t,_,a));const R=c(t,_,a),E=[];for(;a<=R;a++){const O=t[a];E.push(re(O[V]+1,O[Q]))}return E}d.AnyMap=U,d.GREATEST_LOWER_BOUND=Y,d.LEAST_UPPER_BOUND=W,d.TraceMap=se,Object.defineProperty(d,"__esModule",{value:!0})})},48435:function(oe){(function(B,y){oe.exports=y()})(this,function(){"use strict";const B=/^[\w+.-]+:\/\//,y=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,d=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;var g;(function(l){l[l.Empty=1]="Empty",l[l.Hash=2]="Hash",l[l.Query=3]="Query",l[l.RelativePath=4]="RelativePath",l[l.AbsolutePath=5]="AbsolutePath",l[l.SchemeRelative=6]="SchemeRelative",l[l.Absolute=7]="Absolute"})(g||(g={}));function I(l){return B.test(l)}function D(l){return l.startsWith("//")}function j(l){return l.startsWith("/")}function T(l){return l.startsWith("file:")}function q(l){return/^[.?#]/.test(l)}function N(l){const i=y.exec(l);return H(i[1],i[2]||"",i[3],i[4]||"",i[5]||"/",i[6]||"",i[7]||"")}function K(l){const i=d.exec(l),s=i[2];return H("file:","",i[1]||"","",j(s)?s:"/"+s,i[3]||"",i[4]||"")}function H(l,i,s,M,S,n,c){return{scheme:l,user:i,host:s,port:M,path:S,query:n,hash:c,type:g.Absolute}}function P(l){if(D(l)){const s=N("http:"+l);return s.scheme="",s.type=g.SchemeRelative,s}if(j(l)){const s=N("http://foo.com"+l);return s.scheme="",s.host="",s.type=g.AbsolutePath,s}if(T(l))return K(l);if(I(l))return N(l);const i=N("http://foo.com/"+l);return i.scheme="",i.host="",i.type=l?l.startsWith("?")?g.Query:l.startsWith("#")?g.Hash:g.RelativePath:g.Empty,i}function X(l){if(l.endsWith("/.."))return l;const i=l.lastIndexOf("/");return l.slice(0,i+1)}function V(l,i){Q(i,i.type),l.path==="/"?l.path=i.path:l.path=X(i.path)+l.path}function Q(l,i){const s=i<=g.RelativePath,M=l.path.split("/");let S=1,n=0,c=!1;for(let f=1;f<M.length;f++){const h=M[f];if(!h){c=!0;continue}if(c=!1,h!=="."){if(h===".."){n?(c=!0,n--,S--):s&&(M[S++]=h);continue}M[S++]=h,n++}}let o="";for(let f=1;f<S;f++)o+="/"+M[f];(!o||c&&!o.endsWith("/.."))&&(o+="/"),l.path=o}function J(l,i){if(!l&&!i)return"";const s=P(l);let M=s.type;if(i&&M!==g.Absolute){const n=P(i),c=n.type;switch(M){case g.Empty:s.hash=n.hash;case g.Hash:s.query=n.query;case g.Query:case g.RelativePath:V(s,n);case g.AbsolutePath:s.user=n.user,s.host=n.host,s.port=n.port;case g.SchemeRelative:s.scheme=n.scheme}c>M&&(M=c)}Q(s,M);const S=s.query+s.hash;switch(M){case g.Hash:case g.Query:return S;case g.RelativePath:{const n=s.path.slice(1);return n?q(i||l)&&!q(n)?"./"+n+S:n+S:S||"."}case g.AbsolutePath:return s.path+S;default:return s.scheme+"//"+s.user+s.host+s.port+s.path+S}}return J})},22208:function(oe,B){(function(y,d){d(B)})(this,function(y){"use strict";y.get=void 0,y.put=void 0,y.pop=void 0;class d{constructor(){this._indexes={__proto__:null},this.array=[]}}y.get=(g,I)=>g._indexes[I],y.put=(g,I)=>{const D=y.get(g,I);if(D!==void 0)return D;const{array:j,_indexes:T}=g;return T[I]=j.push(I)-1},y.pop=g=>{const{array:I,_indexes:D}=g;if(I.length===0)return;const j=I.pop();D[j]=void 0},y.SetArray=d,Object.defineProperty(y,"__esModule",{value:!0})})},92297:function(oe,B,y){var d=y(48764).lW;(function(g,I){I(B)})(this,function(g){"use strict";const I=",".charCodeAt(0),D=";".charCodeAt(0),j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=new Uint8Array(64),q=new Uint8Array(128);for(let i=0;i<j.length;i++){const s=j.charCodeAt(i);T[i]=s,q[s]=i}const N=typeof TextDecoder<"u"?new TextDecoder:typeof d<"u"?{decode(i){return d.from(i.buffer,i.byteOffset,i.byteLength).toString()}}:{decode(i){let s="";for(let M=0;M<i.length;M++)s+=String.fromCharCode(i[M]);return s}};function K(i){const s=new Int32Array(5),M=[];let S=0;do{const n=H(i,S),c=[];let o=!0,f=0;s[0]=0;for(let h=S;h<n;h++){let C;h=P(i,h,s,0);const v=s[0];v<f&&(o=!1),f=v,X(i,h,n)?(h=P(i,h,s,1),h=P(i,h,s,2),h=P(i,h,s,3),X(i,h,n)?(h=P(i,h,s,4),C=[v,s[1],s[2],s[3],s[4]]):C=[v,s[1],s[2],s[3]]):C=[v],c.push(C)}o||V(c),M.push(c),S=n+1}while(S<=i.length);return M}function H(i,s){const M=i.indexOf(";",s);return M===-1?i.length:M}function P(i,s,M,S){let n=0,c=0,o=0;do{const h=i.charCodeAt(s++);o=q[h],n|=(o&31)<<c,c+=5}while(o&32);const f=n&1;return n>>>=1,f&&(n=-2147483648|-n),M[S]+=n,s}function X(i,s,M){return s>=M?!1:i.charCodeAt(s)!==I}function V(i){i.sort(Q)}function Q(i,s){return i[0]-s[0]}function J(i){const s=new Int32Array(5),M=1024*16,S=M-36,n=new Uint8Array(M),c=n.subarray(0,S);let o=0,f="";for(let h=0;h<i.length;h++){const C=i[h];if(h>0&&(o===M&&(f+=N.decode(n),o=0),n[o++]=D),C.length!==0){s[0]=0;for(let v=0;v<C.length;v++){const b=C[v];o>S&&(f+=N.decode(c),n.copyWithin(0,S,o),o-=S),v>0&&(n[o++]=I),o=l(n,o,s,b,0),b.length!==1&&(o=l(n,o,s,b,1),o=l(n,o,s,b,2),o=l(n,o,s,b,3),b.length!==4&&(o=l(n,o,s,b,4)))}}}return f+N.decode(n.subarray(0,o))}function l(i,s,M,S,n){const c=S[n];let o=c-M[n];M[n]=c,o=o<0?-o<<1|1:o<<1;do{let f=o&31;o>>>=5,o>0&&(f|=32),i[s++]=T[f]}while(o>0);return s}g.decode=K,g.encode=J,Object.defineProperty(g,"__esModule",{value:!0})})}}]);