jobsys-newbie
Version:
Enhanced component based on ant-design-vue
3 lines • 53.1 kB
JavaScript
"use strict";var wn=Object.defineProperty;var yn=(t,e,n)=>e in t?wn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var H=(t,e,n)=>yn(t,typeof e!="symbol"?e+"":e,n);const It=require("dayjs"),$=require("lodash-es"),Dt=require("ant-design-vue"),se=require("axios");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const De=BigInt(0),Mt=BigInt(1),pn=BigInt(2),Wt=t=>t instanceof Uint8Array,mn=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function it(t){if(!Wt(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=mn[t[n]];return e}function D(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function N(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Pt(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let s=0;s<n.length;s++){const r=s*2,i=t.slice(r,r+2),l=Number.parseInt(i,16);if(Number.isNaN(l)||l<0)throw new Error("Invalid byte sequence");n[s]=l}return n}function Et(t){return N(it(t))}function ae(t){if(!Wt(t))throw new Error("Uint8Array expected");return N(it(Uint8Array.from(t).reverse()))}function xt(t,e){return Pt(t.toString(16).padStart(e*2,"0"))}function Fe(t,e){return xt(t,e).reverse()}function bn(t){return Pt(D(t))}function J(t,e,n){let s;if(typeof e=="string")try{s=Pt(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else if(Wt(e))s=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const r=s.length;if(typeof n=="number"&&r!==n)throw new Error(`${t} expected ${n} bytes, got ${r}`);return s}function G(...t){const e=new Uint8Array(t.reduce((s,r)=>s+r.length,0));let n=0;return t.forEach(s=>{if(!Wt(s))throw new Error("Uint8Array expected");e.set(s,n),n+=s.length}),e}function En(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Ze(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function xn(t){let e;for(e=0;t>De;t>>=Mt,e+=1);return e}function vn(t,e){return t>>BigInt(e)&Mt}const Sn=(t,e,n)=>t|(n?Mt:De)<<BigInt(e),he=t=>(pn<<BigInt(t-1))-Mt,Qt=t=>new Uint8Array(t),Pe=t=>Uint8Array.from(t);function Ke(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let s=Qt(t),r=Qt(t),i=0;const l=()=>{s.fill(1),r.fill(0),i=0},o=(...f)=>n(r,s,...f),c=(f=Qt())=>{r=o(Pe([0]),f),s=o(),f.length!==0&&(r=o(Pe([1]),f),s=o())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const p=[];for(;f<e;){s=o();const E=s.slice();p.push(E),f+=s.length}return G(...p)};return(f,p)=>{l(),c(f);let E;for(;!(E=p(u()));)c();return l(),E}}const Bn={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function qt(t,e,n={}){const s=(r,i,l)=>{const o=Bn[i];if(typeof o!="function")throw new Error(`Invalid validator "${i}", expected function`);const c=t[r];if(!(l&&c===void 0)&&!o(c,t))throw new Error(`Invalid param ${String(r)}=${c} (${typeof c}), expected ${i}`)};for(const[r,i]of Object.entries(e))s(r,i,!1);for(const[r,i]of Object.entries(n))s(r,i,!0);return t}const An=Object.freeze(Object.defineProperty({__proto__:null,bitGet:vn,bitLen:xn,bitMask:he,bitSet:Sn,bytesToHex:it,bytesToNumberBE:Et,bytesToNumberLE:ae,concatBytes:G,createHmacDrbg:Ke,ensureBytes:J,equalBytes:En,hexToBytes:Pt,hexToNumber:N,numberToBytesBE:xt,numberToBytesLE:Fe,numberToHexUnpadded:D,numberToVarBytesBE:bn,utf8ToBytes:Ze,validateObject:qt},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt(0),_=BigInt(1),pt=BigInt(2),Un=BigInt(3),oe=BigInt(4),Te=BigInt(5),Oe=BigInt(8);BigInt(9);BigInt(16);function K(t,e){const n=t%e;return n>=k?n:e+n}function In(t,e,n){if(n<=k||e<k)throw new Error("Expected power/modulo > 0");if(n===_)return k;let s=_;for(;e>k;)e&_&&(s=s*t%n),t=t*t%n,e>>=_;return s}function ie(t,e){if(t===k||e<=k)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=K(t,e),s=e,r=k,i=_;for(;n!==k;){const o=s/n,c=s%n,u=r-i*o;s=n,n=c,r=i,i=u}if(s!==_)throw new Error("invert: does not exist");return K(r,e)}function Pn(t){const e=(t-_)/pt;let n,s,r;for(n=t-_,s=0;n%pt===k;n/=pt,s++);for(r=pt;r<t&&In(r,e,t)!==t-_;r++);if(s===1){const l=(t+_)/oe;return function(c,u){const g=c.pow(u,l);if(!c.eql(c.sqr(g),u))throw new Error("Cannot find square root");return g}}const i=(n+_)/pt;return function(o,c){if(o.pow(c,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let u=s,g=o.pow(o.mul(o.ONE,r),n),f=o.pow(c,i),p=o.pow(c,n);for(;!o.eql(p,o.ONE);){if(o.eql(p,o.ZERO))return o.ZERO;let E=1;for(let a=o.sqr(p);E<u&&!o.eql(a,o.ONE);E++)a=o.sqr(a);const w=o.pow(g,_<<BigInt(u-E-1));g=o.sqr(w),f=o.mul(f,w),p=o.mul(p,g),u=E}return f}}function Tn(t){if(t%oe===Un){const e=(t+_)/oe;return function(s,r){const i=s.pow(r,e);if(!s.eql(s.sqr(i),r))throw new Error("Cannot find square root");return i}}if(t%Oe===Te){const e=(t-Te)/Oe;return function(s,r){const i=s.mul(r,pt),l=s.pow(i,e),o=s.mul(r,l),c=s.mul(s.mul(o,pt),l),u=s.mul(o,s.sub(c,s.ONE));if(!s.eql(s.sqr(u),r))throw new Error("Cannot find square root");return u}}return Pn(t)}const On=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ln(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=On.reduce((s,r)=>(s[r]="function",s),e);return qt(t,n)}function Cn(t,e,n){if(n<k)throw new Error("Expected power > 0");if(n===k)return t.ONE;if(n===_)return e;let s=t.ONE,r=e;for(;n>k;)n&_&&(s=t.mul(s,r)),r=t.sqr(r),n>>=_;return s}function Hn(t,e){const n=new Array(e.length),s=e.reduce((i,l,o)=>t.is0(l)?i:(n[o]=i,t.mul(i,l)),t.ONE),r=t.inv(s);return e.reduceRight((i,l,o)=>t.is0(l)?i:(n[o]=t.mul(i,n[o]),t.mul(i,l)),r),n}function de(t,e){const n=e!==void 0?e:t.toString(2).length,s=Math.ceil(n/8);return{nBitLength:n,nByteLength:s}}function ze(t,e,n=!1,s={}){if(t<=k)throw new Error(`Expected Fp ORDER > 0, got ${t}`);const{nBitLength:r,nByteLength:i}=de(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=Tn(t),o=Object.freeze({ORDER:t,BITS:r,BYTES:i,MASK:he(r),ZERO:k,ONE:_,create:c=>K(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return k<=c&&c<t},is0:c=>c===k,isOdd:c=>(c&_)===_,neg:c=>K(-c,t),eql:(c,u)=>c===u,sqr:c=>K(c*c,t),add:(c,u)=>K(c+u,t),sub:(c,u)=>K(c-u,t),mul:(c,u)=>K(c*u,t),pow:(c,u)=>Cn(o,c,u),div:(c,u)=>K(c*ie(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>ie(c,t),sqrt:s.sqrt||(c=>l(o,c)),invertBatch:c=>Hn(o,c),cmov:(c,u,g)=>g?u:c,toBytes:c=>n?Fe(c,i):xt(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return n?ae(c):Et(c)}});return Object.freeze(o)}function Nn(t,e,n=!1){t=J("privateHash",t);const s=t.length,r=de(e).nByteLength+8;if(r<24||s<r||s>1024)throw new Error(`hashToPrivateScalar: expected ${r}-1024 bytes of input, got ${s}`);const i=n?ae(t):Et(t);return K(i,e-_)+_}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _n=BigInt(0),te=BigInt(1);function qn(t,e){const n=(r,i)=>{const l=i.negate();return r?l:i},s=r=>{const i=Math.ceil(e/r)+1,l=2**(r-1);return{windows:i,windowSize:l}};return{constTimeNegate:n,unsafeLadder(r,i){let l=t.ZERO,o=r;for(;i>_n;)i&te&&(l=l.add(o)),o=o.double(),i>>=te;return l},precomputeWindow(r,i){const{windows:l,windowSize:o}=s(i),c=[];let u=r,g=u;for(let f=0;f<l;f++){g=u,c.push(g);for(let p=1;p<o;p++)g=g.add(u),c.push(g);u=g.double()}return c},wNAF(r,i,l){const{windows:o,windowSize:c}=s(r);let u=t.ZERO,g=t.BASE;const f=BigInt(2**r-1),p=2**r,E=BigInt(r);for(let w=0;w<o;w++){const a=w*c;let h=Number(l&f);l>>=E,h>c&&(h-=p,l+=te);const d=a,m=a+Math.abs(h)-1,x=w%2!==0,A=h<0;h===0?g=g.add(n(x,i[d])):u=u.add(n(A,i[m]))}return{p:u,f:g}},wNAFCached(r,i,l,o){const c=r._WINDOW_SIZE||1;let u=i.get(r);return u||(u=this.precomputeWindow(r,c),c!==1&&i.set(r,o(u))),this.wNAF(c,u,l)}}}function je(t){return Ln(t.Fp),qt(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...de(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Rn(t){const e=je(t);qt(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:s,a:r}=e;if(n){if(!s.eql(r,s.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Vn,hexToBytes:$n}=An,mt={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=mt;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],s=t.subarray(2,n+2);if(!n||s.length!==n)throw new e("Invalid signature integer: wrong length");if(s[0]&128)throw new e("Invalid signature integer: negative");if(s[0]===0&&!(s[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Vn(s),l:t.subarray(n+2)}},toSig(t){const{Err:e}=mt,n=typeof t=="string"?$n(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let s=n.length;if(s<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==s-2)throw new e("Invalid signature: incorrect length");const{d:r,l:i}=mt._parseInt(n.subarray(2)),{d:l,l:o}=mt._parseInt(i);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r,s:l}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const g=u.toString(16);return g.length&1?`0${g}`:g},s=e(n(t.s)),r=e(n(t.r)),i=s.length/2,l=r.length/2,o=n(i),c=n(l);return`30${n(l+i+4)}02${c}${r}02${o}${s}`}},ut=BigInt(0),X=BigInt(1);BigInt(2);const Le=BigInt(3);BigInt(4);function kn(t){const e=Rn(t),{Fp:n}=e,s=e.toBytes||((w,a,h)=>{const d=a.toAffine();return G(Uint8Array.from([4]),n.toBytes(d.x),n.toBytes(d.y))}),r=e.fromBytes||(w=>{const a=w.subarray(1),h=n.fromBytes(a.subarray(0,n.BYTES)),d=n.fromBytes(a.subarray(n.BYTES,2*n.BYTES));return{x:h,y:d}});function i(w){const{a,b:h}=e,d=n.sqr(w),m=n.mul(d,w);return n.add(n.add(m,n.mul(w,a)),h)}if(!n.eql(n.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function l(w){return typeof w=="bigint"&&ut<w&&w<e.n}function o(w){if(!l(w))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(w){const{allowedPrivateKeyLengths:a,nByteLength:h,wrapPrivateKey:d,n:m}=e;if(a&&typeof w!="bigint"){if(w instanceof Uint8Array&&(w=it(w)),typeof w!="string"||!a.includes(w.length))throw new Error("Invalid key");w=w.padStart(h*2,"0")}let x;try{x=typeof w=="bigint"?w:Et(J("private key",w,h))}catch{throw new Error(`private key must be ${h} bytes, hex or bigint, not ${typeof w}`)}return d&&(x=K(x,m)),o(x),x}const u=new Map;function g(w){if(!(w instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(a,h,d){if(this.px=a,this.py=h,this.pz=d,a==null||!n.isValid(a))throw new Error("x required");if(h==null||!n.isValid(h))throw new Error("y required");if(d==null||!n.isValid(d))throw new Error("z required")}static fromAffine(a){const{x:h,y:d}=a||{};if(!a||!n.isValid(h)||!n.isValid(d))throw new Error("invalid affine point");if(a instanceof f)throw new Error("projective point not allowed");const m=x=>n.eql(x,n.ZERO);return m(h)&&m(d)?f.ZERO:new f(h,d,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(a){const h=n.invertBatch(a.map(d=>d.pz));return a.map((d,m)=>d.toAffine(h[m])).map(f.fromAffine)}static fromHex(a){const h=f.fromAffine(r(J("pointHex",a)));return h.assertValidity(),h}static fromPrivateKey(a){return f.BASE.multiply(c(a))}_setWindowSize(a){this._WINDOW_SIZE=a,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:a,y:h}=this.toAffine();if(!n.isValid(a)||!n.isValid(h))throw new Error("bad point: x or y not FE");const d=n.sqr(h),m=i(a);if(!n.eql(d,m))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:a}=this.toAffine();if(n.isOdd)return!n.isOdd(a);throw new Error("Field doesn't support isOdd")}equals(a){g(a);const{px:h,py:d,pz:m}=this,{px:x,py:A,pz:v}=a,S=n.eql(n.mul(h,v),n.mul(x,m)),B=n.eql(n.mul(d,v),n.mul(A,m));return S&&B}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a,b:h}=e,d=n.mul(h,Le),{px:m,py:x,pz:A}=this;let v=n.ZERO,S=n.ZERO,B=n.ZERO,U=n.mul(m,m),F=n.mul(x,x),C=n.mul(A,A),P=n.mul(m,x);return P=n.add(P,P),B=n.mul(m,A),B=n.add(B,B),v=n.mul(a,B),S=n.mul(d,C),S=n.add(v,S),v=n.sub(F,S),S=n.add(F,S),S=n.mul(v,S),v=n.mul(P,v),B=n.mul(d,B),C=n.mul(a,C),P=n.sub(U,C),P=n.mul(a,P),P=n.add(P,B),B=n.add(U,U),U=n.add(B,U),U=n.add(U,C),U=n.mul(U,P),S=n.add(S,U),C=n.mul(x,A),C=n.add(C,C),U=n.mul(C,P),v=n.sub(v,U),B=n.mul(C,F),B=n.add(B,B),B=n.add(B,B),new f(v,S,B)}add(a){g(a);const{px:h,py:d,pz:m}=this,{px:x,py:A,pz:v}=a;let S=n.ZERO,B=n.ZERO,U=n.ZERO;const F=e.a,C=n.mul(e.b,Le);let P=n.mul(h,x),z=n.mul(d,A),j=n.mul(m,v),ft=n.add(h,d),y=n.add(x,A);ft=n.mul(ft,y),y=n.add(P,z),ft=n.sub(ft,y),y=n.add(h,m);let b=n.add(x,v);return y=n.mul(y,b),b=n.add(P,j),y=n.sub(y,b),b=n.add(d,m),S=n.add(A,v),b=n.mul(b,S),S=n.add(z,j),b=n.sub(b,S),U=n.mul(F,y),S=n.mul(C,j),U=n.add(S,U),S=n.sub(z,U),U=n.add(z,U),B=n.mul(S,U),z=n.add(P,P),z=n.add(z,P),j=n.mul(F,j),y=n.mul(C,y),z=n.add(z,j),j=n.sub(P,j),j=n.mul(F,j),y=n.add(y,j),P=n.mul(z,y),B=n.add(B,P),P=n.mul(b,y),S=n.mul(ft,S),S=n.sub(S,P),P=n.mul(ft,z),U=n.mul(b,U),U=n.add(U,P),new f(S,B,U)}subtract(a){return this.add(a.negate())}is0(){return this.equals(f.ZERO)}wNAF(a){return E.wNAFCached(this,u,a,h=>{const d=n.invertBatch(h.map(m=>m.pz));return h.map((m,x)=>m.toAffine(d[x])).map(f.fromAffine)})}multiplyUnsafe(a){const h=f.ZERO;if(a===ut)return h;if(o(a),a===X)return this;const{endo:d}=e;if(!d)return E.unsafeLadder(this,a);let{k1neg:m,k1:x,k2neg:A,k2:v}=d.splitScalar(a),S=h,B=h,U=this;for(;x>ut||v>ut;)x&X&&(S=S.add(U)),v&X&&(B=B.add(U)),U=U.double(),x>>=X,v>>=X;return m&&(S=S.negate()),A&&(B=B.negate()),B=new f(n.mul(B.px,d.beta),B.py,B.pz),S.add(B)}multiply(a){o(a);let h=a,d,m;const{endo:x}=e;if(x){const{k1neg:A,k1:v,k2neg:S,k2:B}=x.splitScalar(h);let{p:U,f:F}=this.wNAF(v),{p:C,f:P}=this.wNAF(B);U=E.constTimeNegate(A,U),C=E.constTimeNegate(S,C),C=new f(n.mul(C.px,x.beta),C.py,C.pz),d=U.add(C),m=F.add(P)}else{const{p:A,f:v}=this.wNAF(h);d=A,m=v}return f.normalizeZ([d,m])[0]}multiplyAndAddUnsafe(a,h,d){const m=f.BASE,x=(v,S)=>S===ut||S===X||!v.equals(m)?v.multiplyUnsafe(S):v.multiply(S),A=x(this,h).add(x(a,d));return A.is0()?void 0:A}toAffine(a){const{px:h,py:d,pz:m}=this,x=this.is0();a==null&&(a=x?n.ONE:n.inv(m));const A=n.mul(h,a),v=n.mul(d,a),S=n.mul(m,a);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(S,n.ONE))throw new Error("invZ was invalid");return{x:A,y:v}}isTorsionFree(){const{h:a,isTorsionFree:h}=e;if(a===X)return!0;if(h)return h(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:a,clearCofactor:h}=e;return a===X?this:h?h(f,this):this.multiplyUnsafe(e.h)}toRawBytes(a=!0){return this.assertValidity(),s(f,this,a)}toHex(a=!0){return it(this.toRawBytes(a))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const p=e.nBitLength,E=qn(f,e.endo?Math.ceil(p/2):p);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:l}}function Dn(t){const e=je(t);return qt(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Fn(t){const e=Dn(t),{Fp:n,n:s}=e,r=n.BYTES+1,i=2*n.BYTES+1;function l(y){return ut<y&&y<n.ORDER}function o(y){return K(y,s)}function c(y){return ie(y,s)}const{ProjectivePoint:u,normPrivateKeyToScalar:g,weierstrassEquation:f,isWithinCurveOrder:p}=kn({...e,toBytes(y,b,I){const O=b.toAffine(),T=n.toBytes(O.x),V=G;return I?V(Uint8Array.from([b.hasEvenY()?2:3]),T):V(Uint8Array.from([4]),T,n.toBytes(O.y))},fromBytes(y){const b=y.length,I=y[0],O=y.subarray(1);if(b===r&&(I===2||I===3)){const T=Et(O);if(!l(T))throw new Error("Point is not on curve");const V=f(T);let Y=n.sqrt(V);const M=(Y&X)===X;return(I&1)===1!==M&&(Y=n.neg(Y)),{x:T,y:Y}}else if(b===i&&I===4){const T=n.fromBytes(O.subarray(0,n.BYTES)),V=n.fromBytes(O.subarray(n.BYTES,2*n.BYTES));return{x:T,y:V}}else throw new Error(`Point of length ${b} was invalid. Expected ${r} compressed bytes or ${i} uncompressed bytes`)}}),E=y=>it(xt(y,e.nByteLength));function w(y){const b=s>>X;return y>b}function a(y){return w(y)?o(-y):y}const h=(y,b,I)=>Et(y.slice(b,I));class d{constructor(b,I,O){this.r=b,this.s=I,this.recovery=O,this.assertValidity()}static fromCompact(b){const I=e.nByteLength;return b=J("compactSignature",b,I*2),new d(h(b,0,I),h(b,I,2*I))}static fromDER(b){const{r:I,s:O}=mt.toSig(J("DER",b));return new d(I,O)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(b){return new d(this.r,this.s,b)}recoverPublicKey(b){const{r:I,s:O,recovery:T}=this,V=B(J("msgHash",b));if(T==null||![0,1,2,3].includes(T))throw new Error("recovery id invalid");const Y=T===2||T===3?I+e.n:I;if(Y>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const M=T&1?"03":"02",at=u.fromHex(M+E(Y)),ht=c(Y),vt=o(-V*ht),Ot=o(O*ht),dt=u.BASE.multiplyAndAddUnsafe(at,vt,Ot);if(!dt)throw new Error("point at infinify");return dt.assertValidity(),dt}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new d(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Pt(this.toDERHex())}toDERHex(){return mt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Pt(this.toCompactHex())}toCompactHex(){return E(this.r)+E(this.s)}}const m={isValidPrivateKey(y){try{return g(y),!0}catch{return!1}},normPrivateKeyToScalar:g,randomPrivateKey:()=>{const y=e.randomBytes(n.BYTES+8),b=Nn(y,s);return xt(b,e.nByteLength)},precompute(y=8,b=u.BASE){return b._setWindowSize(y),b.multiply(BigInt(3)),b}};function x(y,b=!0){return u.fromPrivateKey(y).toRawBytes(b)}function A(y){const b=y instanceof Uint8Array,I=typeof y=="string",O=(b||I)&&y.length;return b?O===r||O===i:I?O===2*r||O===2*i:y instanceof u}function v(y,b,I=!0){if(A(y))throw new Error("first arg must be private key");if(!A(b))throw new Error("second arg must be public key");return u.fromHex(b).multiply(g(y)).toRawBytes(I)}const S=e.bits2int||function(y){const b=Et(y),I=y.length*8-e.nBitLength;return I>0?b>>BigInt(I):b},B=e.bits2int_modN||function(y){return o(S(y))},U=he(e.nBitLength);function F(y){if(typeof y!="bigint")throw new Error("bigint expected");if(!(ut<=y&&y<U))throw new Error(`bigint expected < 2^${e.nBitLength}`);return xt(y,e.nByteLength)}function C(y,b,I=P){if(["recovered","canonical"].some(yt=>yt in I))throw new Error("sign() legacy options not supported");const{hash:O,randomBytes:T}=e;let{lowS:V,prehash:Y,extraEntropy:M}=I;V==null&&(V=!0),y=J("msgHash",y),Y&&(y=J("prehashed msgHash",O(y)));const at=B(y),ht=g(b),vt=[F(ht),F(at)];if(M!=null){const yt=M===!0?T(n.BYTES):M;vt.push(J("extraEntropy",yt,n.BYTES))}const Ot=G(...vt),dt=at;function Xt(yt){const St=S(yt);if(!p(St))return;const Ae=c(St),Bt=u.BASE.multiply(St).toAffine(),et=o(Bt.x);if(et===ut)return;const At=o(Ae*o(dt+et*ht));if(At===ut)return;let Ue=(Bt.x===et?0:2)|Number(Bt.y&X),Ie=At;return V&&w(At)&&(Ie=a(At),Ue^=1),new d(et,Ie,Ue)}return{seed:Ot,k2sig:Xt}}const P={lowS:e.lowS,prehash:!1},z={lowS:e.lowS,prehash:!1};function j(y,b,I=P){const{seed:O,k2sig:T}=C(y,b,I),V=e;return Ke(V.hash.outputLen,V.nByteLength,V.hmac)(O,T)}u.BASE._setWindowSize(8);function ft(y,b,I,O=z){var Bt;const T=y;if(b=J("msgHash",b),I=J("publicKey",I),"strict"in O)throw new Error("options.strict was renamed to lowS");const{lowS:V,prehash:Y}=O;let M,at;try{if(typeof T=="string"||T instanceof Uint8Array)try{M=d.fromDER(T)}catch(et){if(!(et instanceof mt.Err))throw et;M=d.fromCompact(T)}else if(typeof T=="object"&&typeof T.r=="bigint"&&typeof T.s=="bigint"){const{r:et,s:At}=T;M=new d(et,At)}else throw new Error("PARSE");at=u.fromHex(I)}catch(et){if(et.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(V&&M.hasHighS())return!1;Y&&(b=e.hash(b));const{r:ht,s:vt}=M,Ot=B(b),dt=c(vt),Xt=o(Ot*dt),yt=o(ht*dt),St=(Bt=u.BASE.multiplyAndAddUnsafe(at,Xt,yt))==null?void 0:Bt.toAffine();return St?o(St.x)===ht:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:v,sign:j,verify:ft,ProjectivePoint:u,Signature:d,utils:m}}function Ye(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Me(t,...e){if(!Ye(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Ft(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function We(t,e){Me(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */const Ht=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),ce=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Zn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Zn)throw new Error("Non little-endian hardware is not supported");function Kn(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Nt(t){if(typeof t=="string")t=Kn(t);else if(Ye(t))t=Ge(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function ee(t,e,n,s){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,s);const r=BigInt(32),i=BigInt(4294967295),l=Number(n>>r&i),o=Number(n&i),c=0,u=4;t.setUint32(e+c,l,s),t.setUint32(e+u,o,s)}function Ge(t){return Uint8Array.from(t)}function le(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const lt=16,ge=new Uint8Array(16),st=Ht(ge),zn=225,jn=(t,e,n,s)=>{const r=s&1;return{s3:n<<31|s>>>1,s2:e<<31|n>>>1,s1:t<<31|e>>>1,s0:t>>>1^zn<<24&-(r&1)}},Q=t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255|0;function Yn(t){t.reverse();const e=t[15]&1;let n=0;for(let s=0;s<t.length;s++){const r=t[s];t[s]=r>>>1|n,n=(r&1)<<7}return t[0]^=-e&225,t}const Mn=t=>t>64*1024?8:t>1024?4:2;class Je{constructor(e,n){this.blockLen=lt,this.outputLen=lt,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,e=Nt(e),Me(e,16);const s=ce(e);let r=s.getUint32(0,!1),i=s.getUint32(4,!1),l=s.getUint32(8,!1),o=s.getUint32(12,!1);const c=[];for(let w=0;w<128;w++)c.push({s0:Q(r),s1:Q(i),s2:Q(l),s3:Q(o)}),{s0:r,s1:i,s2:l,s3:o}=jn(r,i,l,o);const u=Mn(n||1024);if(![1,2,4,8].includes(u))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=u;const f=128/u,p=this.windowSize=2**u,E=[];for(let w=0;w<f;w++)for(let a=0;a<p;a++){let h=0,d=0,m=0,x=0;for(let A=0;A<u;A++){if(!(a>>>u-A-1&1))continue;const{s0:S,s1:B,s2:U,s3:F}=c[u*w+A];h^=S,d^=B,m^=U,x^=F}E.push({s0:h,s1:d,s2:m,s3:x})}this.t=E}_updateBlock(e,n,s,r){e^=this.s0,n^=this.s1,s^=this.s2,r^=this.s3;const{W:i,t:l,windowSize:o}=this;let c=0,u=0,g=0,f=0;const p=(1<<i)-1;let E=0;for(const w of[e,n,s,r])for(let a=0;a<4;a++){const h=w>>>8*a&255;for(let d=8/i-1;d>=0;d--){const m=h>>>i*d&p,{s0:x,s1:A,s2:v,s3:S}=l[E*o+m];c^=x,u^=A,g^=v,f^=S,E+=1}}this.s0=c,this.s1=u,this.s2=g,this.s3=f}update(e){e=Nt(e),Ft(this);const n=Ht(e),s=Math.floor(e.length/lt),r=e.length%lt;for(let i=0;i<s;i++)this._updateBlock(n[i*4+0],n[i*4+1],n[i*4+2],n[i*4+3]);return r&&(ge.set(e.subarray(s*lt)),this._updateBlock(st[0],st[1],st[2],st[3]),le(st)),this}destroy(){const{t:e}=this;for(const n of e)n.s0=0,n.s1=0,n.s2=0,n.s3=0}digestInto(e){Ft(this),We(e,this),this.finished=!0;const{s0:n,s1:s,s2:r,s3:i}=this,l=Ht(e);return l[0]=n,l[1]=s,l[2]=r,l[3]=i,e}digest(){const e=new Uint8Array(lt);return this.digestInto(e),this.destroy(),e}}class Wn extends Je{constructor(e,n){e=Nt(e);const s=Yn(Ge(e));super(s,n),le(s)}update(e){e=Nt(e),Ft(this);const n=Ht(e),s=e.length%lt,r=Math.floor(e.length/lt);for(let i=0;i<r;i++)this._updateBlock(Q(n[i*4+3]),Q(n[i*4+2]),Q(n[i*4+1]),Q(n[i*4+0]));return s&&(ge.set(e.subarray(r*lt)),this._updateBlock(Q(st[3]),Q(st[2]),Q(st[1]),Q(st[0])),le(st)),this}digestInto(e){Ft(this),We(e,this),this.finished=!0;const{s0:n,s1:s,s2:r,s3:i}=this,l=Ht(e);return l[0]=n,l[1]=s,l[2]=r,l[3]=i,e.reverse()}}function Xe(t){const e=(s,r)=>t(r,s.length).update(Nt(s)).digest(),n=t(new Uint8Array(16),0);return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=(s,r)=>t(s,r),e}const Ce=Xe((t,e)=>new Je(t,e));Xe((t,e)=>new Wn(t,e));var Gn=Object.defineProperty,Qe=(t,e)=>{for(var n in e)Gn(t,n,{get:e[n],enumerable:!0})},tn={};Qe(tn,{EmptyArray:()=>Ee,arrayToHex:()=>Gt,arrayToUtf8:()=>zt,calculateSharedKey:()=>vr,comparePublicKeyHex:()=>Er,compressPublicKeyHex:()=>mr,doDecrypt:()=>Br,doEncrypt:()=>Sr,doSignature:()=>Ar,doVerifySignature:()=>Ur,generateKeyPairHex:()=>be,getHash:()=>xe,getPoint:()=>un,getPublicKeyFromPrivateKey:()=>ln,getZ:()=>Yt,hexToArray:()=>q,initRNGPool:()=>ye,leftPad:()=>R,precomputePublicKey:()=>Ir,utf8ToHex:()=>Tt,verifyPublicKey:()=>br});var Zt=BigInt(0),_t=BigInt(1),Jn=BigInt(2);BigInt(3);function Xn(t){let e=t.toString(16);if(e[0]!=="-")e.length%2===1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{e=e.substring(1);let n=e.length;n%2===1?n+=1:e.match(/^[0-7]/)||(n+=2);let s="";for(let l=0;l<n;l++)s+="f";e=((N(s)^t)+_t).toString(16).replace(/^-/,"")}return e}var we=class{constructor(t=null,e="00",n="00",s=""){this.tlv=t,this.t=e,this.l=n,this.v=s}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const t=this.v.length/2;let e=t.toString(16);return e.length%2===1&&(e="0"+e),t<128?e:(128+e.length/2).toString(16)+e}getValue(){return""}},Kt=class extends we{constructor(t){super(),this.t="02",t&&(this.v=Xn(t))}getValue(){return this.v}},He=class extends we{constructor(e){super();H(this,"hV","");this.s=e,this.t="04",e&&(this.v=e.toLowerCase())}getValue(){return this.v}},en=class extends we{constructor(e){super();H(this,"t","30");this.asn1Array=e}getValue(){return this.v=this.asn1Array.map(e=>e.getEncodedHex()).join(""),this.v}};function nn(t,e){if(+t[e+2]<8)return 1;const s=t.slice(e+2,e+6).slice(0,2);return(parseInt(s,16)-128)*2}function ue(t,e){const n=nn(t,e),s=t.substring(e+2,e+2+n*2);return s?+(+s[0]<8?N(s):N(s.substring(2))).toString():-1}function Ct(t,e){const n=nn(t,e);return e+(n+1)*2}function Qn(t,e){const n=new Kt(t),s=new Kt(e);return new en([n,s]).getEncodedHex()}function Ne(t,e,n,s){const r=new Kt(t),i=new Kt(e),l=new He(n),o=new He(s);return new en([r,i,l,o]).getEncodedHex()}function tr(t){const e=Ct(t,0),n=Ct(t,e),s=ue(t,e),r=t.substring(n,n+s*2),i=n+r.length,l=Ct(t,i),o=ue(t,i),c=t.substring(l,l+o*2),u=N(r),g=N(c);return{r:u,s:g}}function er(t){function e(p,E){const w=Ct(p,E),a=ue(p,E),h=p.substring(w,w+a*2),d=w+h.length;return{value:h,nextStart:d}}const n=Ct(t,0),{value:s,nextStart:r}=e(t,n),{value:i,nextStart:l}=e(t,r),{value:o,nextStart:c}=e(t,l),{value:u}=e(t,c),g=N(s),f=N(i);return{x:g,y:f,hash:o,cipher:u}}var ne=16384,bt=new Uint8Array(0),Ut;async function ye(){if("crypto"in globalThis){Ut=globalThis.crypto;return}if(!(bt.length>ne/2))if("wx"in globalThis&&"getRandomValues"in globalThis.wx)bt=await new Promise(t=>{wx.getRandomValues({length:ne,success(e){t(new Uint8Array(e.randomValues))}})});else try{globalThis.crypto?Ut=globalThis.crypto:Ut=(await Promise.resolve().then(()=>require("./__vite-browser-external-BcPniuRQ.cjs"))).webcrypto;const t=new Uint8Array(ne);Ut.getRandomValues(t),bt=t}catch{throw new Error("no available csprng, abort.")}}ye();function nr(t){if(bt.length>t){const e=bt.slice(0,t);return bt=bt.slice(t),ye(),e}else throw new Error("random number pool is not ready or insufficient, prevent getting too long random values or too often.")}function rr(t=0){const e=new Uint8Array(t);return Ut?Ut.getRandomValues(e):nr(t)}var rn=t=>t instanceof Uint8Array,re=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),sr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!sr)throw new Error("Non little-endian hardware is not supported");var or=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ot(t){if(!rn(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=or[t[n]];return e}function ir(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function pe(t){if(typeof t=="string"&&(t=ir(t)),!rn(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var sn=class{clone(){return this._cloneInto()}};function cr(t){const e=s=>t().update(pe(s)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}var lr=(t,e,n)=>t&e|t&n|e&n,_e=(t,e,n)=>t^e^n,ur=(t,e,n)=>t&e|~t&n;function fr(t,e,n,s){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,s);const r=BigInt(32),i=BigInt(4294967295),l=Number(n>>r&i),o=Number(n&i),c=s?4:0,u=s?0:4;t.setUint32(e+c,l,s),t.setUint32(e+u,o,s)}function tt(t,e){const n=e&31;return t<<n|t>>>32-n}function ar(t){return t^tt(t,9)^tt(t,17)}function hr(t){return t^tt(t,15)^tt(t,23)}var dr=class extends sn{constructor(e,n,s,r){super();H(this,"buffer");H(this,"view");H(this,"finished",!1);H(this,"length",0);H(this,"pos",0);H(this,"destroyed",!1);this.blockLen=e,this.outputLen=n,this.padOffset=s,this.isLE=r,this.buffer=new Uint8Array(e),this.view=re(this.buffer)}update(e){const{view:n,buffer:s,blockLen:r}=this;e=pe(e);const i=e.length;for(let l=0;l<i;){const o=Math.min(r-this.pos,i-l);if(o===r){const c=re(e);for(;r<=i-l;l+=r)this.process(c,l);continue}s.set(e.subarray(l,l+o),this.pos),this.pos+=o,l+=o,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){this.finished=!0;const{buffer:n,view:s,blockLen:r,isLE:i}=this;let{pos:l}=this;n[l++]=128,this.buffer.subarray(l).fill(0),this.padOffset>r-l&&(this.process(s,0),l=0);for(let f=l;f<r;f++)n[f]=0;fr(s,r-8,BigInt(this.length*8),i),this.process(s,0);const o=re(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,g=this.get();if(u>g.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)o.setUint32(4*f,g[f],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const s=e.slice(0,n);return this.destroy(),s}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:s,length:r,finished:i,destroyed:l,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=l,r%n&&e.buffer.set(s),e}},gt=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),nt=new Uint32Array(68),qe=new Uint32Array(64),gr=2043430169,wr=2055708042,yr=class extends dr{constructor(){super(64,32,8,!1);H(this,"A",gt[0]|0);H(this,"B",gt[1]|0);H(this,"C",gt[2]|0);H(this,"D",gt[3]|0);H(this,"E",gt[4]|0);H(this,"F",gt[5]|0);H(this,"G",gt[6]|0);H(this,"H",gt[7]|0)}get(){const{A:e,B:n,C:s,D:r,E:i,F:l,G:o,H:c}=this;return[e,n,s,r,i,l,o,c]}set(e,n,s,r,i,l,o,c){this.A=e|0,this.B=n|0,this.C=s|0,this.D=r|0,this.E=i|0,this.F=l|0,this.G=o|0,this.H=c|0}process(e,n){for(let f=0;f<16;f++,n+=4)nt[f]=e.getUint32(n,!1);for(let f=16;f<68;f++)nt[f]=hr(nt[f-16]^nt[f-9]^tt(nt[f-3],15))^tt(nt[f-13],7)^nt[f-6];for(let f=0;f<64;f++)qe[f]=nt[f]^nt[f+4];let{A:s,B:r,C:i,D:l,E:o,F:c,G:u,H:g}=this;for(let f=0;f<64;f++){let p=f>=0&&f<=15,E=p?gr:wr,w=tt(tt(s,12)+o+tt(E,f),7),a=w^tt(s,12),h=(p?_e(s,r,i):lr(s,r,i))+l+a+qe[f]|0,d=(p?_e(o,c,u):ur(o,c,u))+g+w+nt[f]|0;l=i,i=tt(r,9),r=s,s=h,g=u,u=tt(c,19),c=o,o=ar(d)}s=s^this.A|0,r=r^this.B|0,i=i^this.C|0,l=l^this.D|0,o=o^this.E|0,c=c^this.F|0,u=u^this.G|0,g=g^this.H|0,this.set(s,r,i,l,o,c,u,g)}roundClean(){nt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},ct=cr(()=>new yr),on=class extends sn{constructor(e,n){super();H(this,"oHash");H(this,"iHash");H(this,"blockLen");H(this,"outputLen");H(this,"finished",!1);H(this,"destroyed",!1);const s=pe(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(s.length>r?e.create().update(s).digest():s);for(let l=0;l<i.length;l++)i[l]^=54;this.iHash.update(i),this.oHash=e.create();for(let l=0;l<i.length;l++)i[l]^=106;this.oHash.update(i),i.fill(0)}update(e){return this.iHash.update(e),this}digestInto(e){this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:s,finished:r,destroyed:i,blockLen:l,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=l,e.outputLen=o,e.oHash=n._cloneInto(e.oHash),e.iHash=s._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},me=(t,e,n)=>new on(t,e).update(n).digest();me.create=(t,e)=>new on(t,e);var pr=ze(BigInt("115792089210356248756420345214020892766250353991924191454421193933289684991999")),L=Fn({a:BigInt("115792089210356248756420345214020892766250353991924191454421193933289684991996"),b:BigInt("18505919022281880113072981827955639221458448578012075254857346196103069175443"),Fp:pr,h:_t,n:BigInt("115792089210356248756420345214020892766061623724957744567843809356293439045923"),Gx:BigInt("22963146547237050559479531362550074578802567295341616970375194840604139615431"),Gy:BigInt("85132369209828568825618990617112496413088388631904505083283536607588877201568"),hash:ct,hmac:(t,...e)=>me(ct,t,G(...e)),randomBytes:rr}),rt=ze(BigInt(L.CURVE.n));function be(t){const e=t?xt(K(BigInt(t),_t)+_t,32):L.utils.randomPrivateKey(),n=L.getPublicKey(e,!1),s=R(it(e),64),r=R(it(n),64);return{privateKey:s,publicKey:r}}function mr(t){if(t.length!==130)throw new Error("Invalid public key to compress");const e=(t.length-2)/2,n=t.substring(2,2+e),s=N(t.substring(e+2,e+e+2));let r="03";return K(s,Jn)===Zt&&(r="02"),r+n}function Tt(t){const e=Ze(t);return it(e)}function R(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}function Gt(t){return t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function zt(t){const e=[];for(let n=0,s=t.length;n<s;n++)t[n]>=240&&t[n]<=247?(e.push(String.fromCodePoint(((t[n]&7)<<18)+((t[n+1]&63)<<12)+((t[n+2]&63)<<6)+(t[n+3]&63))),n+=3):t[n]>=224&&t[n]<=239?(e.push(String.fromCodePoint(((t[n]&15)<<12)+((t[n+1]&63)<<6)+(t[n+2]&63))),n+=2):t[n]>=192&&t[n]<=223?(e.push(String.fromCodePoint(((t[n]&31)<<6)+(t[n+1]&63))),n++):e.push(String.fromCodePoint(t[n]));return e.join("")}function q(t){let e=t.length;e%2!==0&&(t=R(t,e+1)),e=t.length;const n=e/2,s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=parseInt(t.substring(r*2,r*2+2),16);return s}function br(t){const e=L.ProjectivePoint.fromHex(t);if(!e)return!1;try{return e.assertValidity(),!0}catch{return!1}}function Er(t,e){const n=L.ProjectivePoint.fromHex(t);if(!n)return!1;const s=L.ProjectivePoint.fromHex(e);return s?n.equals(s):!1}var Re=N("80000000000000000000000000000000"),Ve=N("7fffffffffffffffffffffffffffffff");function xr(t,e){let n=new Uint8Array(e),s=1,r=0,i=Ee;const l=new Uint8Array(4),o=()=>{l[0]=s>>24&255,l[1]=s>>16&255,l[2]=s>>8&255,l[3]=s&255,i=ct(G(t,l)),s++,r=0};o();for(let c=0,u=n.length;c<u;c++)r===i.length&&o(),n[c]=i[r++]&255;return n}function vr(t,e,n,s,r,i=!1,l="1234567812345678",o="1234567812345678"){const c=L.ProjectivePoint.fromHex(e.publicKey),u=L.ProjectivePoint.fromHex(s),g=L.ProjectivePoint.fromHex(n);let f=Yt(t.publicKey,l),p=Yt(n,o);i&&([f,p]=[p,f]);const E=N(e.privateKey),w=N(t.privateKey),a=c.x,h=Re+(a&Ve),d=rt.add(w,rt.mulN(h,E)),m=u.x,x=rt.add(Re,m&Ve),A=u.multiply(x).add(g).multiply(d),v=q(R(D(A.x),64)),S=q(R(D(A.y),64));return xr(G(v,S,f,p),r)}var jt=0,Ee=new Uint8Array;function Sr(t,e,n=1,s){const r=typeof t=="string"?q(Tt(t)):Uint8Array.from(t),i=typeof e=="string"?L.ProjectivePoint.fromHex(e):e,l=be(),o=N(l.privateKey);let c=l.publicKey;c.length>128&&(c=c.substring(c.length-128));const u=i.multiply(o),g=q(R(D(u.x),64)),f=q(R(D(u.y),64)),p=ot(ct(G(g,r,f)));cn(g,f,r);const E=ot(r);if(s!=null&&s.asn1){const w=L.ProjectivePoint.fromHex(l.publicKey);return n===jt?Ne(w.x,w.y,E,p):Ne(w.x,w.y,p,E)}return n===jt?c+E+p:c+p+E}function cn(t,e,n){let s=1,r=0,i=Ee;const l=new Uint8Array(4),o=()=>{l[0]=s>>24&255,l[1]=s>>16&255,l[2]=s>>8&255,l[3]=s&255,i=ct(G(t,e,l)),s++,r=0};o();for(let c=0,u=n.length;c<u;c++)r===i.length&&o(),n[c]^=i[r++]&255}function Br(t,e,n=1,{output:s="string",asn1:r=!1}={}){const i=N(e);let l,o,c;if(r){const{x:w,y:a,cipher:h,hash:d}=er(t);l=L.ProjectivePoint.fromAffine({x:w,y:a}),c=d,o=h,n===jt&&([o,c]=[c,o])}else l=L.ProjectivePoint.fromHex("04"+t.substring(0,128)),c=t.substring(128,192),o=t.substring(192),n===jt&&(c=t.substring(t.length-64),o=t.substring(128,t.length-64));const u=q(o),g=l.multiply(i),f=q(R(D(g.x),64)),p=q(R(D(g.y),64));return cn(f,p,u),Gt(Array.from(ct(G(f,u,p))))===c.toLowerCase()?s==="array"?u:zt(u):s==="array"?[]:""}function Ar(t,e,n={}){let{pointPool:s,der:r,hash:i,publicKey:l,userId:o}=n,c=typeof t=="string"?Tt(t):Gt(Array.from(t));i&&(l=l||ln(e),c=xe(c,l,o));const u=N(e),g=N(c);let f=null,p=null,E=null;do{do{let w;s&&s.length?w=s.pop():w=un(),f=w.k,p=rt.add(g,w.x1)}while(p===Zt||p+f===L.CURVE.n);E=rt.mul(rt.inv(rt.addN(u,_t)),rt.subN(f,rt.mulN(p,u)))}while(E===Zt);return r?Qn(p,E):R(D(p),64)+R(D(E),64)}function Ur(t,e,n,s={}){let r;const{hash:i,der:l,userId:o}=s,c=typeof n=="string"?n:n.toHex(!1);i?r=xe(typeof t=="string"?Tt(t):t,c,o):r=typeof t=="string"?Tt(t):Gt(Array.from(t));let u,g;if(l){const h=tr(e);u=h.r,g=h.s}else u=N(e.substring(0,64)),g=N(e.substring(64));const f=typeof n=="string"?L.ProjectivePoint.fromHex(n):n,p=N(r),E=rt.add(u,g);if(E===Zt)return!1;const w=L.ProjectivePoint.BASE.multiply(g).add(f.multiply(E)),a=rt.add(p,w.x);return u===a}function Yt(t,e="1234567812345678"){e=Tt(e);const n=R(D(L.CURVE.a),64),s=R(D(L.CURVE.b),64),r=R(D(L.ProjectivePoint.BASE.x),64),i=R(D(L.ProjectivePoint.BASE.y),64);let l,o;if(t.length===128)l=t.substring(0,64),o=t.substring(64,128);else{const f=L.ProjectivePoint.fromHex(t);l=R(D(f.x),64),o=R(D(f.y),64)}const c=q(e+n+s+r+i+l+o),u=e.length*4;return ct(G(new Uint8Array([u>>8&255,u&255]),c))}function xe(t,e,n="1234567812345678"){const s=Yt(e,n);return ot(ct(G(s,typeof t=="string"?q(t):t)))}function Ir(t,e){const n=L.ProjectivePoint.fromHex(t);return L.utils.precompute(e,n)}function ln(t){const e=L.getPublicKey(t,!1);return R(it(e),64)}function un(){const t=be(),e=L.ProjectivePoint.fromHex(t.publicKey),n=N(t.privateKey);return{...t,k:n,x1:e.x}}function fe(t){const e=[];for(let n=0,s=t.length;n<s;n++){const r=t.codePointAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>>6),e.push(128|r&63);else if(r<=55295||r>=57344&&r<=65535)e.push(224|r>>>12),e.push(128|r>>>6&63),e.push(128|r&63);else if(r>=65536&&r<=1114111)n++,e.push(240|r>>>18&28),e.push(128|r>>>12&63),e.push(128|r>>>6&63),e.push(128|r&63);else throw e.push(r),new Error("input is not supported")}return new Uint8Array(e)}function Pr(t,e){if(t=typeof t=="string"?fe(t):t,e){if((e.mode||"hmac")!=="hmac")throw new Error("invalid mode");let s=e.key;if(!s)throw new Error("invalid key");return s=typeof s=="string"?q(s):s,ot(me(ct,s,t))}return ot(ct(t))}var ve={};Qe(ve,{decrypt:()=>Lr,encrypt:()=>Or,sm4:()=>Se});var Z=0,fn=32,W=16,Rt=Uint8Array.from([214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72]),Vt=new Uint32Array([462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257]);function wt(t){return(Rt[t>>>24&255]&255)<<24|(Rt[t>>>16&255]&255)<<16|(Rt[t>>>8&255]&255)<<8|Rt[t&255]&255}function Lt(t,e,n){let s=0,r=0,i=0,l=0,o=0,c=0,u=0,g=0;o=t[0]&255,c=t[1]&255,u=t[2]&255,g=t[3]&255,s=o<<24|c<<16|u<<8|g,o=t[4]&255,c=t[5]&255,u=t[6]&255,g=t[7]&255,r=o<<24|c<<16|u<<8|g,o=t[8]&255,c=t[9]&255,u=t[10]&255,g=t[11]&255,i=o<<24|c<<16|u<<8|g,o=t[12]&255,c=t[13]&255,u=t[14]&255,g=t[15]&255,l=o<<24|c<<16|u<<8|g;for(let f=0;f<32;f+=4)o=r^i^l^n[f],o=wt(o),s^=o^(o<<2|o>>>30)^(o<<10|o>>>22)^(o<<18|o>>>14)^(o<<24|o>>>8),c=i^l^s^n[f+1],c=wt(c),r^=c^(c<<2|c>>>30)^(c<<10|c>>>22)^(c<<18|c>>>14)^(c<<24|c>>>8),u=l^s^r^n[f+2],u=wt(u),i^=u^(u<<2|u>>>30)^(u<<10|u>>>22)^(u<<18|u>>>14)^(u<<24|u>>>8),g=s^r^i^n[f+3],g=wt(g),l^=g^(g<<2|g>>>30)^(g<<10|g>>>22)^(g<<18|g>>>14)^(g<<24|g>>>8);e[0]=l>>>24&255,e[1]=l>>>16&255,e[2]=l>>>8&255,e[3]=l&255,e[4]=i>>>24&255,e[5]=i>>>16&255,e[6]=i>>>8&255,e[7]=i&255,e[8]=r>>>24&255,e[9]=r>>>16&255,e[10]=r>>>8&255,e[11]=r&255,e[12]=s>>>24&255,e[13]=s>>>16&255,e[14]=s>>>8&255,e[15]=s&255}function an(t,e,n){let s=0,r=0,i=0,l=0,o=0;s=(t[0]&255)<<24|(t[1]&255)<<16|(t[2]&255)<<8|t[3]&255,r=(t[4]&255)<<24|(t[5]&255)<<16|(t[6]&255)<<8|t[7]&255,i=(t[8]&255)<<24|(t[9]&255)<<16|(t[10]&255)<<8|t[11]&255,l=(t[12]&255)<<24|(t[13]&255)<<16|(t[14]&255)<<8|t[15]&255,s^=2746333894,r^=1453994832,i^=1736282519,l^=2993693404;for(let c=0;c<32;c+=4)o=r^i^l^Vt[c+0],o=wt(o),s^=o^(o<<13|o>>>19)^(o<<23|o>>>9),e[c+0]=s,o=i^l^s^Vt[c+1],o=wt(o),r^=o^(o<<13|o>>>19)^(o<<23|o>>>9),e[c+1]=r,o=l^s^r^Vt[c+2],o=wt(o),i^=o^(o<<13|o>>>19)^(o<<23|o>>>9),e[c+2]=i,o=s^r^i^Vt[c+3],o=wt(o),l^=o^(o<<13|o>>>19)^(o<<23|o>>>9),e[c+3]=l;if(n===Z)for(let c=0;c<16;c++)[e[c],e[31-c]]=[e[31-c],e[c]]}function $e(t){for(let e=t.length-1;e>=0&&(t[e]++,t[e]===0);e--);}function Tr(t,e,n,s,r,i){function l(){const a=new Uint32Array(fn);an(e,a,1);const h=new Uint8Array(16).fill(0),d=new Uint8Array(16);Lt(h,d,a);let m;if(n.length===12)m=new Uint8Array(16),m.set(n,0),m[15]=1;else{const v=Ce.create(d);v.update(n);const S=new Uint8Array(16),B=ce(S);ee(B,8,BigInt(n.length*8),!1),v.update(S),m=v.digest()}const x=new Uint8Array(m);$e(x);const A=new Uint8Array(16);return Lt(m,A,a),{roundKey:a,h:d,j0:m,counter:x,tagMask:A}}function o(a,h){const d=s.length,m=h.length,x=Ce.create(a);d>0&&x.update(s),x.update(h);const A=new Uint8Array(16),v=ce(A);return ee(v,0,BigInt(d*8),!1),ee(v,8,BigInt(m*8),!1),x.update(A),x.digest()}const{roundKey:c,h:u,counter:g,tagMask:f}=l();if(r===Z&&i){const a=o(u,t);for(let d=0;d<16;d++)a[d]^=f[d];let h=0;for(let d=0;d<16;d++)h|=a[d]^i[d];if(h!==0)throw new Error("authentication tag mismatch")}const p=new Uint8Array(t.length);let E=0,w=t.length;for(;w>=W;){const a=new Uint8Array(W);Lt(g,a,c);for(let h=0;h<W&&h<w;h++)p[E+h]=t[E+h]^a[h];$e(g),E+=W,w-=W}if(w>0){const a=new Uint8Array(W);Lt(g,a,c);for(let h=0;h<w;h++)p[E+h]=t[E+h]^a[h]}if(r!==Z){const a=o(u,p);for(let h=0;h<16;h++)a[h]^=f[h];return{output:p,tag:a}}return{output:p}}var $t=new Uint8Array(16);function Se(t,e,n,s={}){let{padding:r="pkcs#7",mode:i,iv:l=new Uint8Array(16),output:o,associatedData:c,outputTag:u,tag:g}=s;if(i==="gcm"){const h=typeof e=="string"?q(e):Uint8Array.from(e),d=typeof l=="string"?q(l):Uint8Array.from(l),m=c?typeof c=="string"?q(c):Uint8Array.from(c):new Uint8Array(0);let x;typeof t=="string"?n!==Z?x=fe(t):x=q(t):x=Uint8Array.from(t);const A=g?typeof g=="string"?q(g):Uint8Array.from(g):void 0,v=Tr(x,h,d,m,n,A);return o==="array"?u&&n!==Z?v:v.output:u&&n!==Z?{output:ot(v.output),tag:v.tag?ot(v.tag):void 0}:n!==Z?{output:ot(v.output),tag:v.tag?ot(v.tag):void 0}:zt(v.output)}if(i==="cbc"&&(typeof l=="string"&&(l=q(l)),l.length!==128/8))throw new Error("iv is invalid");if(typeof e=="string"&&(e=q(e)),e.length!==128/8)throw new Error("key is invalid");if(typeof t=="string"?n!==Z?t=fe(t):t=q(t):t=Uint8Array.from(t),(r==="pkcs#5"||r==="pkcs#7")&&n!==Z){const h=W-t.length%W,d=new Uint8Array(t.length+h);d.set(t,0);for(let m=0;m<h;m++)d[t.length+m]=h;t=d}const f=new Uint32Array(fn);an(e,f,n);let p=new Uint8Array(t.length),E=l,w=t.length,a=0;for(;w>=W;){const h=t.subarray(a,a+16);if(i==="cbc")for(let d=0;d<W;d++)n!==Z&&(h[d]^=E[d]);Lt(h,$t,f);for(let d=0;d<W;d++)i==="cbc"&&n===Z&&($t[d]^=E[d]),p[a+d]=$t[d];i==="cbc"&&(n!==Z?E=$t:E=h),w-=W,a+=W}if((r==="pkcs#5"||r==="pkcs#7")&&n===Z){const h=p.length,d=p[h-1];for(let m=1;m<=d;m++)if(p[h-m]!==d)throw new Error("padding is invalid");p=p.slice(0,h-d)}return o!=="array"?n!==Z?ot(p):zt(p):p}function Or(t,e,n={}){return Se(t,e,1,n)}function Lr(t,e,n={}){return Se(t,e,0,n)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Cr(){return tn}function Hr(t,e){return Pr(t,e)}function Nr(t,e,n){return ve.encrypt(t,e,n)}function _r(t,e,n){return ve.encrypt(t,e,n)}function Be(t,e){return t&&/^\d+$/.test(t)&&String(t).length<=10&&(t=parseInt(`${t}000`)),e?It(t,e):It(t)}function qr(t,e){return t?(It.isDayjs(t)||(t=Be(t)),t.format(e||"YYYY-MM-DD HH:mm")):""}function Rr(t){return t?(It.isDayjs(t)||(t=Be(t)),t.unix()):""}const Jt={STATE_CODE_SUCCESS:"SUCCESS",STATE_CODE_FAIL:"FAIL",STATE_CODE_NOT_FOUND:"NOT_FOUND",STATE_CODE_INFO_NOT_COMPLETE:"INCOMPLETE",STATE_CODE_NOT_ALLOWED:"NOT_ALLOWED"};function Vr(t){Object.keys(t).forEach(e=>{Jt[e]=t[e]})}function $r(t){return t||(t={}),t.loading=!0,{get(e,n){return new Promise((s,r)=>{se.get(e,n).then(i=>{s(i)}).catch(i=>{r(i)}).finally(()=>{t.loading=!1})})},post(e,n,s){return new Promise((r,i)=>{se.post(e,n,s).then(l=>{r(l)}).catch(l=>{i(l)}).finally(()=>{t.loading=!1})})}}}async function kr(t,e,n){if(t.finishedText=t.finishedText||"加载完毕",t.loading=!0,!t.uri)return console.error("URI is required in pagination"),t;let s={};try{s=await se.get(t.uri,{params:{...t.params||{},page:e||!t.page?1:t.page+1}})}catch{return t.loading=!1,t.finished=!1,t.error=!0,t}if(s.status!==Jt.STATE_CODE_SUCCESS)return t.loading=!1,t.error=!0,t.errorText=s.result,t;let r;n?r=n(s):r=s.result;let i=r.data;!e&&t.items&&(i=t.items.concat(i));const l=r.current_page||r.current||r.page||1,o=r.last_page||r.lastPage||r.pages||0,c=r.total_size||r.totalSize||r.total||0;return t.loading=!1,t.error=!1,t.page=l,t.items=i,t.finished=o===0||o===l,t.empty=c===0,t}const{STATE_CODE_FAIL:Dr,STATE_CODE_INFO_NOT_COMPLETE:Fr,STATE_CODE_NOT_FOUND:Zr,STATE_CODE_NOT_ALLOWED:Kr,STATE_CODE_SUCCESS:ke}=Jt;function zr(t){var l;const{url:e,csrfToken:n}=t;let{method:s,data:r}=t;s=s||"post",r=r||{};const i=document.createElement("form");if(i.action=e,i.method=s,i.target="_blank",i.style.display="none",Object.keys(r).forEach(o=>{const c=document.createElement("input");c.type="hidden",c.name=o,c.value=r[o],i.appendChild(c)}),!n){const o=document.createElement("input");o.type="hidden",o.name="_token",o.value=(l=document.querySelector('meta[name="csrf-token"]'))==null?void 0:l.getAttribute("content"),i.appendChild(o)}return document.body.appendChild(i),i}function hn(t,e){const{status:n}=t,s=t.result,r={};r.default="请求失败, 请检查数据并重试",r[Dr]="系统错误,请稍候再试",r[Zr]="请求的内容不存在",r[Fr]="信息不完整",r[Kr]="没有权限";const i={[ke]:"success"},l=e[n]||e[i[n]]||r[n]||r.def;$.isString(l)?n===ke?Dt.message.success(l):Dt.message.error(s||l):$.isFunction(l)&&l()}function jr(t,e){hn(t,{success:e})}function Yr(t){t&&t.errorFields?t.errorFields.forEach(e=>{Dt.message.error(e.errors.join(" "))}):t&&t.response||Dt.message.error("请检查填写项")}const Mr={commonLabelCol:{span:8,xxl:6},commonWrapperCol:{span:12,xxl:14},commonWrapperOffset:{xs:{offset:8,span:12},xxl:{offset:6,span:14}},commonLabelFullCol:{span:8,xxl:6},commonWrapperFullCol:{span:16,xxl:18},commonWrapperFullOffset:{xs:{offset:8,span:16},xxl:{offset:6,span:18}},commonLabelPartCol:{span:4,xxl:3},commonWrapperPartCol:{span:20,xxl:21},commonWrapperPartOffset:{xs:{offset:4,span:20},xxl:{offset:3,span:21}}};function Wr(t,e){const n=$.cloneDeep(t);e=e||{};const s=r=>{var i,l;for(let o in r){let c;if(It.isDayjs(r[o])?c=r[o]:Object.prototype.toString.call(r[o])==="[object Date]"&&(c=It(r[o])),c&&e.date){$.isString(e.date)?r[o]=c.format(e.date):$.isFunction(e.date)?r[o]=e.date(c):r[o]=r[o].unix();continue}if($.isBoolean(r[o])&&e.boolean){e.boolean===!0?r[o]=r[o]?1:0:Array.isArray(e.boolean)&&(r[o]=r[o]?((i=e.boolean)==null?void 0:i[0])||1:((l=e.boolean)==null?void 0:l[1])||0);continue}if(e.attachment){const u=e.attachment;if($.isObject(r[o])&&r[o]._type==="file"&&$.isString(u)&&!$.isUndefined(r[o][u])){r[o]=r[o][u];continue}else if($.isObject(r[o])&&r[o]._type==="file"&&$.isFunction(u)){r[o]=u(r[o]);continue}}$.isArray(r[o])&&(r[o]=s(r[o]))}return r};return s(n)}function Gr(t,e){if(!e)return"";const n=e.find(s=>s.value===t);return n?n.label:""}function Jr(t,e,n){n=n||{value:"value",label:"label",children:"children"};const s=[];function r(i){var l;e.includes(i[n.value])&&s.push(i[n.label]),(l=i[n.children])!=null&&l.length&&i[n.children].forEach(o=>{r(o)})}return t.forEach(i=>{r(i)}),s}function dn(t,e,n){n=n||{value:"value",label:"label",children:"children"};for(let s of t){if(s[n.value]===e)return s;if(s[n.children]&&s[n.children].length){const r=dn(s[n.children],e,n);if(r)return r}}return null}function Xr(t,e,n){n=n||{value:"value",label:"label",children:"children"};const s=[];return $.reduce(e,(r,i)=>{const l=$.find(r,{[n.value]:i});if(l)return s.push(l[n.label]),l[n.children]},t),s}function Qr(t,e,n){n=n||{value:"value",label:"label",children:"children"};const s=[];function r(i,l,o){for(const c of i)if(c[n.value]===l){o.unshift(c[n.label]);break}else if(c[n.children]&&r(c[n.children],l,o).length>0){o.unshift(c[n.label]);break}return o}return r(t,e,s)}function ts(t,e,n){n=n||{value:"value",label:"label",children:"children"};const s=[];function r(i,l,o){for(const c of i)if(c[n.value]===l){o.unshift(c[n.value]);break}else if(c[n.children]&&r(c[n.children],l,o).length>0){o.unshift(c[n.value]);break}return o}return r(t,e,s)}function gn(t,e,n){return $.flatMapDeep(t,(s,r)=>r===e?s:r===n?gn(s,e,n):[])}const kt={},es={setItem(t,e){kt[t]=e},getItem(t){return kt[t]},removeItem(t){delete kt[t]}};window._printCache=()=>{console.log(JSON.parse(JSON.stringify(kt,null,2)))};function ns(t,e){const n=e||es,s=!!e;return{get(r){const i=n.getItem(t);return $.isNull(i)||$.isUndefined(i)?r:s?JSON.parse(i):i},set(r){n.setItem(t,s?JSON.stringify(r):r)},remove(){n.removeItem(t)}}}exports.STATUS=Jt;exports._configStatus=Vr;exports.formLabel=Mr;exports.useCache=ns;exports.useDateFormat=qr;exports.useDateUnix=Rr;exports.useDayjs=Be;exports.useFetch=$r;exports.useFindLabelsFromPath=Xr;exports.useFindLabelsInValues=Jr;exports.useFindOptionByValue=dn;exports.useFindParentLabels=Qr;exports.useFindParentValues=ts;exports.useFindPropertyRecursive=gn;exports.useFormFail=Yr;exports.useFormFormat=Wr;exports.useHiddenForm=zr;exports.useLabelFromOptionsValue=Gr;exports.usePage=kr;exports.useProcessStatus=hn;exports.useProcessStatusSuccess=jr;exports.useSm2=Cr;exports.useSm3=Hr;exports.useSm4Decrypt=_r;exports.useSm4Encrypt=Nr;
//# sourceMappingURL=utils-B2r9oQh6.cjs.map