import{d as Y,K as y,G as M,at as pe,J as N,H as z,I as te,M as Se,cY as Re,a_ as Ae,aF as Oe,cZ as Ve,ao as Te,c_ as Ue,a3 as Ee,F as De,c$ as Fe,aq as je,ah as le,aA as ce,B as Q,L as me,c9 as ge,d0 as xe,z as Me,P as ne,R as Ne,O as _e,a as re,U as qe,ay as Ke,au as $,aX as ye,d1 as Xe,d2 as ie,d3 as ae,aE as ze,X as se,d4 as be,c0 as We}from"./index-BhlVWTSX.js";const Ge=Y({name:"ArrowDown",render(){return y("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z"}))))}}),Ze=Y({name:"ArrowUp",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},y("g",{fill:"none"},y("path",{d:"M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z",fill:"currentColor"})))}}),C="0!important",Ce="-1px!important";function G(r){return z(`${r}-type`,[N("& +",[M("button",{},[z(`${r}-type`,[te("border",{borderLeftWidth:C}),te("state-border",{left:Ce})])])])])}function Z(r){return z(`${r}-type`,[N("& +",[M("button",[z(`${r}-type`,[te("border",{borderTopWidth:C}),te("state-border",{top:Ce})])])])])}const Je=M("button-group",`
 flex-wrap: nowrap;
 display: inline-flex;
 position: relative;
`,[pe("vertical",{flexDirection:"row"},[pe("rtl",[M("button",[N("&:first-child:not(:last-child)",`
 margin-right: ${C};
 border-top-right-radius: ${C};
 border-bottom-right-radius: ${C};
 `),N("&:last-child:not(:first-child)",`
 margin-left: ${C};
 border-top-left-radius: ${C};
 border-bottom-left-radius: ${C};
 `),N("&:not(:first-child):not(:last-child)",`
 margin-left: ${C};
 margin-right: ${C};
 border-radius: ${C};
 `),G("default"),z("ghost",[G("primary"),G("info"),G("success"),G("warning"),G("error")])])])]),z("vertical",{flexDirection:"column"},[M("button",[N("&:first-child:not(:last-child)",`
 margin-bottom: ${C};
 margin-left: ${C};
 margin-right: ${C};
 border-bottom-left-radius: ${C};
 border-bottom-right-radius: ${C};
 `),N("&:last-child:not(:first-child)",`
 margin-top: ${C};
 margin-left: ${C};
 margin-right: ${C};
 border-top-left-radius: ${C};
 border-top-right-radius: ${C};
 `),N("&:not(:first-child):not(:last-child)",`
 margin: ${C};
 border-radius: ${C};
 `),Z("default"),z("ghost",[Z("primary"),Z("info"),Z("success"),Z("warning"),Z("error")])])])]),Ye={size:String,vertical:Boolean},Qe=Y({name:"ButtonGroup",props:Ye,setup(r){const{mergedClsPrefixRef:l,mergedRtlRef:b}=Se(r);return Re("-button-group",Je,l),Oe(Ve,r),{rtlEnabled:Ae("ButtonGroup",b,l),mergedClsPrefix:l}},render(){const{mergedClsPrefix:r}=this;return y("div",{class:[`${r}-button-group`,this.rtlEnabled&&`${r}-button-group--rtl`,this.vertical&&`${r}-button-group--vertical`],role:"group"},this.$slots)}});function $e(){return Fe}const et=Te({name:"DynamicInput",common:De,peers:{Input:Ee,Button:Ue},self:$e}),de=je("n-dynamic-input"),tt=Y({name:"DynamicInputInputPreset",props:{clsPrefix:{type:String,required:!0},value:{type:String,default:""},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){const{mergedThemeRef:r,placeholderRef:l}=ce(de);return{mergedTheme:r,placeholder:l}},render(){const{mergedTheme:r,placeholder:l,value:b,clsPrefix:f,onUpdateValue:m,disabled:R}=this;return y("div",{class:`${f}-dynamic-input-preset-input`},y(le,{theme:r.peers.Input,"theme-overrides":r.peerOverrides.Input,value:b,placeholder:l,onUpdateValue:m,disabled:R}))}}),nt=Y({name:"DynamicInputPairPreset",props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:"",value:""})},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(r){const{mergedThemeRef:l,keyPlaceholderRef:b,valuePlaceholderRef:f}=ce(de);return{mergedTheme:l,keyPlaceholder:b,valuePlaceholder:f,handleKeyInput(m){r.onUpdateValue({key:m,value:r.value.value})},handleValueInput(m){r.onUpdateValue({key:r.value.key,value:m})}}},render(){const{mergedTheme:r,keyPlaceholder:l,valuePlaceholder:b,value:f,clsPrefix:m,disabled:R}=this;return y("div",{class:`${m}-dynamic-input-preset-pair`},y(le,{theme:r.peers.Input,"theme-overrides":r.peerOverrides.Input,value:f.key,class:`${m}-dynamic-input-pair-input`,placeholder:l,onUpdateValue:this.handleKeyInput,disabled:R}),y(le,{theme:r.peers.Input,"theme-overrides":r.peerOverrides.Input,value:f.value,class:`${m}-dynamic-input-pair-input`,placeholder:b,onUpdateValue:this.handleValueInput,disabled:R}))}}),rt=M("dynamic-input",{width:"100%"},[M("dynamic-input-item",`
 margin-bottom: 10px;
 display: flex;
 flex-wrap: nowrap;
 `,[M("dynamic-input-preset-input",{flex:1,alignItems:"center"}),M("dynamic-input-preset-pair",`
 flex: 1;
 display: flex;
 align-items: center;
 `,[M("dynamic-input-pair-input",[N("&:first-child",{"margin-right":"12px"})])]),te("action",`
 align-self: flex-start;
 display: flex;
 justify-content: flex-end;
 flex-shrink: 0;
 flex-grow: 0;
 margin: var(--action-margin);
 `,[z("icon",{cursor:"pointer"})]),N("&:last-child",{marginBottom:0})]),M("form-item",`
 padding-top: 0 !important;
 margin-right: 0 !important;
 `,[M("form-item-blank",{paddingTop:"0 !important"})])]),oe=new WeakMap,ot=Object.assign(Object.assign({},_e.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:"input"},keyField:String,itemClass:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:""},valuePlaceholder:{type:String,default:""},placeholder:{type:String,default:""},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]}),ht=Y({name:"DynamicInput",props:ot,setup(r,{slots:l}){const{mergedComponentPropsRef:b,mergedClsPrefixRef:f,mergedRtlRef:m,inlineThemeDisabled:R}=Se(),H=ce(xe,null),T=Me(r.defaultValue),D=ne(r,"value"),P=Ne(D,T),E=_e("DynamicInput","-dynamic-input",rt,et,r,f),L=re(()=>{const{value:n}=P;if(Array.isArray(n)){const{max:t}=r;return t!==void 0&&n.length>=t}return!1}),F=re(()=>{const{value:n}=P;return Array.isArray(n)?n.length<=r.min:!0}),j=re(()=>{var n,t;return(t=(n=b?.value)===null||n===void 0?void 0:n.DynamicInput)===null||t===void 0?void 0:t.buttonSize});function h(n){const{onInput:t,"onUpdate:value":o,onUpdateValue:u}=r;t&&se(t,n),o&&se(o,n),u&&se(u,n),T.value=n}function k(n,t){if(n==null||typeof n!="object")return t;const o=ie(n)?ae(n):n;let u=oe.get(o);return u===void 0&&oe.set(o,u=ze()),u}function v(n,t){const{value:o}=P,u=Array.from(o??[]),B=u[n];if(u[n]=t,B&&t&&typeof B=="object"&&typeof t=="object"){const V=ie(B)?ae(B):B,X=ie(t)?ae(t):t,q=oe.get(V);q!==void 0&&oe.set(X,q)}h(u)}function S(){w(-1)}function w(n){const{value:t}=P,{onCreate:o}=r,u=Array.from(t??[]);if(o)u.splice(n+1,0,o(n+1)),h(u);else if(l.default)u.splice(n+1,0,null),h(u);else switch(r.preset){case"input":u.splice(n+1,0,""),h(u);break;case"pair":u.splice(n+1,0,{key:"",value:""}),h(u);break}}function A(n){const{value:t}=P;if(!Array.isArray(t))return;const{min:o}=r;if(t.length<=o)return;const{onRemove:u}=r;u&&u(n);const B=Array.from(t);B.splice(n,1),h(B)}function a(n,t,o){if(t<0||o<0||t>=n.length||o>=n.length||t===o)return;const u=n[t];n[t]=n[o],n[o]=u}function i(n,t){const{value:o}=P;if(!Array.isArray(o))return;const u=Array.from(o);n==="up"&&a(u,t,t-1),n==="down"&&a(u,t,t+1),h(u)}Oe(de,{mergedThemeRef:E,keyPlaceholderRef:ne(r,"keyPlaceholder"),valuePlaceholderRef:ne(r,"valuePlaceholder"),placeholderRef:ne(r,"placeholder")});const c=Ae("DynamicInput",m,f),p=re(()=>{const{self:{actionMargin:n,actionMarginRtl:t}}=E.value;return{"--action-margin":n,"--action-margin-rtl":t}}),g=R?qe("dynamic-input",void 0,p,r):void 0;return{locale:Ke("DynamicInput").localeRef,rtlEnabled:c,buttonSize:j,mergedClsPrefix:f,NFormItem:H,uncontrolledValue:T,mergedValue:P,insertionDisabled:L,removeDisabled:F,handleCreateClick:S,ensureKey:k,handleValueChange:v,remove:A,move:i,createItem:w,mergedTheme:E,cssVars:R?void 0:p,themeClass:g?.themeClass,onRender:g?.onRender}},render(){const{$slots:r,itemClass:l,buttonSize:b,mergedClsPrefix:f,mergedValue:m,locale:R,mergedTheme:H,keyField:T,itemStyle:D,preset:P,showSortButton:E,NFormItem:L,ensureKey:F,handleValueChange:j,remove:h,createItem:k,move:v,onRender:S,disabled:w}=this;return S?.(),y("div",{class:[`${f}-dynamic-input`,this.rtlEnabled&&`${f}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(m)||m.length===0?y(Q,Object.assign({block:!0,ghost:!0,dashed:!0,size:b},this.createButtonProps,{disabled:this.insertionDisabled||w,theme:H.peers.Button,themeOverrides:H.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>me(r["create-button-default"],()=>[R.create]),icon:()=>me(r["create-button-icon"],()=>[y($,{clsPrefix:f},{default:()=>y(ye,null)})])}):m.map((A,a)=>y("div",{key:T?A[T]:F(A,a),"data-key":T?A[T]:F(A,a),class:[`${f}-dynamic-input-item`,l],style:D},ge(r.default,{value:m[a],index:a},()=>[P==="input"?y(tt,{disabled:w,clsPrefix:f,value:m[a],parentPath:L?L.path.value:void 0,path:L?.path.value?`${L.path.value}[${a}]`:void 0,onUpdateValue:i=>{j(a,i)}}):P==="pair"?y(nt,{disabled:w,clsPrefix:f,value:m[a],parentPath:L?L.path.value:void 0,path:L?.path.value?`${L.path.value}[${a}]`:void 0,onUpdateValue:i=>{j(a,i)}}):null]),ge(r.action,{value:m[a],index:a,create:k,remove:h,move:v},()=>[y("div",{class:`${f}-dynamic-input-item__action`},y(Qe,{size:b},{default:()=>[y(Q,{disabled:this.removeDisabled||w,theme:H.peers.Button,themeOverrides:H.peerOverrides.Button,circle:!0,onClick:()=>{h(a)}},{icon:()=>y($,{clsPrefix:f},{default:()=>y(Xe,null)})}),y(Q,{disabled:this.insertionDisabled||w,circle:!0,theme:H.peers.Button,themeOverrides:H.peerOverrides.Button,onClick:()=>{k(a)}},{icon:()=>y($,{clsPrefix:f},{default:()=>y(ye,null)})}),E?y(Q,{disabled:a===0||w,circle:!0,theme:H.peers.Button,themeOverrides:H.peerOverrides.Button,onClick:()=>{v("up",a)}},{icon:()=>y($,{clsPrefix:f},{default:()=>y(Ze,null)})}):null,E?y(Q,{disabled:a===m.length-1||w,circle:!0,theme:H.peers.Button,themeOverrides:H.peerOverrides.Button,onClick:()=>{v("down",a)}},{icon:()=>y($,{clsPrefix:f},{default:()=>y(Ge,null)})}):null]}))]))))}});var J={},K={},I={},d={},ve;function it(){if(ve)return d;ve=1,Object.defineProperty(d,"__esModule",{value:!0}),d.toBig=d.shrSL=d.shrSH=d.rotrSL=d.rotrSH=d.rotrBL=d.rotrBH=d.rotr32L=d.rotr32H=d.rotlSL=d.rotlSH=d.rotlBL=d.rotlBH=d.add5L=d.add5H=d.add4L=d.add4H=d.add3L=d.add3H=void 0,d.add=S,d.fromBig=b,d.split=f;const r=BigInt(2**32-1),l=BigInt(32);function b(n,t=!1){return t?{h:Number(n&r),l:Number(n>>l&r)}:{h:Number(n>>l&r)|0,l:Number(n&r)|0}}function f(n,t=!1){const o=n.length;let u=new Uint32Array(o),B=new Uint32Array(o);for(let V=0;V<o;V++){const{h:X,l:q}=b(n[V],t);[u[V],B[V]]=[X,q]}return[u,B]}const m=(n,t)=>BigInt(n>>>0)<<l|BigInt(t>>>0);d.toBig=m;const R=(n,t,o)=>n>>>o;d.shrSH=R;const H=(n,t,o)=>n<<32-o|t>>>o;d.shrSL=H;const T=(n,t,o)=>n>>>o|t<<32-o;d.rotrSH=T;const D=(n,t,o)=>n<<32-o|t>>>o;d.rotrSL=D;const P=(n,t,o)=>n<<64-o|t>>>o-32;d.rotrBH=P;const E=(n,t,o)=>n>>>o-32|t<<64-o;d.rotrBL=E;const L=(n,t)=>t;d.rotr32H=L;const F=(n,t)=>n;d.rotr32L=F;const j=(n,t,o)=>n<<o|t>>>32-o;d.rotlSH=j;const h=(n,t,o)=>t<<o|n>>>32-o;d.rotlSL=h;const k=(n,t,o)=>t<<o-32|n>>>64-o;d.rotlBH=k;const v=(n,t,o)=>n<<o-32|t>>>64-o;d.rotlBL=v;function S(n,t,o,u){const B=(t>>>0)+(u>>>0);return{h:n+o+(B/2**32|0)|0,l:B|0}}const w=(n,t,o)=>(n>>>0)+(t>>>0)+(o>>>0);d.add3L=w;const A=(n,t,o,u)=>t+o+u+(n/2**32|0)|0;d.add3H=A;const a=(n,t,o,u)=>(n>>>0)+(t>>>0)+(o>>>0)+(u>>>0);d.add4L=a;const i=(n,t,o,u,B)=>t+o+u+B+(n/2**32|0)|0;d.add4H=i;const c=(n,t,o,u,B)=>(n>>>0)+(t>>>0)+(o>>>0)+(u>>>0)+(B>>>0);d.add5L=c;const p=(n,t,o,u,B,V)=>t+o+u+B+V+(n/2**32|0)|0;d.add5H=p;const g={fromBig:b,split:f,toBig:m,shrSH:R,shrSL:H,rotrSH:T,rotrSL:D,rotrBH:P,rotrBL:E,rotr32H:L,rotr32L:F,rotlSH:j,rotlSL:h,rotlBH:k,rotlBL:v,add:S,add3L:w,add3H:A,add4L:a,add4H:i,add5H:p,add5L:c};return d.default=g,d}var ue={},ee={},we;function at(){return we||(we=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.crypto=void 0,ee.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),ee}var Be;function st(){return Be||(Be=1,(function(r){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(r,"__esModule",{value:!0}),r.wrapXOFConstructorWithOpts=r.wrapConstructorWithOpts=r.wrapConstructor=r.Hash=r.nextTick=r.swap32IfBE=r.byteSwapIfBE=r.swap8IfBE=r.isLE=void 0,r.isBytes=b,r.anumber=f,r.abytes=m,r.ahash=R,r.aexists=H,r.aoutput=T,r.u8=D,r.u32=P,r.clean=E,r.createView=L,r.rotr=F,r.rotl=j,r.byteSwap=h,r.byteSwap32=k,r.bytesToHex=w,r.hexToBytes=i,r.asyncLoop=p,r.utf8ToBytes=g,r.bytesToUtf8=n,r.toBytes=t,r.kdfInputToBytes=o,r.concatBytes=u,r.checkOpts=B,r.createHasher=X,r.createOptHasher=q,r.createXOFer=W,r.randomBytes=He;const l=at();function b(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function f(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function m(e,...s){if(!b(e))throw new Error("Uint8Array expected");if(s.length>0&&!s.includes(e.length))throw new Error("Uint8Array expected of length "+s+", got length="+e.length)}function R(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");f(e.outputLen),f(e.blockLen)}function H(e,s=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(s&&e.finished)throw new Error("Hash#digest() has already been called")}function T(e,s){m(e);const O=s.outputLen;if(e.length<O)throw new Error("digestInto() expects output buffer of length at least "+O)}function D(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function P(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function E(...e){for(let s=0;s<e.length;s++)e[s].fill(0)}function L(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function F(e,s){return e<<32-s|e>>>s}function j(e,s){return e<<s|e>>>32-s>>>0}r.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function h(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}r.swap8IfBE=r.isLE?e=>e:e=>h(e),r.byteSwapIfBE=r.swap8IfBE;function k(e){for(let s=0;s<e.length;s++)e[s]=h(e[s]);return e}r.swap32IfBE=r.isLE?e=>e:k;const v=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",S=Array.from({length:256},(e,s)=>s.toString(16).padStart(2,"0"));function w(e){if(m(e),v)return e.toHex();let s="";for(let O=0;O<e.length;O++)s+=S[e[O]];return s}const A={_0:48,_9:57,A:65,F:70,a:97,f:102};function a(e){if(e>=A._0&&e<=A._9)return e-A._0;if(e>=A.A&&e<=A.F)return e-(A.A-10);if(e>=A.a&&e<=A.f)return e-(A.a-10)}function i(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(v)return Uint8Array.fromHex(e);const s=e.length,O=s/2;if(s%2)throw new Error("hex string expected, got unpadded hex of length "+s);const _=new Uint8Array(O);for(let U=0,x=0;U<O;U++,x+=2){const fe=a(e.charCodeAt(x)),he=a(e.charCodeAt(x+1));if(fe===void 0||he===void 0){const Pe=e[x]+e[x+1];throw new Error('hex string expected, got non-hex character "'+Pe+'" at index '+x)}_[U]=fe*16+he}return _}const c=async()=>{};r.nextTick=c;async function p(e,s,O){let _=Date.now();for(let U=0;U<e;U++){O(U);const x=Date.now()-_;x>=0&&x<s||(await(0,r.nextTick)(),_+=x)}}function g(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function n(e){return new TextDecoder().decode(e)}function t(e){return typeof e=="string"&&(e=g(e)),m(e),e}function o(e){return typeof e=="string"&&(e=g(e)),m(e),e}function u(...e){let s=0;for(let _=0;_<e.length;_++){const U=e[_];m(U),s+=U.length}const O=new Uint8Array(s);for(let _=0,U=0;_<e.length;_++){const x=e[_];O.set(x,U),U+=x.length}return O}function B(e,s){if(s!==void 0&&{}.toString.call(s)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,s)}class V{}r.Hash=V;function X(e){const s=_=>e().update(t(_)).digest(),O=e();return s.outputLen=O.outputLen,s.blockLen=O.blockLen,s.create=()=>e(),s}function q(e){const s=(_,U)=>e(U).update(t(_)).digest(),O=e({});return s.outputLen=O.outputLen,s.blockLen=O.blockLen,s.create=_=>e(_),s}function W(e){const s=(_,U)=>e(U).update(t(_)).digest(),O=e({});return s.outputLen=O.outputLen,s.blockLen=O.blockLen,s.create=_=>e(_),s}r.wrapConstructor=X,r.wrapConstructorWithOpts=q,r.wrapXOFConstructorWithOpts=W;function He(e=32){if(l.crypto&&typeof l.crypto.getRandomValues=="function")return l.crypto.getRandomValues(new Uint8Array(e));if(l.crypto&&typeof l.crypto.randomBytes=="function")return Uint8Array.from(l.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}})(ue)),ue}var ke;function ut(){if(ke)return I;ke=1,Object.defineProperty(I,"__esModule",{value:!0}),I.shake256=I.shake128=I.keccak_512=I.keccak_384=I.keccak_256=I.keccak_224=I.sha3_512=I.sha3_384=I.sha3_256=I.sha3_224=I.Keccak=void 0,I.keccakP=v;const r=it(),l=st(),b=BigInt(0),f=BigInt(1),m=BigInt(2),R=BigInt(7),H=BigInt(256),T=BigInt(113),D=[],P=[],E=[];for(let a=0,i=f,c=1,p=0;a<24;a++){[c,p]=[p,(2*c+3*p)%5],D.push(2*(5*p+c)),P.push((a+1)*(a+2)/2%64);let g=b;for(let n=0;n<7;n++)i=(i<<f^(i>>R)*T)%H,i&m&&(g^=f<<(f<<BigInt(n))-f);E.push(g)}const L=(0,r.split)(E,!0),F=L[0],j=L[1],h=(a,i,c)=>c>32?(0,r.rotlBH)(a,i,c):(0,r.rotlSH)(a,i,c),k=(a,i,c)=>c>32?(0,r.rotlBL)(a,i,c):(0,r.rotlSL)(a,i,c);function v(a,i=24){const c=new Uint32Array(10);for(let p=24-i;p<24;p++){for(let t=0;t<10;t++)c[t]=a[t]^a[t+10]^a[t+20]^a[t+30]^a[t+40];for(let t=0;t<10;t+=2){const o=(t+8)%10,u=(t+2)%10,B=c[u],V=c[u+1],X=h(B,V,1)^c[o],q=k(B,V,1)^c[o+1];for(let W=0;W<50;W+=10)a[t+W]^=X,a[t+W+1]^=q}let g=a[2],n=a[3];for(let t=0;t<24;t++){const o=P[t],u=h(g,n,o),B=k(g,n,o),V=D[t];g=a[V],n=a[V+1],a[V]=u,a[V+1]=B}for(let t=0;t<50;t+=10){for(let o=0;o<10;o++)c[o]=a[t+o];for(let o=0;o<10;o++)a[t+o]^=~c[(o+2)%10]&c[(o+4)%10]}a[0]^=F[p],a[1]^=j[p]}(0,l.clean)(c)}class S extends l.Hash{constructor(i,c,p,g=!1,n=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=i,this.suffix=c,this.outputLen=p,this.enableXOF=g,this.rounds=n,(0,l.anumber)(p),!(0<i&&i<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,l.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,l.swap32IfBE)(this.state32),v(this.state32,this.rounds),(0,l.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(i){(0,l.aexists)(this),i=(0,l.toBytes)(i),(0,l.abytes)(i);const{blockLen:c,state:p}=this,g=i.length;for(let n=0;n<g;){const t=Math.min(c-this.pos,g-n);for(let o=0;o<t;o++)p[this.pos++]^=i[n++];this.pos===c&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:i,suffix:c,pos:p,blockLen:g}=this;i[p]^=c,(c&128)!==0&&p===g-1&&this.keccak(),i[g-1]^=128,this.keccak()}writeInto(i){(0,l.aexists)(this,!1),(0,l.abytes)(i),this.finish();const c=this.state,{blockLen:p}=this;for(let g=0,n=i.length;g<n;){this.posOut>=p&&this.keccak();const t=Math.min(p-this.posOut,n-g);i.set(c.subarray(this.posOut,this.posOut+t),g),this.posOut+=t,g+=t}return i}xofInto(i){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(i)}xof(i){return(0,l.anumber)(i),this.xofInto(new Uint8Array(i))}digestInto(i){if((0,l.aoutput)(i,this),this.finished)throw new Error("digest() was already called");return this.writeInto(i),this.destroy(),i}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,l.clean)(this.state)}_cloneInto(i){const{blockLen:c,suffix:p,outputLen:g,rounds:n,enableXOF:t}=this;return i||(i=new S(c,p,g,t,n)),i.state32.set(this.state32),i.pos=this.pos,i.posOut=this.posOut,i.finished=this.finished,i.rounds=n,i.suffix=p,i.outputLen=g,i.enableXOF=t,i.destroyed=this.destroyed,i}}I.Keccak=S;const w=(a,i,c)=>(0,l.createHasher)(()=>new S(i,a,c));I.sha3_224=w(6,144,224/8),I.sha3_256=w(6,136,256/8),I.sha3_384=w(6,104,384/8),I.sha3_512=w(6,72,512/8),I.keccak_224=w(1,144,224/8),I.keccak_256=w(1,136,256/8),I.keccak_384=w(1,104,384/8),I.keccak_512=w(1,72,512/8);const A=(a,i,c)=>(0,l.createXOFer)((p={})=>new S(i,a,p.dkLen===void 0?c:p.dkLen,!0));return I.shake128=A(31,168,128/8),I.shake256=A(31,136,256/8),I}var Ie;function lt(){if(Ie)return K;Ie=1;const{sha3_512:r}=ut(),l=24,b=32,f=(h=4,k=Math.random)=>{let v="";for(;v.length<h;)v=v+Math.floor(k()*36).toString(36);return v};function m(h){let k=8n,v=0n;for(const S of h.values()){const w=BigInt(S);v=(v<<k)+w}return v}const R=(h="")=>m(r(h)).toString(36).slice(1),H=Array.from({length:26},(h,k)=>String.fromCharCode(k+97)),T=h=>H[Math.floor(h()*H.length)],D=({globalObj:h=typeof be<"u"?be:typeof window<"u"?window:{},random:k=Math.random}={})=>{const v=Object.keys(h).toString(),S=v.length?v+f(b,k):f(b,k);return R(S).substring(0,b)},P=h=>()=>h++,E=476782367,L=({random:h=Math.random,counter:k=P(Math.floor(h()*E)),length:v=l,fingerprint:S=D({random:h})}={})=>function(){const A=T(h),a=Date.now().toString(36),i=k().toString(36),c=f(v,h),p=`${a+c+i+S}`;return`${A+R(p).substring(1,v)}`},F=L(),j=(h,{minLength:k=2,maxLength:v=b}={})=>{const S=h.length,w=/^[0-9a-z]+$/;try{if(typeof h=="string"&&S>=k&&S<=v&&w.test(h))return!0}finally{}return!1};return K.getConstants=()=>({defaultLength:l,bigLength:b}),K.init=L,K.createId=F,K.bufToBigInt=m,K.createCounter=P,K.createFingerprint=D,K.isCuid=j,K}var Le;function ct(){if(Le)return J;Le=1;const{createId:r,init:l,getConstants:b,isCuid:f}=lt();return J.createId=r,J.init=l,J.getConstants=b,J.isCuid=f,J}var dt=ct();const pt=We(dt);export{ht as N,pt as c};
