From f67a5b8d8e1bf91d479b5b9fceb080aead6b1f45 Mon Sep 17 00:00:00 2001 From: lss233 <8984680+lss233@users.noreply.github.com> Date: Wed, 10 May 2023 23:09:31 +0800 Subject: [PATCH] feat(webui): add static files --- assets/webui/assets/AboutView-5953b7f8.js | 1 + assets/webui/assets/AboutView-6b0b8d35.css | 1 + .../assets/AccountConfigView-adf60d3d.js | 1 + .../assets/AccountConfigView-d360e00d.css | 1 + .../assets/ConfigurationList-1bddc793.js | 552 +++++++++++++++++ .../assets/ConfigurationList-d389253d.css | 1 + assets/webui/assets/LoginView-69f14d49.css | 1 + assets/webui/assets/LoginView-72e77614.js | 1 + .../assets/PlatformConfigView-650e588f.css | 1 + .../assets/PlatformConfigView-98be4497.js | 1 + .../assets/UtilitiesConfigView-95bcc0d6.css | 1 + .../assets/UtilitiesConfigView-9ebc05cf.js | 1 + assets/webui/assets/index-086b42c5.js | 570 ++++++++++++++++++ assets/webui/assets/index-60c2ab7f.css | 1 + .../webui/assets/use-loading-bar-690133ee.js | 1 + assets/webui/favicon.ico | Bin 0 -> 4286 bytes assets/webui/index.html | 15 + framework/platforms/http_service.py | 38 +- 18 files changed, 1178 insertions(+), 10 deletions(-) create mode 100644 assets/webui/assets/AboutView-5953b7f8.js create mode 100644 assets/webui/assets/AboutView-6b0b8d35.css create mode 100644 assets/webui/assets/AccountConfigView-adf60d3d.js create mode 100644 assets/webui/assets/AccountConfigView-d360e00d.css create mode 100644 assets/webui/assets/ConfigurationList-1bddc793.js create mode 100644 assets/webui/assets/ConfigurationList-d389253d.css create mode 100644 assets/webui/assets/LoginView-69f14d49.css create mode 100644 assets/webui/assets/LoginView-72e77614.js create mode 100644 assets/webui/assets/PlatformConfigView-650e588f.css create mode 100644 assets/webui/assets/PlatformConfigView-98be4497.js create mode 100644 assets/webui/assets/UtilitiesConfigView-95bcc0d6.css create mode 100644 assets/webui/assets/UtilitiesConfigView-9ebc05cf.js create mode 100644 assets/webui/assets/index-086b42c5.js create mode 100644 assets/webui/assets/index-60c2ab7f.css create mode 100644 assets/webui/assets/use-loading-bar-690133ee.js create mode 100644 assets/webui/favicon.ico create mode 100644 assets/webui/index.html diff --git a/assets/webui/assets/AboutView-5953b7f8.js b/assets/webui/assets/AboutView-5953b7f8.js new file mode 100644 index 00000000..d705b5bc --- /dev/null +++ b/assets/webui/assets/AboutView-5953b7f8.js @@ -0,0 +1 @@ +import{_ as o,o as s,c as a,q as c,s as _,a as t}from"./index-086b42c5.js";const d={},r=e=>(c("data-v-df34d687"),e=e(),_(),e),n={class:"wrapper"},p=r(()=>t("div",{class:"container"},[t("h1",null,"We're working in progress"),t("p",null,[t("a",{href:"https://github.com/DarkSkyTeam/chatgpt-for-bot-webui",target:"_blank"},"GitHub")])],-1)),i=[p];function l(e,u){return s(),a("div",n,i)}const h=o(d,[["render",l],["__scopeId","data-v-df34d687"]]);export{h as default}; diff --git a/assets/webui/assets/AboutView-6b0b8d35.css b/assets/webui/assets/AboutView-6b0b8d35.css new file mode 100644 index 00000000..2872e99f --- /dev/null +++ b/assets/webui/assets/AboutView-6b0b8d35.css @@ -0,0 +1 @@ +.wrapper[data-v-df34d687]{display:flex;justify-content:center;align-items:center;height:100vh}.container[data-v-df34d687]{justify-content:center;align-items:center;flex-direction:column;text-align:center} diff --git a/assets/webui/assets/AccountConfigView-adf60d3d.js b/assets/webui/assets/AccountConfigView-adf60d3d.js new file mode 100644 index 00000000..2a819737 --- /dev/null +++ b/assets/webui/assets/AccountConfigView-adf60d3d.js @@ -0,0 +1 @@ +import{C as y,N as E}from"./ConfigurationList-1bddc793.js";import{i as I,g as L,h as O,d as b,o as s,c as r,a as t,j as z,r as _,F as A,k as S,f as u,l as h,b as P,u as q,t as V,m as p,N as $,n as M,p as D,q as R,s as F,x as H,_ as G}from"./index-086b42c5.js";import{u as J}from"./use-loading-bar-690133ee.js";function K(){const i=I(O,null);return i===null&&L("use-dialog","No outer founded."),i}const U={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Q=t("path",{d:"M376 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),W=t("path",{d:"M288 304c-87 0-175.3 48-191.64 138.6c-2 10.92 4.21 21.4 15.65 21.4H464c11.44 0 17.62-10.48 15.65-21.4C463.3 352 375 304 288 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),X=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M88 176v112"},null,-1),Y=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),Z=[Q,W,X,Y],ee=b({name:"PersonAddOutline",render:function(a,g){return s(),r("svg",U,Z)}}),te={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},oe=z('',6),ne=[oe],se=b({name:"TrashOutline",render:function(a,g){return s(),r("svg",te,ne)}}),re=i=>(R("data-v-dcd10619"),i=i(),F(),i),ae={class:"sub-content-wrapper"},ie={class:"sidebar-wrapper"},ce=re(()=>t("div",{class:"sidebar-title"},[t("p",null,"账号管理")],-1)),le={class:"sidebar"},ue={class:"sidebar-nav"},de={class:"sidebar-nav-item"},pe={class:"sidebar-nav-text"},he={class:"sidebar-nav-child"},ve=["onClick"],_e={class:"account-remark"},ke={key:0,class:"account-status",style:{color:"mediumseagreen"}},fe={key:1,class:"account-status",style:{color:"brown"}},we={key:0,class:"sub-main-content-wrapper"},ge={key:1,class:"sub-main-content-wrapper"},me=b({__name:"AccountConfigView",setup(i){q();const a=J(),g=K(),c=_(-1),l=_("chatgpt-web"),m=_([]),k=_({}),d=_(null);async function x(){const o=await(await fetch("/backend-api/v1/accounts/model?key="+l.value)).json();delete o.properties.ok,m.value=[o]}async function C(){var v;const o=await(await fetch("/backend-api/v1/accounts/list")).json();k.value=o;const e=H();(v=e==null?void 0:e.proxy)==null||v.$forceUpdate()}function N(n,o){l.value=n,c.value=o,f()}function f(){a.start(),x().then(()=>d.value?(d.value={},Promise.resolve()):C()).then(()=>{a.finish()}).catch(n=>{console.error(n),a.error()})}function j(n){a.start();const o="/backend-api/v1/accounts/"+l.value+(d.value?"":"/"+c.value);fetch(o,{method:"POST",body:JSON.stringify(n),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>{if(e.ok)return a.finish(),e.json();throw new Error("Something went wrong.")}).then(C).catch(e=>{a.error()})}function B(n){c.value=-1,d.value={},l.value=n,x()}function T(n,o){g.warning({title:"删除账号",content:"你确定要删除这个账号吗?希望你不是点错了。",positiveText:"很确定",negativeText:"点错了",onPositiveClick:()=>{c.value=-1,d.value=null,fetch("/backend-api/v1/accounts/"+l.value+"/"+c.value,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>{if(e.ok)return a.finish(),e.json();throw new Error("Something went wrong.")}).then(C).catch(e=>{a.error()})}})}return f(),(n,o)=>(s(),r("div",ae,[t("div",ie,[ce,t("div",le,[t("ul",ue,[(s(!0),r(A,null,S(Object.keys(k.value),e=>(s(),r("li",{key:e},[t("div",de,[t("div",pe,V(e),1),u(p(E),{class:"sidebar-nav-action"},{default:h(()=>[u(p($),{quaternary:"",size:"tiny",onClick:v=>B(e)},{icon:h(()=>[u(p(M),null,{default:h(()=>[u(p(ee))]),_:1})]),_:2},1032,["onClick"])]),_:2},1024)]),t("ul",he,[(s(!0),r(A,null,S(k.value[e],(v,w)=>(s(),r("li",{class:D({"sidebar-nav-sub-item":!0,"sidebar-nav-sub-item-active":c.value==w&&l.value==e}),onClick:Ce=>N(e,w),key:w},[t("div",null,[t("p",_e,"账号 "+V(w+1),1),v.ok?(s(),r("p",ke,"可用")):(s(),r("p",fe,"不可用"))])],10,ve))),128))])]))),128))])])]),c.value>=0?(s(),r("div",we,[u(y,{title:"修改账号","configuration-groups":m.value,configurationValue:k.value[l.value][c.value],onSave:j,onReset:f},{tools:h(()=>[u(p($),{quaternary:"",onClick:o[0]||(o[0]=e=>T(l.value,c.value))},{icon:h(()=>[u(p(M),null,{default:h(()=>[u(p(se))]),_:1})]),_:1})]),_:1},8,["configuration-groups","configurationValue"])])):d.value?(s(),r("div",ge,[u(y,{title:"添加账号:"+l.value,"configuration-groups":m.value,configurationValue:d.value,onSave:j,onReset:f},null,8,["title","configuration-groups","configurationValue"])])):P("",!0)]))}});const ye=G(me,[["__scopeId","data-v-dcd10619"]]);export{ye as default}; diff --git a/assets/webui/assets/AccountConfigView-d360e00d.css b/assets/webui/assets/AccountConfigView-d360e00d.css new file mode 100644 index 00000000..ddd3f5f1 --- /dev/null +++ b/assets/webui/assets/AccountConfigView-d360e00d.css @@ -0,0 +1 @@ +.sub-content-wrapper[data-v-dcd10619]{display:flex;flex-grow:1;height:100%}.sidebar-wrapper[data-v-dcd10619]{width:256px;background-color:var(--vt-c-gray)}.sub-main-content-wrapper[data-v-dcd10619]{flex-grow:1}.account-remark[data-v-dcd10619]{font-weight:500}.account-status[data-v-dcd10619]{font-size:.9em} diff --git a/assets/webui/assets/ConfigurationList-1bddc793.js b/assets/webui/assets/ConfigurationList-1bddc793.js new file mode 100644 index 00000000..20b0ac3e --- /dev/null +++ b/assets/webui/assets/ConfigurationList-1bddc793.js @@ -0,0 +1,552 @@ +import{B as cr,C as _r,E as dr,F as St,K as ur,R as pr,z as mr,A as gr,T as Er,D as Sr,G as Ha,H as fr,V as br,I as hr,J as Tr,L as vr,M as Cr,O as yr,P as Rr,Q as Nr,U as we,W as Or,X as Yt,b as sa,c as ct,a as ft,Y as Ar,Z as Ir,$ as Dr,a0 as wr,a1 as xr,j as Mr,a2 as xt,f as qe,a3 as kr,a4 as Lr,d as tt,a5 as Pr,a6 as Fr,a7 as Ur,a8 as Br,a9 as Gr,aa as Yr,ab as qr,ac as Vr,x as Ea,ad as zr,ae as Hr,af as $r,ag as z,ah as Wr,ai as jr,aj as Qr,ak as Kr,i as Vt,al as Zr,am as Xr,an as Jr,ao as ei,ap as ti,aq as ni,ar as ai,as as ri,at as ii,au as oi,av as si,aw as jn,p as li,ax as ci,ay as _i,az as di,aA as ui,aB as $a,aC as pi,aD as mi,aE as gi,aF as Sa,aG as Ei,aH as Si,aI as fi,aJ as bi,aK as hi,aL as Ti,o as Xe,s as vi,aM as Pn,aN as Ci,q as yi,aO as Ri,aP as Ni,aQ as Oi,r as Fe,aR as Ai,aS as Ii,k as cn,aT as Wa,aU as Di,aV as wi,aW as xi,aX as Mi,aY as ki,aZ as Li,a_ as Pi,a$ as Fi,b0 as Ui,b1 as Bi,b2 as Gi,b3 as Yi,b4 as qi,b5 as Vi,t as _n,b6 as zi,b7 as Hi,b8 as $i,b9 as Nt,ba as Wi,bb as ji,bc as Qi,m as ke,bd as Ki,be as Zi,bf as Xi,bg as Ji,bh as eo,bi as to,bj as no,bk as ao,bl as ro,bm as io,v as oo,bn as so,bo as lo,bp as co,bq as qt,br as la,bs as _o,bt as uo,bu as po,l as We,bv as mo,w as go,bw as Eo,bx as So,e as fo,by as bo,bz as ja,bA as Qa,bB as Ka,bC as ho,bD as To,bE as vo,bF as xe,bG as je,bH as ee,bI as ca,bJ as Za,bK as Xa,bL as Zt,bM as dn,bN as Ja,bO as Un,bP as Hn,bQ as fa,bR as Co,bS as Ie,bT as Rt,bU as Xt,bV as lt,bW as yo,bX as ba,bY as Mt,bZ as ha,b_ as Kn,b$ as _t,c0 as er,c1 as Ro,c2 as Qn,c3 as rt,c4 as No,c5 as Ke,c6 as Ra,c7 as Oo,c8 as Ao,c9 as Io,ca as ht,cb as Na,cc as Xn,cd as Do,ce as Oa,cf as wo,cg as Aa,ch as xo,ci as Mo,cj as ko,ck as Ia,cl as Jn,cm as ea,N as Gt,n as Da,_ as Lo}from"./index-086b42c5.js";const Po=()=>{},Fo=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:cr,Comment:_r,EffectScope:dr,Fragment:St,KeepAlive:ur,ReactiveEffect:pr,Static:mr,Suspense:gr,Teleport:Er,Text:Sr,Transition:Ha,TransitionGroup:fr,VueElement:br,assertNumber:hr,callWithAsyncErrorHandling:Tr,callWithErrorHandling:vr,camelize:Cr,capitalize:yr,cloneVNode:Rr,compatUtils:Nr,compile:Po,computed:we,createApp:Or,createBlock:Yt,createCommentVNode:sa,createElementBlock:ct,createElementVNode:ft,createHydrationRenderer:Ar,createPropsRestProxy:Ir,createRenderer:Dr,createSSRApp:wr,createSlots:xr,createStaticVNode:Mr,createTextVNode:xt,createVNode:qe,customRef:kr,defineAsyncComponent:Lr,defineComponent:tt,defineCustomElement:Pr,defineEmits:Fr,defineExpose:Ur,defineProps:Br,defineSSRCustomElement:Gr,get devtools(){return Yr},effect:qr,effectScope:Vr,getCurrentInstance:Ea,getCurrentScope:zr,getTransitionRawChildren:Hr,guardReactiveProps:$r,h:z,handleError:Wr,hydrate:jr,initCustomFormatter:Qr,initDirectivesForSSR:Kr,inject:Vt,isMemoSame:Zr,isProxy:Xr,isReactive:Jr,isReadonly:ei,isRef:ti,isRuntimeOnly:ni,isShallow:ai,isVNode:ri,markRaw:ii,mergeDefaults:oi,mergeProps:si,nextTick:jn,normalizeClass:li,normalizeProps:ci,normalizeStyle:_i,onActivated:di,onBeforeMount:ui,onBeforeUnmount:$a,onBeforeUpdate:pi,onDeactivated:mi,onErrorCaptured:gi,onMounted:Sa,onRenderTracked:Ei,onRenderTriggered:Si,onScopeDispose:fi,onServerPrefetch:bi,onUnmounted:hi,onUpdated:Ti,openBlock:Xe,popScopeId:vi,provide:Pn,proxyRefs:Ci,pushScopeId:yi,queuePostFlushCb:Ri,reactive:Ni,readonly:Oi,ref:Fe,registerRuntimeCompiler:Ai,render:Ii,renderList:cn,renderSlot:Wa,resolveComponent:Di,resolveDirective:wi,resolveDynamicComponent:xi,resolveFilter:Mi,resolveTransitionHooks:ki,setBlockTracking:Li,setDevtoolsHook:Pi,setTransitionHooks:Fi,shallowReactive:Ui,shallowReadonly:Bi,shallowRef:Gi,ssrContextKey:Yi,ssrUtils:qi,stop:Vi,toDisplayString:_n,toHandlerKey:zi,toHandlers:Hi,toRaw:$i,toRef:Nt,toRefs:Wi,transformVNodeArgs:ji,triggerRef:Qi,unref:ke,useAttrs:Ki,useCssModule:Zi,useCssVars:Xi,useSSRContext:Ji,useSlots:eo,useTransitionState:to,vModelCheckbox:no,vModelDynamic:ao,vModelRadio:ro,vModelSelect:io,vModelText:oo,vShow:so,version:lo,warn:co,watch:qt,watchEffect:la,watchPostEffect:_o,watchSyncEffect:uo,withAsyncContext:po,withCtx:We,withDefaults:mo,withDirectives:go,withKeys:Eo,withMemo:So,withModifiers:fo,withScopeId:bo},Symbol.toStringTag,{value:"Module"}));function Uo(g,E="default",b=[]){const D=g.$slots[E];return D===void 0?b:D()}function Bo(g,E,b){var y;const D=Vt(g,null);if(D===null)return;const A=(y=Ea())===null||y===void 0?void 0:y.proxy;qt(b,M),M(b.value),$a(()=>{M(void 0,b.value)});function M(e,t){const n=D[E];t!==void 0&&l(n,t),e!==void 0&&o(n,e)}function l(e,t){e[t]||(e[t]=[]),e[t].splice(e[t].findIndex(n=>n===A),1)}function o(e,t){e[t]||(e[t]=[]),~e[t].findIndex(n=>n===A)||e[t].push(A)}}function Ta(g,E){return qt(g,b=>{b!==void 0&&(E.value=b)}),we(()=>g.value===void 0?E.value:g.value)}var Go=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yo=/^\w*$/;function qo(g,E){if(ja(g))return!1;var b=typeof g;return b=="number"||b=="symbol"||b=="boolean"||g==null||Qa(g)?!0:Yo.test(g)||!Go.test(g)||E!=null&&g in Object(E)}var Vo="Expected a function";function va(g,E){if(typeof g!="function"||E!=null&&typeof E!="function")throw new TypeError(Vo);var b=function(){var y=arguments,D=E?E.apply(this,y):y[0],A=b.cache;if(A.has(D))return A.get(D);var M=g.apply(this,y);return b.cache=A.set(D,M)||A,M};return b.cache=new(va.Cache||Ka),b}va.Cache=Ka;var zo=500;function Ho(g){var E=va(g,function(y){return b.size===zo&&b.clear(),y}),b=E.cache;return E}var $o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wo=/\\(\\)?/g,jo=Ho(function(g){var E=[];return g.charCodeAt(0)===46&&E.push(""),g.replace($o,function(b,y,D,A){E.push(D?A.replace(Wo,"$1"):y||b)}),E});const Qo=jo;function Ko(g,E){return ja(g)?g:qo(g,E)?[g]:Qo(ho(g))}var Zo=1/0;function Xo(g){if(typeof g=="string"||Qa(g))return g;var E=g+"";return E=="0"&&1/g==-Zo?"-0":E}function Jo(g,E){E=Ko(E,g);for(var b=0,y=E.length;g!=null&&b`Please load all ${g}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:g=>`Total ${g} items`,selected:g=>`${g} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},ts=es;function ta(g){return function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},b=E.width?String(E.width):g.defaultWidth,y=g.formats[b]||g.formats[g.defaultWidth];return y}}function wn(g){return function(E,b){var y=b!=null&&b.context?String(b.context):"standalone",D;if(y==="formatting"&&g.formattingValues){var A=g.defaultFormattingWidth||g.defaultWidth,M=b!=null&&b.width?String(b.width):A;D=g.formattingValues[M]||g.formattingValues[A]}else{var l=g.defaultWidth,o=b!=null&&b.width?String(b.width):g.defaultWidth;D=g.values[o]||g.values[l]}var e=g.argumentCallback?g.argumentCallback(E):E;return D[e]}}function xn(g){return function(E){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=b.width,D=y&&g.matchPatterns[y]||g.matchPatterns[g.defaultMatchWidth],A=E.match(D);if(!A)return null;var M=A[0],l=y&&g.parsePatterns[y]||g.parsePatterns[g.defaultParseWidth],o=Array.isArray(l)?as(l,function(n){return n.test(M)}):ns(l,function(n){return n.test(M)}),e;e=g.valueCallback?g.valueCallback(o):o,e=b.valueCallback?b.valueCallback(e):e;var t=E.slice(M.length);return{value:e,rest:t}}}function ns(g,E){for(var b in g)if(g.hasOwnProperty(b)&&E(g[b]))return b}function as(g,E){for(var b=0;b1&&arguments[1]!==void 0?arguments[1]:{},y=E.match(g.matchPattern);if(!y)return null;var D=y[0],A=E.match(g.parsePattern);if(!A)return null;var M=g.valueCallback?g.valueCallback(A[0]):A[0];M=b.valueCallback?b.valueCallback(M):M;var l=E.slice(D.length);return{value:M,rest:l}}}var is={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},os=function(E,b,y){var D,A=is[E];return typeof A=="string"?D=A:b===1?D=A.one:D=A.other.replace("{{count}}",b.toString()),y!=null&&y.addSuffix?y.comparison&&y.comparison>0?"in "+D:D+" ago":D};const ss=os;var ls={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cs={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ds={date:ta({formats:ls,defaultWidth:"full"}),time:ta({formats:cs,defaultWidth:"full"}),dateTime:ta({formats:_s,defaultWidth:"full"})};const us=ds;var ps={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ms=function(E,b,y,D){return ps[E]};const gs=ms;var Es={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ss={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},fs={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bs={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hs={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ts={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vs=function(E,b){var y=Number(E),D=y%100;if(D>20||D<10)switch(D%10){case 1:return y+"st";case 2:return y+"nd";case 3:return y+"rd"}return y+"th"},Cs={ordinalNumber:vs,era:wn({values:Es,defaultWidth:"wide"}),quarter:wn({values:Ss,defaultWidth:"wide",argumentCallback:function(E){return E-1}}),month:wn({values:fs,defaultWidth:"wide"}),day:wn({values:bs,defaultWidth:"wide"}),dayPeriod:wn({values:hs,defaultWidth:"wide",formattingValues:Ts,defaultFormattingWidth:"wide"})};const ys=Cs;var Rs=/^(\d+)(th|st|nd|rd)?/i,Ns=/\d+/i,Os={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},As={any:[/^b/i,/^(a|c)/i]},Is={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ds={any:[/1/i,/2/i,/3/i,/4/i]},ws={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},xs={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ms={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ks={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ls={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ps={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Fs={ordinalNumber:rs({matchPattern:Rs,parsePattern:Ns,valueCallback:function(E){return parseInt(E,10)}}),era:xn({matchPatterns:Os,defaultMatchWidth:"wide",parsePatterns:As,defaultParseWidth:"any"}),quarter:xn({matchPatterns:Is,defaultMatchWidth:"wide",parsePatterns:Ds,defaultParseWidth:"any",valueCallback:function(E){return E+1}}),month:xn({matchPatterns:ws,defaultMatchWidth:"wide",parsePatterns:xs,defaultParseWidth:"any"}),day:xn({matchPatterns:Ms,defaultMatchWidth:"wide",parsePatterns:ks,defaultParseWidth:"any"}),dayPeriod:xn({matchPatterns:Ls,defaultMatchWidth:"any",parsePatterns:Ps,defaultParseWidth:"any"})};const Us=Fs;var Bs={code:"en-US",formatDistance:ss,formatLong:us,formatRelative:gs,localize:ys,match:Us,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Gs=Bs,Ys={name:"en-US",locale:Gs},qs=Ys;function nr(g){const{mergedLocaleRef:E,mergedDateLocaleRef:b}=Vt(To,null)||{},y=we(()=>{var A,M;return(M=(A=E==null?void 0:E.value)===null||A===void 0?void 0:A[g])!==null&&M!==void 0?M:ts[g]});return{dateLocaleRef:we(()=>{var A;return(A=b==null?void 0:b.value)!==null&&A!==void 0?A:qs}),localeRef:y}}const Vs=tt({name:"Add",render(){return z("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),zs=tt({name:"Eye",render(){return z("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},z("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),z("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),Hs=tt({name:"EyeOff",render(){return z("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},z("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),z("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),z("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),z("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),z("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),$s=tt({name:"Remove",render(){return z("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},z("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` + fill: none; + stroke: currentColor; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 32px; + `}))}}),Ws=tt({name:"ChevronDown",render(){return z("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),js=vo("clear",z("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},z("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},z("g",{fill:"currentColor","fill-rule":"nonzero"},z("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),Qs=xe("base-clear",` + flex-shrink: 0; + height: 1em; + width: 1em; + position: relative; +`,[je(">",[ee("clear",` + font-size: var(--n-clear-size); + height: 1em; + width: 1em; + cursor: pointer; + color: var(--n-clear-color); + transition: color .3s var(--n-bezier); + display: flex; + `,[je("&:hover",` + color: var(--n-clear-color-hover)!important; + `),je("&:active",` + color: var(--n-clear-color-pressed)!important; + `)]),ee("placeholder",` + display: flex; + `),ee("clear, placeholder",` + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + `,[ca({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),_a=tt({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(g){return Za("-base-clear",Qs,Nt(g,"clsPrefix")),{handleMouseDown(E){E.preventDefault()}}},render(){const{clsPrefix:g}=this;return z("div",{class:`${g}-base-clear`},z(Xa,null,{default:()=>{var E,b;return this.show?z("div",{key:"dismiss",class:`${g}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Zt(this.$slots.icon,()=>[z(dn,{clsPrefix:g},{default:()=>z(js,null)})])):z("div",{key:"icon",class:`${g}-base-clear__placeholder`},(b=(E=this.$slots).placeholder)===null||b===void 0?void 0:b.call(E))}}))}}),Ks=tt({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(g,{slots:E}){return()=>{const{clsPrefix:b}=g;return z(Ja,{clsPrefix:b,class:`${b}-base-suffix`,strokeWidth:24,scale:.85,show:g.loading},{default:()=>g.showArrow?z(_a,{clsPrefix:b,show:g.showClear,onClear:g.onClear},{placeholder:()=>z(dn,{clsPrefix:b,class:`${b}-base-suffix__arrow`},{default:()=>Zt(E.default,()=>[z(Ws,null)])})}):null})}}}),Zs={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},Xs=g=>{const{textColor2:E,textColor3:b,textColorDisabled:y,primaryColor:D,primaryColorHover:A,inputColor:M,inputColorDisabled:l,borderColor:o,warningColor:e,warningColorHover:t,errorColor:n,errorColorHover:a,borderRadius:r,lineHeight:i,fontSizeTiny:s,fontSizeSmall:c,fontSizeMedium:_,fontSizeLarge:d,heightTiny:u,heightSmall:p,heightMedium:S,heightLarge:h,actionColor:m,clearColor:f,clearColorHover:v,clearColorPressed:N,placeholderColor:O,placeholderColorDisabled:I,iconColor:T,iconColorDisabled:R,iconColorHover:w,iconColorPressed:x}=g;return Object.assign(Object.assign({},Zs),{countTextColorDisabled:y,countTextColor:b,heightTiny:u,heightSmall:p,heightMedium:S,heightLarge:h,fontSizeTiny:s,fontSizeSmall:c,fontSizeMedium:_,fontSizeLarge:d,lineHeight:i,lineHeightTextarea:i,borderRadius:r,iconSize:"16px",groupLabelColor:m,groupLabelTextColor:E,textColor:E,textColorDisabled:y,textDecorationColor:E,caretColor:D,placeholderColor:O,placeholderColorDisabled:I,color:M,colorDisabled:l,colorFocus:M,groupLabelBorder:`1px solid ${o}`,border:`1px solid ${o}`,borderHover:`1px solid ${A}`,borderDisabled:`1px solid ${o}`,borderFocus:`1px solid ${A}`,boxShadowFocus:`0 0 0 2px ${Hn(D,{alpha:.2})}`,loadingColor:D,loadingColorWarning:e,borderWarning:`1px solid ${e}`,borderHoverWarning:`1px solid ${t}`,colorFocusWarning:M,borderFocusWarning:`1px solid ${t}`,boxShadowFocusWarning:`0 0 0 2px ${Hn(e,{alpha:.2})}`,caretColorWarning:e,loadingColorError:n,borderError:`1px solid ${n}`,borderHoverError:`1px solid ${a}`,colorFocusError:M,borderFocusError:`1px solid ${a}`,boxShadowFocusError:`0 0 0 2px ${Hn(n,{alpha:.2})}`,caretColorError:n,clearColor:f,clearColorHover:v,clearColorPressed:N,iconColor:T,iconColorDisabled:R,iconColorHover:w,iconColorPressed:x,suffixTextColor:E})},Js={name:"Input",common:Un,self:Xs},ar=Js,rr=fa("n-input");function el(g){let E=0;for(const b of g)E++;return E}function Vn(g){return g===""||g==null}function tl(g){const E=Fe(null);function b(){const{value:A}=g;if(!(A!=null&&A.focus)){D();return}const{selectionStart:M,selectionEnd:l,value:o}=A;if(M==null||l==null){D();return}E.value={start:M,end:l,beforeText:o.slice(0,M),afterText:o.slice(l)}}function y(){var A;const{value:M}=E,{value:l}=g;if(!M||!l)return;const{value:o}=l,{start:e,beforeText:t,afterText:n}=M;let a=o.length;if(o.endsWith(n))a=o.length-n.length;else if(o.startsWith(t))a=t.length;else{const r=t[e-1],i=o.indexOf(r,e-1);i!==-1&&(a=i+1)}(A=l.setSelectionRange)===null||A===void 0||A.call(l,a,a)}function D(){E.value=null}return qt(g,D),{recordCursor:b,restoreCursor:y}}const wa=tt({name:"InputWordCount",setup(g,{slots:E}){const{mergedValueRef:b,maxlengthRef:y,mergedClsPrefixRef:D,countGraphemesRef:A}=Vt(rr),M=we(()=>{const{value:l}=b;return l===null||Array.isArray(l)?0:(A.value||el)(l)});return()=>{const{value:l}=y,{value:o}=b;return z("span",{class:`${D.value}-input-word-count`},Co(E.default,{value:o===null||Array.isArray(o)?"":o},()=>[l===void 0?M.value:`${M.value} / ${l}`]))}}}),nl=xe("input",` + max-width: 100%; + cursor: text; + line-height: 1.5; + z-index: auto; + outline: none; + box-sizing: border-box; + position: relative; + display: inline-flex; + border-radius: var(--n-border-radius); + background-color: var(--n-color); + transition: background-color .3s var(--n-bezier); + font-size: var(--n-font-size); + --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2); +`,[ee("input, textarea",` + overflow: hidden; + flex-grow: 1; + position: relative; + `),ee("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",` + box-sizing: border-box; + font-size: inherit; + line-height: 1.5; + font-family: inherit; + border: none; + outline: none; + background-color: #0000; + text-align: inherit; + transition: + -webkit-text-fill-color .3s var(--n-bezier), + caret-color .3s var(--n-bezier), + color .3s var(--n-bezier), + text-decoration-color .3s var(--n-bezier); + `),ee("input-el, textarea-el",` + -webkit-appearance: none; + scrollbar-width: none; + width: 100%; + min-width: 0; + text-decoration-color: var(--n-text-decoration-color); + color: var(--n-text-color); + caret-color: var(--n-caret-color); + background-color: transparent; + `,[je("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` + width: 0; + height: 0; + display: none; + `),je("&::placeholder",` + color: #0000; + -webkit-text-fill-color: transparent !important; + `),je("&:-webkit-autofill ~",[ee("placeholder","display: none;")])]),Ie("round",[Rt("textarea","border-radius: calc(var(--n-height) / 2);")]),ee("placeholder",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + overflow: hidden; + color: var(--n-placeholder-color); + `,[je("span",` + width: 100%; + display: inline-block; + `)]),Ie("textarea",[ee("placeholder","overflow: visible;")]),Rt("autosize","width: 100%;"),Ie("autosize",[ee("textarea-el, input-el",` + position: absolute; + top: 0; + left: 0; + height: 100%; + `)]),xe("input-wrapper",` + overflow: hidden; + display: inline-flex; + flex-grow: 1; + position: relative; + padding-left: var(--n-padding-left); + padding-right: var(--n-padding-right); + `),ee("input-mirror",` + padding: 0; + height: var(--n-height); + line-height: var(--n-height); + overflow: hidden; + visibility: hidden; + position: static; + white-space: pre; + pointer-events: none; + `),ee("input-el",` + padding: 0; + height: var(--n-height); + line-height: var(--n-height); + `,[je("+",[ee("placeholder",` + display: flex; + align-items: center; + `)])]),Rt("textarea",[ee("placeholder","white-space: nowrap;")]),ee("eye",` + transition: color .3s var(--n-bezier); + `),Ie("textarea","width: 100%;",[xe("input-word-count",` + position: absolute; + right: var(--n-padding-right); + bottom: var(--n-padding-vertical); + `),Ie("resizable",[xe("input-wrapper",` + resize: vertical; + min-height: var(--n-height); + `)]),ee("textarea-el, textarea-mirror, placeholder",` + height: 100%; + padding-left: 0; + padding-right: 0; + padding-top: var(--n-padding-vertical); + padding-bottom: var(--n-padding-vertical); + word-break: break-word; + display: inline-block; + vertical-align: bottom; + box-sizing: border-box; + line-height: var(--n-line-height-textarea); + margin: 0; + resize: none; + white-space: pre-wrap; + `),ee("textarea-mirror",` + width: 100%; + pointer-events: none; + overflow: hidden; + visibility: hidden; + position: static; + white-space: pre-wrap; + overflow-wrap: break-word; + `)]),Ie("pair",[ee("input-el, placeholder","text-align: center;"),ee("separator",` + display: flex; + align-items: center; + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + white-space: nowrap; + `,[xe("icon",` + color: var(--n-icon-color); + `),xe("base-icon",` + color: var(--n-icon-color); + `)])]),Ie("disabled",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `,[ee("border","border: var(--n-border-disabled);"),ee("input-el, textarea-el",` + cursor: not-allowed; + color: var(--n-text-color-disabled); + text-decoration-color: var(--n-text-color-disabled); + `),ee("placeholder","color: var(--n-placeholder-color-disabled);"),ee("separator","color: var(--n-text-color-disabled);",[xe("icon",` + color: var(--n-icon-color-disabled); + `),xe("base-icon",` + color: var(--n-icon-color-disabled); + `)]),xe("input-word-count",` + color: var(--n-count-text-color-disabled); + `),ee("suffix, prefix","color: var(--n-text-color-disabled);",[xe("icon",` + color: var(--n-icon-color-disabled); + `),xe("internal-icon",` + color: var(--n-icon-color-disabled); + `)])]),Rt("disabled",[ee("eye",` + display: flex; + align-items: center; + justify-content: center; + color: var(--n-icon-color); + cursor: pointer; + `,[je("&:hover",` + color: var(--n-icon-color-hover); + `),je("&:active",` + color: var(--n-icon-color-pressed); + `)]),je("&:hover",[ee("state-border","border: var(--n-border-hover);")]),Ie("focus","background-color: var(--n-color-focus);",[ee("state-border",` + border: var(--n-border-focus); + box-shadow: var(--n-box-shadow-focus); + `)])]),ee("border, state-border",` + box-sizing: border-box; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + pointer-events: none; + border-radius: inherit; + border: var(--n-border); + transition: + box-shadow .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `),ee("state-border",` + border-color: #0000; + z-index: 1; + `),ee("prefix","margin-right: 4px;"),ee("suffix",` + margin-left: 4px; + `),ee("suffix, prefix",` + transition: color .3s var(--n-bezier); + flex-wrap: nowrap; + flex-shrink: 0; + line-height: var(--n-height); + white-space: nowrap; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--n-suffix-text-color); + `,[xe("base-loading",` + font-size: var(--n-icon-size); + margin: 0 2px; + color: var(--n-loading-color); + `),xe("base-clear",` + font-size: var(--n-icon-size); + `,[ee("placeholder",[xe("base-icon",` + transition: color .3s var(--n-bezier); + color: var(--n-icon-color); + font-size: var(--n-icon-size); + `)])]),je(">",[xe("icon",` + transition: color .3s var(--n-bezier); + color: var(--n-icon-color); + font-size: var(--n-icon-size); + `)]),xe("base-icon",` + font-size: var(--n-icon-size); + `)]),xe("input-word-count",` + pointer-events: none; + line-height: 1.5; + font-size: .85em; + color: var(--n-count-text-color); + transition: color .3s var(--n-bezier); + margin-left: 4px; + font-variant: tabular-nums; + `),["warning","error"].map(g=>Ie(`${g}-status`,[Rt("disabled",[xe("base-loading",` + color: var(--n-loading-color-${g}) + `),ee("input-el, textarea-el",` + caret-color: var(--n-caret-color-${g}); + `),ee("state-border",` + border: var(--n-border-${g}); + `),je("&:hover",[ee("state-border",` + border: var(--n-border-hover-${g}); + `)]),je("&:focus",` + background-color: var(--n-color-focus-${g}); + `,[ee("state-border",` + box-shadow: var(--n-box-shadow-focus-${g}); + border: var(--n-border-focus-${g}); + `)]),Ie("focus",` + background-color: var(--n-color-focus-${g}); + `,[ee("state-border",` + box-shadow: var(--n-box-shadow-focus-${g}); + border: var(--n-border-focus-${g}); + `)])])]))]),al=xe("input",[Ie("disabled",[ee("input-el, textarea-el",` + -webkit-text-fill-color: var(--n-text-color-disabled); + `)])]),rl=Object.assign(Object.assign({},lt.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:Function,onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:Boolean,showPasswordToggle:Boolean}),$n=tt({name:"Input",props:rl,setup(g){const{mergedClsPrefixRef:E,mergedBorderedRef:b,inlineThemeDisabled:y,mergedRtlRef:D}=Xt(g),A=lt("Input","-input",nl,ar,g,E);yo&&Za("-input-safari",al,E);const M=Fe(null),l=Fe(null),o=Fe(null),e=Fe(null),t=Fe(null),n=Fe(null),a=Fe(null),r=tl(a),i=Fe(null),{localeRef:s}=nr("Input"),c=Fe(g.defaultValue),_=Nt(g,"value"),d=Ta(_,c),u=ba(g),{mergedSizeRef:p,mergedDisabledRef:S,mergedStatusRef:h}=u,m=Fe(!1),f=Fe(!1),v=Fe(!1),N=Fe(!1);let O=null;const I=we(()=>{const{placeholder:L,pair:C}=g;return C?Array.isArray(L)?L:L===void 0?["",""]:[L,L]:L===void 0?[s.value.placeholder]:[L]}),T=we(()=>{const{value:L}=v,{value:C}=d,{value:P}=I;return!L&&(Vn(C)||Array.isArray(C)&&Vn(C[0]))&&P[0]}),R=we(()=>{const{value:L}=v,{value:C}=d,{value:P}=I;return!L&&P[1]&&(Vn(C)||Array.isArray(C)&&Vn(C[1]))}),w=Mt(()=>g.internalForceFocus||m.value),x=Mt(()=>{if(S.value||g.readonly||!g.clearable||!w.value&&!f.value)return!1;const{value:L}=d,{value:C}=w;return g.pair?!!(Array.isArray(L)&&(L[0]||L[1]))&&(f.value||C):!!L&&(f.value||C)}),k=we(()=>{const{showPasswordOn:L}=g;if(L)return L;if(g.showPasswordToggle)return"click"}),B=Fe(!1),U=we(()=>{const{textDecoration:L}=g;return L?Array.isArray(L)?L.map(C=>({textDecoration:C})):[{textDecoration:L}]:["",""]}),F=Fe(void 0),W=()=>{var L,C;if(g.type==="textarea"){const{autosize:P}=g;if(P&&(F.value=(C=(L=i.value)===null||L===void 0?void 0:L.$el)===null||C===void 0?void 0:C.offsetWidth),!l.value||typeof P=="boolean")return;const{paddingTop:H,paddingBottom:oe,lineHeight:ge}=window.getComputedStyle(l.value),Ue=Number(H.slice(0,-2)),ae=Number(oe.slice(0,-2)),J=Number(ge.slice(0,-2)),{value:ue}=o;if(!ue)return;if(P.minRows){const Ve=Math.max(P.minRows,1),ze=`${Ue+ae+J*Ve}px`;ue.style.minHeight=ze}if(P.maxRows){const Ve=`${Ue+ae+J*P.maxRows}px`;ue.style.maxHeight=Ve}}},K=we(()=>{const{maxlength:L}=g;return L===void 0?void 0:Number(L)});Sa(()=>{const{value:L}=d;Array.isArray(L)||Tt(L)});const G=Ea().proxy;function Y(L){const{onUpdateValue:C,"onUpdate:value":P,onInput:H}=g,{nTriggerFormInput:oe}=u;C&&Ke(C,L),P&&Ke(P,L),H&&Ke(H,L),c.value=L,oe()}function $(L){const{onChange:C}=g,{nTriggerFormChange:P}=u;C&&Ke(C,L),c.value=L,P()}function te(L){const{onBlur:C}=g,{nTriggerFormBlur:P}=u;C&&Ke(C,L),P()}function j(L){const{onFocus:C}=g,{nTriggerFormFocus:P}=u;C&&Ke(C,L),P()}function re(L){const{onClear:C}=g;C&&Ke(C,L)}function le(L){const{onInputBlur:C}=g;C&&Ke(C,L)}function Re(L){const{onInputFocus:C}=g;C&&Ke(C,L)}function Te(){const{onDeactivate:L}=g;L&&Ke(L)}function De(){const{onActivate:L}=g;L&&Ke(L)}function Ee(L){const{onClick:C}=g;C&&Ke(C,L)}function be(L){const{onWrapperFocus:C}=g;C&&Ke(C,L)}function Se(L){const{onWrapperBlur:C}=g;C&&Ke(C,L)}function ve(){v.value=!0}function V(L){v.value=!1,L.target===n.value?X(L,1):X(L,0)}function X(L,C=0,P="input"){const H=L.target.value;if(Tt(H),L instanceof InputEvent&&!L.isComposing&&(v.value=!1),g.type==="textarea"){const{value:ge}=i;ge&&ge.syncUnifiedContainer()}if(O=H,v.value)return;r.recordCursor();const oe=ce(H);if(oe)if(!g.pair)P==="input"?Y(H):$(H);else{let{value:ge}=d;Array.isArray(ge)?ge=[ge[0],ge[1]]:ge=["",""],ge[C]=H,P==="input"?Y(ge):$(ge)}G.$forceUpdate(),oe||jn(r.restoreCursor)}function ce(L){const{countGraphemes:C,maxlength:P,minlength:H}=g;if(C){let ge;if(P!==void 0&&(ge===void 0&&(ge=C(L)),ge>Number(P))||H!==void 0&&(ge===void 0&&(ge=C(L)),ge{H.preventDefault(),Ra("mouseup",document,C)};if(Qn("mouseup",document,C),k.value!=="mousedown")return;B.value=!0;const P=()=>{B.value=!1,Ra("mouseup",document,P)};Qn("mouseup",document,P)}function Ze(L){var C;switch((C=g.onKeydown)===null||C===void 0||C.call(g,L),L.key){case"Escape":Je();break;case"Enter":dt(L);break}}function dt(L){var C,P;if(g.passivelyActivated){const{value:H}=N;if(H){g.internalDeactivateOnEnter&&Je();return}L.preventDefault(),g.type==="textarea"?(C=l.value)===null||C===void 0||C.focus():(P=t.value)===null||P===void 0||P.focus()}}function Je(){g.passivelyActivated&&(N.value=!1,jn(()=>{var L;(L=M.value)===null||L===void 0||L.focus()}))}function nt(){var L,C,P;S.value||(g.passivelyActivated?(L=M.value)===null||L===void 0||L.focus():((C=l.value)===null||C===void 0||C.focus(),(P=t.value)===null||P===void 0||P.focus()))}function bt(){var L;!((L=M.value)===null||L===void 0)&&L.contains(document.activeElement)&&document.activeElement.blur()}function pt(){var L,C;(L=l.value)===null||L===void 0||L.select(),(C=t.value)===null||C===void 0||C.select()}function Ot(){S.value||(l.value?l.value.focus():t.value&&t.value.focus())}function zt(){const{value:L}=M;L!=null&&L.contains(document.activeElement)&&L!==document.activeElement&&Je()}function Ge(L){if(g.type==="textarea"){const{value:C}=l;C==null||C.scrollTo(L)}else{const{value:C}=t;C==null||C.scrollTo(L)}}function Tt(L){const{type:C,pair:P,autosize:H}=g;if(!P&&H)if(C==="textarea"){const{value:oe}=o;oe&&(oe.textContent=(L??"")+`\r +`)}else{const{value:oe}=e;oe&&(L?oe.textContent=L:oe.innerHTML=" ")}}function At(){W()}const kt=Fe({top:"0"});function un(L){var C;const{scrollTop:P}=L.target;kt.value.top=`${-P}px`,(C=i.value)===null||C===void 0||C.syncUnifiedContainer()}let Lt=null;la(()=>{const{autosize:L,type:C}=g;L&&C==="textarea"?Lt=qt(d,P=>{!Array.isArray(P)&&P!==O&&Tt(P)}):Lt==null||Lt()});let vt=null;la(()=>{g.type==="textarea"?vt=qt(d,L=>{var C;!Array.isArray(L)&&L!==O&&((C=i.value)===null||C===void 0||C.syncUnifiedContainer())}):vt==null||vt()}),Pn(rr,{mergedValueRef:d,maxlengthRef:K,mergedClsPrefixRef:E,countGraphemesRef:Nt(g,"countGraphemes")});const Jt={wrapperElRef:M,inputElRef:t,textareaElRef:l,isCompositing:v,focus:nt,blur:bt,select:pt,deactivate:zt,activate:Ot,scrollTo:Ge},en=ha("Input",D,E),tn=we(()=>{const{value:L}=p,{common:{cubicBezierEaseInOut:C},self:{color:P,borderRadius:H,textColor:oe,caretColor:ge,caretColorError:Ue,caretColorWarning:ae,textDecorationColor:J,border:ue,borderDisabled:Ve,borderHover:ze,borderFocus:Dt,placeholderColor:Ht,placeholderColorDisabled:$t,lineHeightTextarea:pn,colorDisabled:Wt,colorFocus:mn,textColorDisabled:gn,boxShadowFocus:En,iconSize:nn,colorFocusWarning:Pt,boxShadowFocusWarning:Sn,borderWarning:fn,borderFocusWarning:bn,borderHoverWarning:hn,colorFocusError:mt,boxShadowFocusError:an,borderError:rn,borderFocusError:Tn,borderHoverError:vn,clearSize:Ft,clearColor:Cn,clearColorHover:Z,clearColorPressed:pe,iconColor:Ae,iconColorDisabled:Be,suffixTextColor:Qe,countTextColor:st,countTextColorDisabled:gt,iconColorHover:Ut,iconColorPressed:ot,loadingColor:Et,loadingColorError:on,loadingColorWarning:sn,[rt("padding",L)]:yn,[rt("fontSize",L)]:Rn,[rt("height",L)]:Nn}}=A.value,{left:On,right:Bt}=No(yn);return{"--n-bezier":C,"--n-count-text-color":st,"--n-count-text-color-disabled":gt,"--n-color":P,"--n-font-size":Rn,"--n-border-radius":H,"--n-height":Nn,"--n-padding-left":On,"--n-padding-right":Bt,"--n-text-color":oe,"--n-caret-color":ge,"--n-text-decoration-color":J,"--n-border":ue,"--n-border-disabled":Ve,"--n-border-hover":ze,"--n-border-focus":Dt,"--n-placeholder-color":Ht,"--n-placeholder-color-disabled":$t,"--n-icon-size":nn,"--n-line-height-textarea":pn,"--n-color-disabled":Wt,"--n-color-focus":mn,"--n-text-color-disabled":gn,"--n-box-shadow-focus":En,"--n-loading-color":Et,"--n-caret-color-warning":ae,"--n-color-focus-warning":Pt,"--n-box-shadow-focus-warning":Sn,"--n-border-warning":fn,"--n-border-focus-warning":bn,"--n-border-hover-warning":hn,"--n-loading-color-warning":sn,"--n-caret-color-error":Ue,"--n-color-focus-error":mt,"--n-box-shadow-focus-error":an,"--n-border-error":rn,"--n-border-focus-error":Tn,"--n-border-hover-error":vn,"--n-loading-color-error":on,"--n-clear-color":Cn,"--n-clear-size":Ft,"--n-clear-color-hover":Z,"--n-clear-color-pressed":pe,"--n-icon-color":Ae,"--n-icon-color-hover":Ut,"--n-icon-color-pressed":ot,"--n-icon-color-disabled":Be,"--n-suffix-text-color":Qe}}),It=y?Kn("input",we(()=>{const{value:L}=p;return L[0]}),tn,g):void 0;return Object.assign(Object.assign({},Jt),{wrapperElRef:M,inputElRef:t,inputMirrorElRef:e,inputEl2Ref:n,textareaElRef:l,textareaMirrorElRef:o,textareaScrollbarInstRef:i,rtlEnabled:en,uncontrolledValue:c,mergedValue:d,passwordVisible:B,mergedPlaceholder:I,showPlaceholder1:T,showPlaceholder2:R,mergedFocus:w,isComposing:v,activated:N,showClearButton:x,mergedSize:p,mergedDisabled:S,textDecorationStyle:U,mergedClsPrefix:E,mergedBordered:b,mergedShowPasswordOn:k,placeholderStyle:kt,mergedStatus:h,textAreaScrollContainerWidth:F,handleTextAreaScroll:un,handleCompositionStart:ve,handleCompositionEnd:V,handleInput:X,handleInputBlur:Q,handleInputFocus:q,handleWrapperBlur:fe,handleWrapperFocus:ie,handleMouseEnter:He,handleMouseLeave:Oe,handleMouseDown:Ne,handleChange:de,handleClick:me,handleClear:Ce,handlePasswordToggleClick:Le,handlePasswordToggleMousedown:$e,handleWrapperKeydown:Ze,handleTextAreaMirrorResize:At,getTextareaScrollContainer:()=>l.value,mergedTheme:A,cssVars:y?void 0:tn,themeClass:It==null?void 0:It.themeClass,onRender:It==null?void 0:It.onRender})},render(){var g,E;const{mergedClsPrefix:b,mergedStatus:y,themeClass:D,type:A,countGraphemes:M,onRender:l}=this,o=this.$slots;return l==null||l(),z("div",{ref:"wrapperElRef",class:[`${b}-input`,D,y&&`${b}-input--${y}-status`,{[`${b}-input--rtl`]:this.rtlEnabled,[`${b}-input--disabled`]:this.mergedDisabled,[`${b}-input--textarea`]:A==="textarea",[`${b}-input--resizable`]:this.resizable&&!this.autosize,[`${b}-input--autosize`]:this.autosize,[`${b}-input--round`]:this.round&&A!=="textarea",[`${b}-input--pair`]:this.pair,[`${b}-input--focus`]:this.mergedFocus,[`${b}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.onKeyup,onKeydown:this.handleWrapperKeydown},z("div",{class:`${b}-input-wrapper`},_t(o.prefix,e=>e&&z("div",{class:`${b}-input__prefix`},e)),A==="textarea"?z(er,{ref:"textareaScrollbarInstRef",class:`${b}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var e,t;const{textAreaScrollContainerWidth:n}=this,a={width:this.autosize&&n&&`${n}px`};return z(St,null,z("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${b}-input__textarea-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:M?void 0:this.maxlength,minlength:M?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style,a],onBlur:this.handleInputBlur,onFocus:r=>this.handleInputFocus(r,2),onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?z("div",{class:`${b}-input__placeholder`,style:[this.placeholderStyle,a],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?z(Ro,{onResize:this.handleTextAreaMirrorResize},{default:()=>z("div",{ref:"textareaMirrorElRef",class:`${b}-input__textarea-mirror`,key:"mirror"})}):null)}}):z("div",{class:`${b}-input__input`},z("input",Object.assign({type:A==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":A},this.inputProps,{ref:"inputElRef",class:[`${b}-input__input-el`,(g=this.inputProps)===null||g===void 0?void 0:g.class],style:[this.textDecorationStyle[0],(E=this.inputProps)===null||E===void 0?void 0:E.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:M?void 0:this.maxlength,minlength:M?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>this.handleInputFocus(e,0),onInput:e=>this.handleInput(e,0),onChange:e=>this.handleChange(e,0)})),this.showPlaceholder1?z("div",{class:`${b}-input__placeholder`},z("span",null,this.mergedPlaceholder[0])):null,this.autosize?z("div",{class:`${b}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&_t(o.suffix,e=>e||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?z("div",{class:`${b}-input__suffix`},[_t(o["clear-icon-placeholder"],t=>(this.clearable||t)&&z(_a,{clsPrefix:b,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>t,icon:()=>{var n,a;return(a=(n=this.$slots)["clear-icon"])===null||a===void 0?void 0:a.call(n)}})),this.internalLoadingBeforeSuffix?null:e,this.loading!==void 0?z(Ks,{clsPrefix:b,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?e:null,this.showCount&&this.type!=="textarea"?z(wa,null,{default:t=>{var n;return(n=o.count)===null||n===void 0?void 0:n.call(o,t)}}):null,this.mergedShowPasswordOn&&this.type==="password"?z("div",{class:`${b}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Zt(o["password-visible-icon"],()=>[z(dn,{clsPrefix:b},{default:()=>z(zs,null)})]):Zt(o["password-invisible-icon"],()=>[z(dn,{clsPrefix:b},{default:()=>z(Hs,null)})])):null]):null)),this.pair?z("span",{class:`${b}-input__separator`},Zt(o.separator,()=>[this.separator])):null,this.pair?z("div",{class:`${b}-input-wrapper`},z("div",{class:`${b}-input__input`},z("input",{ref:"inputEl2Ref",type:this.type,class:`${b}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:M?void 0:this.maxlength,minlength:M?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:e=>this.handleInputFocus(e,1),onInput:e=>this.handleInput(e,1),onChange:e=>this.handleChange(e,1)}),this.showPlaceholder2?z("div",{class:`${b}-input__placeholder`},z("span",null,this.mergedPlaceholder[1])):null),_t(o.suffix,e=>(this.clearable||e)&&z("div",{class:`${b}-input__suffix`},[this.clearable&&z(_a,{clsPrefix:b,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var t;return(t=o["clear-icon"])===null||t===void 0?void 0:t.call(o)},placeholder:()=>{var t;return(t=o["clear-icon-placeholder"])===null||t===void 0?void 0:t.call(o)}}),e]))):null,this.mergedBordered?z("div",{class:`${b}-input__border`}):null,this.mergedBordered?z("div",{class:`${b}-input__state-border`}):null,this.showCount&&A==="textarea"?z(wa,null,{default:e=>{var t;const{renderCount:n}=this;return n?n(e):(t=o.count)===null||t===void 0?void 0:t.call(o,e)}}):null)}});var il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ol(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}function sl(g){if(g.__esModule)return g;var E=g.default;if(typeof E=="function"){var b=function y(){if(this instanceof y){var D=[null];D.push.apply(D,arguments);var A=Function.bind.apply(E,D);return new A}return E.apply(this,arguments)};b.prototype=E.prototype}else b={};return Object.defineProperty(b,"__esModule",{value:!0}),Object.keys(g).forEach(function(y){var D=Object.getOwnPropertyDescriptor(g,y);Object.defineProperty(b,y,D.get?D:{enumerable:!0,get:function(){return g[y]}})}),b}const ll=g=>{const{textColor1:E,dividerColor:b,fontWeightStrong:y}=g;return{textColor:E,color:b,fontWeight:y}},cl={name:"Divider",common:Un,self:ll},_l=cl,dl=xe("divider",` + position: relative; + display: flex; + width: 100%; + box-sizing: border-box; + font-size: 16px; + color: var(--n-text-color); + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); +`,[Rt("vertical",` + margin-top: 24px; + margin-bottom: 24px; + `,[Rt("no-title",` + display: flex; + align-items: center; + `)]),ee("title",` + display: flex; + align-items: center; + margin-left: 12px; + margin-right: 12px; + white-space: nowrap; + font-weight: var(--n-font-weight); + `),Ie("title-position-left",[ee("line",[Ie("left",{width:"28px"})])]),Ie("title-position-right",[ee("line",[Ie("right",{width:"28px"})])]),Ie("dashed",[ee("line",` + background-color: #0000; + height: 0px; + width: 100%; + border-style: dashed; + border-width: 1px 0 0; + `)]),Ie("vertical",` + display: inline-block; + height: 1em; + margin: 0 8px; + vertical-align: middle; + width: 1px; + `),ee("line",` + border: none; + transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier); + height: 1px; + width: 100%; + margin: 0; + `),Rt("dashed",[ee("line",{backgroundColor:"var(--n-color)"})]),Ie("dashed",[ee("line",{borderColor:"var(--n-color)"})]),Ie("vertical",{backgroundColor:"var(--n-color)"})]),ul=Object.assign(Object.assign({},lt.props),{titlePlacement:{type:String,default:"center"},dashed:Boolean,vertical:Boolean}),xa=tt({name:"Divider",props:ul,setup(g){const{mergedClsPrefixRef:E,inlineThemeDisabled:b}=Xt(g),y=lt("Divider","-divider",dl,_l,g,E),D=we(()=>{const{common:{cubicBezierEaseInOut:M},self:{color:l,textColor:o,fontWeight:e}}=y.value;return{"--n-bezier":M,"--n-color":l,"--n-text-color":o,"--n-font-weight":e}}),A=b?Kn("divider",void 0,D,g):void 0;return{mergedClsPrefix:E,cssVars:b?void 0:D,themeClass:A==null?void 0:A.themeClass,onRender:A==null?void 0:A.onRender}},render(){var g;const{$slots:E,titlePlacement:b,vertical:y,dashed:D,cssVars:A,mergedClsPrefix:M}=this;return(g=this.onRender)===null||g===void 0||g.call(this),z("div",{role:"separator",class:[`${M}-divider`,this.themeClass,{[`${M}-divider--vertical`]:y,[`${M}-divider--no-title`]:!E.default,[`${M}-divider--dashed`]:D,[`${M}-divider--title-position-${b}`]:E.default&&b}],style:A},y?null:z("div",{class:`${M}-divider__line ${M}-divider__line--left`}),!y&&E.default?z(St,null,z("div",{class:`${M}-divider__title`},this.$slots),z("div",{class:`${M}-divider__line ${M}-divider__line--right`})):null)}}),pl={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},ml=()=>pl,gl={name:"Space",self:ml},El=gl;let na;const Sl=()=>{if(!Oo)return!0;if(na===void 0){const g=document.createElement("div");g.style.display="flex",g.style.flexDirection="column",g.style.rowGap="1px",g.appendChild(document.createElement("div")),g.appendChild(document.createElement("div")),document.body.appendChild(g);const E=g.scrollHeight===1;return document.body.removeChild(g),na=E}return na},fl=Object.assign(Object.assign({},lt.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),aa=tt({name:"Space",props:fl,setup(g){const{mergedClsPrefixRef:E,mergedRtlRef:b}=Xt(g),y=lt("Space","-space",void 0,El,g,E),D=ha("Space",b,E);return{useGap:Sl(),rtlEnabled:D,mergedClsPrefix:E,margin:we(()=>{const{size:A}=g;if(Array.isArray(A))return{horizontal:A[0],vertical:A[1]};if(typeof A=="number")return{horizontal:A,vertical:A};const{self:{[rt("gap",A)]:M}}=y.value,{row:l,col:o}=Io(M);return{horizontal:ht(o),vertical:ht(l)}})}},render(){const{vertical:g,align:E,inline:b,justify:y,itemStyle:D,margin:A,wrap:M,mergedClsPrefix:l,rtlEnabled:o,useGap:e,wrapItem:t,internalUseGap:n}=this,a=Ao(Uo(this));if(!a.length)return null;const r=`${A.horizontal}px`,i=`${A.horizontal/2}px`,s=`${A.vertical}px`,c=`${A.vertical/2}px`,_=a.length-1,d=y.startsWith("space-");return z("div",{role:"none",class:[`${l}-space`,o&&`${l}-space--rtl`],style:{display:b?"inline-flex":"flex",flexDirection:g?"column":"row",justifyContent:["start","end"].includes(y)?"flex-"+y:y,flexWrap:!M||g?"nowrap":"wrap",marginTop:e||g?"":`-${c}`,marginBottom:e||g?"":`-${c}`,alignItems:E,gap:e?`${A.vertical}px ${A.horizontal}px`:""}},!t&&(e||n)?a:a.map((u,p)=>z("div",{role:"none",style:[D,{maxWidth:"100%"},e?"":g?{marginBottom:p!==_?s:""}:o?{marginLeft:d?y==="space-between"&&p===_?"":i:p!==_?r:"",marginRight:d?y==="space-between"&&p===0?"":i:"",paddingTop:c,paddingBottom:c}:{marginRight:d?y==="space-between"&&p===_?"":i:p!==_?r:"",marginLeft:d?y==="space-between"&&p===0?"":i:"",paddingTop:c,paddingBottom:c}]},u)))}}),bl={feedbackPadding:"4px 0 0 2px",feedbackHeightSmall:"24px",feedbackHeightMedium:"24px",feedbackHeightLarge:"26px",feedbackFontSizeSmall:"13px",feedbackFontSizeMedium:"14px",feedbackFontSizeLarge:"14px",labelFontSizeLeftSmall:"14px",labelFontSizeLeftMedium:"14px",labelFontSizeLeftLarge:"15px",labelFontSizeTopSmall:"13px",labelFontSizeTopMedium:"14px",labelFontSizeTopLarge:"14px",labelHeightSmall:"24px",labelHeightMedium:"26px",labelHeightLarge:"28px",labelPaddingVertical:"0 0 6px 2px",labelPaddingHorizontal:"0 12px 0 0",labelTextAlignVertical:"left",labelTextAlignHorizontal:"right",labelFontWeight:"400"},hl=g=>{const{heightSmall:E,heightMedium:b,heightLarge:y,textColor1:D,errorColor:A,warningColor:M,lineHeight:l,textColor3:o}=g;return Object.assign(Object.assign({},bl),{blankHeightSmall:E,blankHeightMedium:b,blankHeightLarge:y,lineHeight:l,labelTextColor:D,asteriskColor:A,feedbackTextColorError:A,feedbackTextColorWarning:M,feedbackTextColor:o})},Tl={name:"Form",common:Un,self:hl},ir=Tl,vl=xe("form",[Ie("inline",` + width: 100%; + display: inline-flex; + align-items: flex-start; + align-content: space-around; + `,[xe("form-item",{width:"auto",marginRight:"18px"},[je("&:last-child",{marginRight:0})])])]),Bn=fa("n-form"),or=fa("n-form-item-insts");var Cl=globalThis&&globalThis.__awaiter||function(g,E,b,y){function D(A){return A instanceof b?A:new b(function(M){M(A)})}return new(b||(b=Promise))(function(A,M){function l(t){try{e(y.next(t))}catch(n){M(n)}}function o(t){try{e(y.throw(t))}catch(n){M(n)}}function e(t){t.done?A(t.value):D(t.value).then(l,o)}e((y=y.apply(g,E||[])).next())})};const yl=Object.assign(Object.assign({},lt.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:g=>g.preventDefault()},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),Rl=tt({name:"Form",props:yl,setup(g){const{mergedClsPrefixRef:E}=Xt(g);lt("Form","-form",vl,ir,g,E);const b={},y=Fe(void 0),D=o=>{const e=y.value;(e===void 0||o>=e)&&(y.value=o)};function A(o,e=()=>!0){return Cl(this,void 0,void 0,function*(){return yield new Promise((t,n)=>{const a=[];for(const r of Na(b)){const i=b[r];for(const s of i)s.path&&a.push(s.internalValidate(null,e))}Promise.all(a).then(r=>{if(r.some(i=>!i.valid)){const i=r.filter(s=>s.errors).map(s=>s.errors);o&&o(i),n(i)}else o&&o(),t()})})})}function M(){for(const o of Na(b)){const e=b[o];for(const t of e)t.restoreValidation()}}return Pn(Bn,{props:g,maxChildLabelWidthRef:y,deriveMaxChildLabelWidth:D}),Pn(or,{formItems:b}),Object.assign({validate:A,restoreValidation:M},{mergedClsPrefix:E})},render(){const{mergedClsPrefix:g}=this;return z("form",{class:[`${g}-form`,this.inline&&`${g}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Kt(){return Kt=Object.assign?Object.assign.bind():function(g){for(var E=1;E"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wn(g,E,b){return Ol()?Wn=Reflect.construct.bind():Wn=function(D,A,M){var l=[null];l.push.apply(l,A);var o=Function.bind.apply(D,l),e=new o;return M&&Fn(e,M.prototype),e},Wn.apply(null,arguments)}function Al(g){return Function.toString.call(g).indexOf("[native code]")!==-1}function ua(g){var E=typeof Map=="function"?new Map:void 0;return ua=function(y){if(y===null||!Al(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof E<"u"){if(E.has(y))return E.get(y);E.set(y,D)}function D(){return Wn(y,arguments,da(this).constructor)}return D.prototype=Object.create(y.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),Fn(D,y)},ua(g)}var Il=/%[sdj%]/g,Dl=function(){};typeof process<"u"&&process.env;function pa(g){if(!g||!g.length)return null;var E={};return g.forEach(function(b){var y=b.field;E[y]=E[y]||[],E[y].push(b)}),E}function ut(g){for(var E=arguments.length,b=new Array(E>1?E-1:0),y=1;y=A)return l;switch(l){case"%s":return String(b[D++]);case"%d":return Number(b[D++]);case"%j":try{return JSON.stringify(b[D++])}catch{return"[Circular]"}break;default:return l}});return M}return g}function wl(g){return g==="string"||g==="url"||g==="hex"||g==="email"||g==="date"||g==="pattern"}function it(g,E){return!!(g==null||E==="array"&&Array.isArray(g)&&!g.length||wl(E)&&typeof g=="string"&&!g)}function xl(g,E,b){var y=[],D=0,A=g.length;function M(l){y.push.apply(y,l||[]),D++,D===A&&b(y)}g.forEach(function(l){E(l,M)})}function Ma(g,E,b){var y=0,D=g.length;function A(M){if(M&&M.length){b(M);return}var l=y;y=y+1,l()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},kn={integer:function(E){return kn.number(E)&&parseInt(E,10)===E},float:function(E){return kn.number(E)&&!kn.integer(E)},array:function(E){return Array.isArray(E)},regexp:function(E){if(E instanceof RegExp)return!0;try{return!!new RegExp(E)}catch{return!1}},date:function(E){return typeof E.getTime=="function"&&typeof E.getMonth=="function"&&typeof E.getYear=="function"&&!isNaN(E.getTime())},number:function(E){return isNaN(E)?!1:typeof E=="number"},object:function(E){return typeof E=="object"&&!kn.array(E)},method:function(E){return typeof E=="function"},email:function(E){return typeof E=="string"&&E.length<=320&&!!E.match(Fa.email)},url:function(E){return typeof E=="string"&&E.length<=2048&&!!E.match(Ul())},hex:function(E){return typeof E=="string"&&!!E.match(Fa.hex)}},Bl=function(E,b,y,D,A){if(E.required&&b===void 0){sr(E,b,y,D,A);return}var M=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=E.type;M.indexOf(l)>-1?kn[l](b)||D.push(ut(A.messages.types[l],E.fullField,E.type)):l&&typeof b!==E.type&&D.push(ut(A.messages.types[l],E.fullField,E.type))},Gl=function(E,b,y,D,A){var M=typeof E.len=="number",l=typeof E.min=="number",o=typeof E.max=="number",e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,t=b,n=null,a=typeof b=="number",r=typeof b=="string",i=Array.isArray(b);if(a?n="number":r?n="string":i&&(n="array"),!n)return!1;i&&(t=b.length),r&&(t=b.replace(e,"_").length),M?t!==E.len&&D.push(ut(A.messages[n].len,E.fullField,E.len)):l&&!o&&tE.max?D.push(ut(A.messages[n].max,E.fullField,E.max)):l&&o&&(tE.max)&&D.push(ut(A.messages[n].range,E.fullField,E.min,E.max))},ln="enum",Yl=function(E,b,y,D,A){E[ln]=Array.isArray(E[ln])?E[ln]:[],E[ln].indexOf(b)===-1&&D.push(ut(A.messages[ln],E.fullField,E[ln].join(", ")))},ql=function(E,b,y,D,A){if(E.pattern){if(E.pattern instanceof RegExp)E.pattern.lastIndex=0,E.pattern.test(b)||D.push(ut(A.messages.pattern.mismatch,E.fullField,b,E.pattern));else if(typeof E.pattern=="string"){var M=new RegExp(E.pattern);M.test(b)||D.push(ut(A.messages.pattern.mismatch,E.fullField,b,E.pattern))}}},Me={required:sr,whitespace:Fl,type:Bl,range:Gl,enum:Yl,pattern:ql},Vl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b,"string")&&!E.required)return y();Me.required(E,b,D,M,A,"string"),it(b,"string")||(Me.type(E,b,D,M,A),Me.range(E,b,D,M,A),Me.pattern(E,b,D,M,A),E.whitespace===!0&&Me.whitespace(E,b,D,M,A))}y(M)},zl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A),b!==void 0&&Me.type(E,b,D,M,A)}y(M)},Hl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(b===""&&(b=void 0),it(b)&&!E.required)return y();Me.required(E,b,D,M,A),b!==void 0&&(Me.type(E,b,D,M,A),Me.range(E,b,D,M,A))}y(M)},$l=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A),b!==void 0&&Me.type(E,b,D,M,A)}y(M)},Wl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A),it(b)||Me.type(E,b,D,M,A)}y(M)},jl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A),b!==void 0&&(Me.type(E,b,D,M,A),Me.range(E,b,D,M,A))}y(M)},Ql=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A),b!==void 0&&(Me.type(E,b,D,M,A),Me.range(E,b,D,M,A))}y(M)},Kl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(b==null&&!E.required)return y();Me.required(E,b,D,M,A,"array"),b!=null&&(Me.type(E,b,D,M,A),Me.range(E,b,D,M,A))}y(M)},Zl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A),b!==void 0&&Me.type(E,b,D,M,A)}y(M)},Xl="enum",Jl=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A),b!==void 0&&Me[Xl](E,b,D,M,A)}y(M)},ec=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b,"string")&&!E.required)return y();Me.required(E,b,D,M,A),it(b,"string")||Me.pattern(E,b,D,M,A)}y(M)},tc=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b,"date")&&!E.required)return y();if(Me.required(E,b,D,M,A),!it(b,"date")){var o;b instanceof Date?o=b:o=new Date(b),Me.type(E,o,D,M,A),o&&Me.range(E,o.getTime(),D,M,A)}}y(M)},nc=function(E,b,y,D,A){var M=[],l=Array.isArray(b)?"array":typeof b;Me.required(E,b,D,M,A,l),y(M)},ra=function(E,b,y,D,A){var M=E.type,l=[],o=E.required||!E.required&&D.hasOwnProperty(E.field);if(o){if(it(b,M)&&!E.required)return y();Me.required(E,b,D,l,A,M),it(b,M)||Me.type(E,b,D,l,A)}y(l)},ac=function(E,b,y,D,A){var M=[],l=E.required||!E.required&&D.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();Me.required(E,b,D,M,A)}y(M)},Ln={string:Vl,method:zl,number:Hl,boolean:$l,regexp:Wl,integer:jl,float:Ql,array:Kl,object:Zl,enum:Jl,pattern:ec,date:tc,url:ra,hex:ra,email:ra,required:nc,any:ac};function ma(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var E=JSON.parse(JSON.stringify(this));return E.clone=this.clone,E}}}var ga=ma(),Gn=function(){function g(b){this.rules=null,this._messages=ga,this.define(b)}var E=g.prototype;return E.define=function(y){var D=this;if(!y)throw new Error("Cannot configure a schema with no rules");if(typeof y!="object"||Array.isArray(y))throw new Error("Rules must be an object");this.rules={},Object.keys(y).forEach(function(A){var M=y[A];D.rules[A]=Array.isArray(M)?M:[M]})},E.messages=function(y){return y&&(this._messages=Pa(ma(),y)),this._messages},E.validate=function(y,D,A){var M=this;D===void 0&&(D={}),A===void 0&&(A=function(){});var l=y,o=D,e=A;if(typeof o=="function"&&(e=o,o={}),!this.rules||Object.keys(this.rules).length===0)return e&&e(null,l),Promise.resolve(l);function t(s){var c=[],_={};function d(p){if(Array.isArray(p)){var S;c=(S=c).concat.apply(S,p)}else c.push(p)}for(var u=0;ug.size!==void 0?g.size:(E==null?void 0:E.props.size)!==void 0?E.props.size:"medium")}}function ic(g){const E=Vt(Bn,null),b=we(()=>{const{labelPlacement:r}=g;return r!==void 0?r:E!=null&&E.props.labelPlacement?E.props.labelPlacement:"top"}),y=we(()=>b.value==="left"&&(g.labelWidth==="auto"||(E==null?void 0:E.props.labelWidth)==="auto")),D=we(()=>{if(b.value==="top")return;const{labelWidth:r}=g;if(r!==void 0&&r!=="auto")return Xn(r);if(y.value){const i=E==null?void 0:E.maxChildLabelWidthRef.value;return i!==void 0?Xn(i):void 0}if((E==null?void 0:E.props.labelWidth)!==void 0)return Xn(E.props.labelWidth)}),A=we(()=>{const{labelAlign:r}=g;if(r)return r;if(E!=null&&E.props.labelAlign)return E.props.labelAlign}),M=we(()=>{var r;return[(r=g.labelProps)===null||r===void 0?void 0:r.style,g.labelStyle,{width:D.value}]}),l=we(()=>{const{showRequireMark:r}=g;return r!==void 0?r:E==null?void 0:E.props.showRequireMark}),o=we(()=>{const{requireMarkPlacement:r}=g;return r!==void 0?r:(E==null?void 0:E.props.requireMarkPlacement)||"right"}),e=Fe(!1),t=we(()=>{const{validationStatus:r}=g;if(r!==void 0)return r;if(e.value)return"error"}),n=we(()=>{const{showFeedback:r}=g;return r!==void 0?r:(E==null?void 0:E.props.showFeedback)!==void 0?E.props.showFeedback:!0}),a=we(()=>{const{showLabel:r}=g;return r!==void 0?r:(E==null?void 0:E.props.showLabel)!==void 0?E.props.showLabel:!0});return{validationErrored:e,mergedLabelStyle:M,mergedLabelPlacement:b,mergedLabelAlign:A,mergedShowRequireMark:l,mergedRequireMarkPlacement:o,mergedValidationStatus:t,mergedShowFeedback:n,mergedShowLabel:a,isAutoLabelWidth:y}}function oc(g){const E=Vt(Bn,null),b=we(()=>{const{rulePath:M}=g;if(M!==void 0)return M;const{path:l}=g;if(l!==void 0)return l}),y=we(()=>{const M=[],{rule:l}=g;if(l!==void 0&&(Array.isArray(l)?M.push(...l):M.push(l)),E){const{rules:o}=E.props,{value:e}=b;if(o!==void 0&&e!==void 0){const t=tr(o,e);t!==void 0&&(Array.isArray(t)?M.push(...t):M.push(t))}}return M}),D=we(()=>y.value.some(M=>M.required)),A=we(()=>D.value||g.required);return{mergedRules:y,mergedRequired:A}}const{cubicBezierEaseInOut:Ua}=Do;function sc({name:g="fade-down",fromOffset:E="-4px",enterDuration:b=".3s",leaveDuration:y=".3s",enterCubicBezier:D=Ua,leaveCubicBezier:A=Ua}={}){return[je(`&.${g}-transition-enter-from, &.${g}-transition-leave-to`,{opacity:0,transform:`translateY(${E})`}),je(`&.${g}-transition-enter-to, &.${g}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),je(`&.${g}-transition-leave-active`,{transition:`opacity ${y} ${A}, transform ${y} ${A}`}),je(`&.${g}-transition-enter-active`,{transition:`opacity ${b} ${D}, transform ${b} ${D}`})]}const lc=xe("form-item",` + display: grid; + line-height: var(--n-line-height); +`,[xe("form-item-label",` + grid-area: label; + align-items: center; + line-height: 1.25; + text-align: var(--n-label-text-align); + font-size: var(--n-label-font-size); + min-height: var(--n-label-height); + padding: var(--n-label-padding); + color: var(--n-label-text-color); + transition: color .3s var(--n-bezier); + box-sizing: border-box; + font-weight: var(--n-label-font-weight); + `,[ee("asterisk",` + white-space: nowrap; + user-select: none; + -webkit-user-select: none; + color: var(--n-asterisk-color); + transition: color .3s var(--n-bezier); + `),ee("asterisk-placeholder",` + grid-area: mark; + user-select: none; + -webkit-user-select: none; + visibility: hidden; + `)]),xe("form-item-blank",` + grid-area: blank; + min-height: var(--n-blank-height); + `),Ie("auto-label-width",[xe("form-item-label","white-space: nowrap;")]),Ie("left-labelled",` + grid-template-areas: + "label blank" + "label feedback"; + grid-template-columns: auto minmax(0, 1fr); + grid-template-rows: auto 1fr; + align-items: start; + `,[xe("form-item-label",` + display: grid; + grid-template-columns: 1fr auto; + min-height: var(--n-blank-height); + height: auto; + box-sizing: border-box; + flex-shrink: 0; + flex-grow: 0; + `,[Ie("reverse-columns-space",` + grid-template-columns: auto 1fr; + `),Ie("left-mark",` + grid-template-areas: + "mark text" + ". text"; + `),Ie("right-mark",` + grid-template-areas: + "text mark" + "text ."; + `),Ie("right-hanging-mark",` + grid-template-areas: + "text mark" + "text ."; + `),ee("text",` + grid-area: text; + `),ee("asterisk",` + grid-area: mark; + align-self: end; + `)])]),Ie("top-labelled",` + grid-template-areas: + "label" + "blank" + "feedback"; + grid-template-rows: minmax(var(--n-label-height), auto) 1fr; + grid-template-columns: minmax(0, 100%); + `,[Ie("no-label",` + grid-template-areas: + "blank" + "feedback"; + grid-template-rows: 1fr; + `),xe("form-item-label",` + display: flex; + align-items: flex-start; + justify-content: var(--n-label-text-align); + `)]),xe("form-item-blank",` + box-sizing: border-box; + display: flex; + align-items: center; + position: relative; + `),xe("form-item-feedback-wrapper",` + grid-area: feedback; + box-sizing: border-box; + min-height: var(--n-feedback-height); + font-size: var(--n-feedback-font-size); + line-height: 1.25; + transform-origin: top left; + `,[je("&:not(:empty)",` + padding: var(--n-feedback-padding); + `),xe("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[Ie("warning",{color:"var(--n-feedback-text-color-warning)"}),Ie("error",{color:"var(--n-feedback-text-color-error)"}),sc({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var Ba=globalThis&&globalThis.__awaiter||function(g,E,b,y){function D(A){return A instanceof b?A:new b(function(M){M(A)})}return new(b||(b=Promise))(function(A,M){function l(t){try{e(y.next(t))}catch(n){M(n)}}function o(t){try{e(y.throw(t))}catch(n){M(n)}}function e(t){t.done?A(t.value):D(t.value).then(l,o)}e((y=y.apply(g,E||[])).next())})};const cc=Object.assign(Object.assign({},lt.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,showLabel:{type:Boolean,default:void 0},labelProps:Object});function Ga(g,E){return(...b)=>{try{const y=g(...b);return!E&&(typeof y=="boolean"||y instanceof Error||Array.isArray(y))||y!=null&&y.then?y:(y===void 0||Aa("form-item/validate",`You return a ${typeof y} typed value in the validator method, which is not recommended. Please use `+(E?"`Promise`":"`boolean`, `Error` or `Promise`")+" typed value instead."),!0)}catch(y){Aa("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(y);return}}}const Qt=tt({name:"FormItem",props:cc,setup(g){Bo(or,"formItems",Nt(g,"path"));const{mergedClsPrefixRef:E,inlineThemeDisabled:b}=Xt(g),y=Vt(Bn,null),D=rc(g),A=ic(g),{validationErrored:M}=A,{mergedRequired:l,mergedRules:o}=oc(g),{mergedSize:e}=D,{mergedLabelPlacement:t,mergedLabelAlign:n,mergedRequireMarkPlacement:a}=A,r=Fe([]),i=Fe(Oa()),s=y?Nt(y.props,"disabled"):Fe(!1),c=lt("Form","-form-item",lc,ir,g,E);qt(Nt(g,"path"),()=>{g.ignorePathChange||_()});function _(){r.value=[],M.value=!1,g.feedback&&(i.value=Oa())}function d(){m("blur")}function u(){m("change")}function p(){m("focus")}function S(){m("input")}function h(T,R){return Ba(this,void 0,void 0,function*(){let w,x,k,B;return typeof T=="string"?(w=T,x=R):T!==null&&typeof T=="object"&&(w=T.trigger,x=T.callback,k=T.shouldRuleBeApplied,B=T.options),yield new Promise((U,F)=>{m(w,k,B).then(({valid:W,errors:K})=>{W?(x&&x(),U()):(x&&x(K),F(K))})})})}const m=(T=null,R=()=>!0,w={suppressWarning:!0})=>Ba(this,void 0,void 0,function*(){const{path:x}=g;w?w.first||(w.first=g.first):w={};const{value:k}=o,B=y?tr(y.props.model,x||""):void 0,U={},F={},W=(T?k.filter($=>Array.isArray($.trigger)?$.trigger.includes(T):$.trigger===T):k).filter(R).map(($,te)=>{const j=Object.assign({},$);if(j.validator&&(j.validator=Ga(j.validator,!1)),j.asyncValidator&&(j.asyncValidator=Ga(j.asyncValidator,!0)),j.renderMessage){const re=`__renderMessage__${te}`;F[re]=j.message,j.message=re,U[re]=j.renderMessage}return j});if(!W.length)return{valid:!0};const K=x??"__n_no_path__",G=new Gn({[K]:W}),{validateMessages:Y}=(y==null?void 0:y.props)||{};return Y&&G.messages(Y),yield new Promise($=>{G.validate({[K]:B},w,te=>{te!=null&&te.length?(r.value=te.map(j=>{const re=(j==null?void 0:j.message)||"";return{key:re,render:()=>re.startsWith("__renderMessage__")?U[re]():re}}),te.forEach(j=>{var re;!((re=j.message)===null||re===void 0)&&re.startsWith("__renderMessage__")&&(j.message=F[j.message])}),M.value=!0,$({valid:!1,errors:te})):(_(),$({valid:!0}))})})});Pn(wo,{path:Nt(g,"path"),disabled:s,mergedSize:D.mergedSize,mergedValidationStatus:A.mergedValidationStatus,restoreValidation:_,handleContentBlur:d,handleContentChange:u,handleContentFocus:p,handleContentInput:S});const f={validate:h,restoreValidation:_,internalValidate:m},v=Fe(null);Sa(()=>{if(!A.isAutoLabelWidth.value)return;const T=v.value;if(T!==null){const R=T.style.whiteSpace;T.style.whiteSpace="nowrap",T.style.width="",y==null||y.deriveMaxChildLabelWidth(Number(getComputedStyle(T).width.slice(0,-2))),T.style.whiteSpace=R}});const N=we(()=>{var T;const{value:R}=e,{value:w}=t,x=w==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:k},self:{labelTextColor:B,asteriskColor:U,lineHeight:F,feedbackTextColor:W,feedbackTextColorWarning:K,feedbackTextColorError:G,feedbackPadding:Y,labelFontWeight:$,[rt("labelHeight",R)]:te,[rt("blankHeight",R)]:j,[rt("feedbackFontSize",R)]:re,[rt("feedbackHeight",R)]:le,[rt("labelPadding",x)]:Re,[rt("labelTextAlign",x)]:Te,[rt(rt("labelFontSize",w),R)]:De}}=c.value;let Ee=(T=n.value)!==null&&T!==void 0?T:Te;return w==="top"&&(Ee=Ee==="right"?"flex-end":"flex-start"),{"--n-bezier":k,"--n-line-height":F,"--n-blank-height":j,"--n-label-font-size":De,"--n-label-text-align":Ee,"--n-label-height":te,"--n-label-padding":Re,"--n-label-font-weight":$,"--n-asterisk-color":U,"--n-label-text-color":B,"--n-feedback-padding":Y,"--n-feedback-font-size":re,"--n-feedback-height":le,"--n-feedback-text-color":W,"--n-feedback-text-color-warning":K,"--n-feedback-text-color-error":G}}),O=b?Kn("form-item",we(()=>{var T;return`${e.value[0]}${t.value[0]}${((T=n.value)===null||T===void 0?void 0:T[0])||""}`}),N,g):void 0,I=we(()=>t.value==="left"&&a.value==="left"&&n.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:v,mergedClsPrefix:E,mergedRequired:l,feedbackId:i,renderExplains:r,reverseColSpace:I},A),D),f),{cssVars:b?void 0:N,themeClass:O==null?void 0:O.themeClass,onRender:O==null?void 0:O.onRender})},render(){const{$slots:g,mergedClsPrefix:E,mergedShowLabel:b,mergedShowRequireMark:y,mergedRequireMarkPlacement:D,onRender:A}=this,M=y!==void 0?y:this.mergedRequired;A==null||A();const l=()=>{const o=this.$slots.label?this.$slots.label():this.label;if(!o)return null;const e=z("span",{class:`${E}-form-item-label__text`},o),t=M?z("span",{class:`${E}-form-item-label__asterisk`},D!=="left"?" *":"* "):D==="right-hanging"&&z("span",{class:`${E}-form-item-label__asterisk-placeholder`}," *"),{labelProps:n}=this;return z("label",Object.assign({},n,{class:[n==null?void 0:n.class,`${E}-form-item-label`,`${E}-form-item-label--${D}-mark`,this.reverseColSpace&&`${E}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),D==="left"?[t,e]:[e,t])};return z("div",{class:[`${E}-form-item`,this.themeClass,`${E}-form-item--${this.mergedSize}-size`,`${E}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${E}-form-item--auto-label-width`,!b&&`${E}-form-item--no-label`],style:this.cssVars},b&&l(),z("div",{class:[`${E}-form-item-blank`,this.mergedValidationStatus&&`${E}-form-item-blank--${this.mergedValidationStatus}`]},g),this.mergedShowFeedback?z("div",{key:this.feedbackId,class:`${E}-form-item-feedback-wrapper`},z(Ha,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:o}=this;return _t(g.feedback,e=>{var t;const{feedback:n}=this,a=e||n?z("div",{key:"__feedback__",class:`${E}-form-item-feedback__line`},e||n):this.renderExplains.length?(t=this.renderExplains)===null||t===void 0?void 0:t.map(({key:r,render:i})=>z("div",{key:r,class:`${E}-form-item-feedback__line`},i())):null;return a?o==="warning"?z("div",{key:"controlled-warning",class:`${E}-form-item-feedback ${E}-form-item-feedback--warning`},a):o==="error"?z("div",{key:"controlled-error",class:`${E}-form-item-feedback ${E}-form-item-feedback--error`},a):o==="success"?z("div",{key:"controlled-success",class:`${E}-form-item-feedback ${E}-form-item-feedback--success`},a):z("div",{key:"controlled-default",class:`${E}-form-item-feedback`},a):null})}})):null)}}),_c=g=>{const{textColorDisabled:E}=g;return{iconColorDisabled:E}},dc=xo({name:"InputNumber",common:Un,peers:{Button:Mo,Input:ar},self:_c}),uc=dc,pc={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},mc=g=>{const{primaryColor:E,opacityDisabled:b,borderRadius:y,textColor3:D}=g,A="rgba(0, 0, 0, .14)";return Object.assign(Object.assign({},pc),{iconColor:D,textColor:"white",loadingColor:E,opacityDisabled:b,railColor:A,railColorActive:E,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:y,railBorderRadiusMedium:y,railBorderRadiusLarge:y,buttonBorderRadiusSmall:y,buttonBorderRadiusMedium:y,buttonBorderRadiusLarge:y,boxShadowFocus:`0 0 0 2px ${Hn(E,{alpha:.2})}`})},gc={name:"Switch",common:Un,self:mc},Ec=gc;function Sc(g){return g==null||typeof g=="string"&&g.trim()===""?null:Number(g)}function fc(g){return g.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(g)||/^\.\d+$/.test(g))}function ia(g){return g==null?!0:!Number.isNaN(g)}function Ya(g,E){return g==null?"":E===void 0?String(g):g.toFixed(E)}function oa(g){if(g===null)return null;if(typeof g=="number")return g;{const E=Number(g);return Number.isNaN(E)?null:E}}const bc=je([xe("input-number-suffix",` + display: inline-block; + margin-right: 10px; + `),xe("input-number-prefix",` + display: inline-block; + margin-left: 10px; + `)]),qa=800,Va=100,hc=Object.assign(Object.assign({},lt.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),Tc=tt({name:"InputNumber",props:hc,setup(g){const{mergedBorderedRef:E,mergedClsPrefixRef:b,mergedRtlRef:y}=Xt(g),D=lt("InputNumber","-input-number",bc,uc,g,b),{localeRef:A}=nr("InputNumber"),M=ba(g),{mergedSizeRef:l,mergedDisabledRef:o,mergedStatusRef:e}=M,t=Fe(null),n=Fe(null),a=Fe(null),r=Fe(g.defaultValue),i=Nt(g,"value"),s=Ta(i,r),c=Fe(""),_=V=>{const X=String(V).split(".")[1];return X?X.length:0},d=V=>{const X=[g.min,g.max,g.step,V].map(ce=>ce===void 0?0:_(ce));return Math.max(...X)},u=Mt(()=>{const{placeholder:V}=g;return V!==void 0?V:A.value.placeholder}),p=Mt(()=>{const V=oa(g.step);return V!==null?V===0?1:Math.abs(V):1}),S=Mt(()=>{const V=oa(g.min);return V!==null?V:null}),h=Mt(()=>{const V=oa(g.max);return V!==null?V:null}),m=V=>{const{value:X}=s;if(V===X){v();return}const{"onUpdate:value":ce,onUpdateValue:Q,onChange:q}=g,{nTriggerFormInput:fe,nTriggerFormChange:ie}=M;q&&Ke(q,V),Q&&Ke(Q,V),ce&&Ke(ce,V),r.value=V,fe(),ie()},f=({offset:V,doUpdateIfValid:X,fixPrecision:ce,isInputing:Q})=>{const{value:q}=c;if(Q&&fc(q))return!1;const fe=(g.parse||Sc)(q);if(fe===null)return X&&m(null),null;if(ia(fe)){const ie=_(fe),{precision:se}=g;if(se!==void 0&&seme){if(!X||Q)return!1;de=me}if(Ce!==null&&de{const{value:V}=s;if(ia(V)){const{format:X,precision:ce}=g;X?c.value=X(V):V===null||ce===void 0||_(V)>ce?c.value=Ya(V,void 0):c.value=Ya(V,ce)}else c.value=String(V)};v();const N=Mt(()=>f({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),O=Mt(()=>{const{value:V}=s;if(g.validator&&V===null)return!1;const{value:X}=p;return f({offset:-X,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),I=Mt(()=>{const{value:V}=s;if(g.validator&&V===null)return!1;const{value:X}=p;return f({offset:+X,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function T(V){const{onFocus:X}=g,{nTriggerFormFocus:ce}=M;X&&Ke(X,V),ce()}function R(V){var X,ce;if(V.target===((X=t.value)===null||X===void 0?void 0:X.wrapperElRef))return;const Q=f({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(Q!==!1){const ie=(ce=t.value)===null||ce===void 0?void 0:ce.inputElRef;ie&&(ie.value=String(Q||"")),s.value===Q&&v()}else v();const{onBlur:q}=g,{nTriggerFormBlur:fe}=M;q&&Ke(q,V),fe(),jn(()=>{v()})}function w(V){const{onClear:X}=g;X&&Ke(X,V)}function x(){const{value:V}=I;if(!V){j();return}const{value:X}=s;if(X===null)g.validator||m(F());else{const{value:ce}=p;f({offset:ce,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function k(){const{value:V}=O;if(!V){te();return}const{value:X}=s;if(X===null)g.validator||m(F());else{const{value:ce}=p;f({offset:-ce,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const B=T,U=R;function F(){if(g.validator)return null;const{value:V}=S,{value:X}=h;return V!==null?Math.max(0,V):X!==null?Math.min(0,X):0}function W(V){w(V),m(null)}function K(V){var X,ce,Q;!((X=a.value)===null||X===void 0)&&X.$el.contains(V.target)&&V.preventDefault(),!((ce=n.value)===null||ce===void 0)&&ce.$el.contains(V.target)&&V.preventDefault(),(Q=t.value)===null||Q===void 0||Q.activate()}let G=null,Y=null,$=null;function te(){$&&(window.clearTimeout($),$=null),G&&(window.clearInterval(G),G=null)}function j(){le&&(window.clearTimeout(le),le=null),Y&&(window.clearInterval(Y),Y=null)}function re(){te(),$=window.setTimeout(()=>{G=window.setInterval(()=>{k()},Va)},qa),Qn("mouseup",document,te,{once:!0})}let le=null;function Re(){j(),le=window.setTimeout(()=>{Y=window.setInterval(()=>{x()},Va)},qa),Qn("mouseup",document,j,{once:!0})}const Te=()=>{Y||x()},De=()=>{G||k()};function Ee(V){var X,ce;if(V.key==="Enter"){if(V.target===((X=t.value)===null||X===void 0?void 0:X.wrapperElRef))return;f({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((ce=t.value)===null||ce===void 0||ce.deactivate())}else if(V.key==="ArrowUp"){if(!I.value||g.keyboard.ArrowUp===!1)return;V.preventDefault(),f({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&x()}else if(V.key==="ArrowDown"){if(!O.value||g.keyboard.ArrowDown===!1)return;V.preventDefault(),f({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&k()}}function be(V){c.value=V,g.updateValueOnInput&&!g.format&&!g.parse&&g.precision===void 0&&f({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}qt(s,()=>{v()});const Se={focus:()=>{var V;return(V=t.value)===null||V===void 0?void 0:V.focus()},blur:()=>{var V;return(V=t.value)===null||V===void 0?void 0:V.blur()}},ve=ha("InputNumber",y,b);return Object.assign(Object.assign({},Se),{rtlEnabled:ve,inputInstRef:t,minusButtonInstRef:n,addButtonInstRef:a,mergedClsPrefix:b,mergedBordered:E,uncontrolledValue:r,mergedValue:s,mergedPlaceholder:u,displayedValueInvalid:N,mergedSize:l,mergedDisabled:o,displayedValue:c,addable:I,minusable:O,mergedStatus:e,handleFocus:B,handleBlur:U,handleClear:W,handleMouseDown:K,handleAddClick:Te,handleMinusClick:De,handleAddMousedown:Re,handleMinusMousedown:re,handleKeyDown:Ee,handleUpdateDisplayedValue:be,mergedTheme:D,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:we(()=>{const{self:{iconColorDisabled:V}}=D.value,[X,ce,Q,q]=ko(V);return{textColorTextDisabled:`rgb(${X}, ${ce}, ${Q})`,opacityDisabled:`${q}`}})})},render(){const{mergedClsPrefix:g,$slots:E}=this,b=()=>z(Ia,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>Zt(E["minus-icon"],()=>[z(dn,{clsPrefix:g},{default:()=>z($s,null)})])}),y=()=>z(Ia,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>Zt(E["add-icon"],()=>[z(dn,{clsPrefix:g},{default:()=>z(Vs,null)})])});return z("div",{class:[`${g}-input-number`,this.rtlEnabled&&`${g}-input-number--rtl`]},z($n,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,internalLoadingBeforeSuffix:!0},{prefix:()=>{var D;return this.showButton&&this.buttonPlacement==="both"?[b(),_t(E.prefix,A=>A?z("span",{class:`${g}-input-number-prefix`},A):null)]:(D=E.prefix)===null||D===void 0?void 0:D.call(E)},suffix:()=>{var D;return this.showButton?[_t(E.suffix,A=>A?z("span",{class:`${g}-input-number-suffix`},A):null),this.buttonPlacement==="right"?b():null,y()]:(D=E.suffix)===null||D===void 0?void 0:D.call(E)}}))}}),vc=Object.assign(Object.assign({},lt.props),{trigger:String,xScrollable:Boolean,onScroll:Function}),Cc=tt({name:"Scrollbar",props:vc,setup(){const g=Fe(null);return Object.assign(Object.assign({},{scrollTo:(...b)=>{var y;(y=g.value)===null||y===void 0||y.scrollTo(b[0],b[1])},scrollBy:(...b)=>{var y;(y=g.value)===null||y===void 0||y.scrollBy(b[0],b[1])}}),{scrollbarInstRef:g})},render(){return z(er,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),yc=Cc,Rc=xe("switch",` + height: var(--n-height); + min-width: var(--n-width); + vertical-align: middle; + user-select: none; + -webkit-user-select: none; + display: inline-flex; + outline: none; + justify-content: center; + align-items: center; +`,[ee("children-placeholder",` + height: var(--n-rail-height); + display: flex; + flex-direction: column; + overflow: hidden; + pointer-events: none; + visibility: hidden; + `),ee("rail-placeholder",` + display: flex; + flex-wrap: none; + `),ee("button-placeholder",` + width: calc(1.75 * var(--n-rail-height)); + height: var(--n-rail-height); + `),xe("base-loading",` + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + font-size: calc(var(--n-button-width) - 4px); + color: var(--n-loading-color); + transition: color .3s var(--n-bezier); + `,[ca({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),ee("checked, unchecked",` + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + box-sizing: border-box; + position: absolute; + white-space: nowrap; + top: 0; + bottom: 0; + display: flex; + align-items: center; + line-height: 1; + `),ee("checked",` + right: 0; + padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset)); + `),ee("unchecked",` + left: 0; + justify-content: flex-end; + padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset)); + `),je("&:focus",[ee("rail",` + box-shadow: var(--n-box-shadow-focus); + `)]),Ie("round",[ee("rail","border-radius: calc(var(--n-rail-height) / 2);",[ee("button","border-radius: calc(var(--n-button-height) / 2);")])]),Rt("disabled",[Rt("icon",[Ie("rubber-band",[Ie("pressed",[ee("rail",[ee("button","max-width: var(--n-button-width-pressed);")])]),ee("rail",[je("&:active",[ee("button","max-width: var(--n-button-width-pressed);")])]),Ie("active",[Ie("pressed",[ee("rail",[ee("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),ee("rail",[je("&:active",[ee("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),Ie("active",[ee("rail",[ee("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),ee("rail",` + overflow: hidden; + height: var(--n-rail-height); + min-width: var(--n-rail-width); + border-radius: var(--n-rail-border-radius); + cursor: pointer; + position: relative; + transition: + opacity .3s var(--n-bezier), + background .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + background-color: var(--n-rail-color); + `,[ee("button-icon",` + color: var(--n-icon-color); + transition: color .3s var(--n-bezier); + font-size: calc(var(--n-button-height) - 4px); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: flex; + justify-content: center; + align-items: center; + line-height: 1; + `,[ca()]),ee("button",` + align-items: center; + top: var(--n-offset); + left: var(--n-offset); + height: var(--n-button-height); + width: var(--n-button-width-pressed); + max-width: var(--n-button-width); + border-radius: var(--n-button-border-radius); + background-color: var(--n-button-color); + box-shadow: var(--n-button-box-shadow); + box-sizing: border-box; + cursor: inherit; + content: ""; + position: absolute; + transition: + background-color .3s var(--n-bezier), + left .3s var(--n-bezier), + opacity .3s var(--n-bezier), + max-width .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + `)]),Ie("active",[ee("rail","background-color: var(--n-rail-color-active);")]),Ie("loading",[ee("rail",` + cursor: wait; + `)]),Ie("disabled",[ee("rail",` + cursor: not-allowed; + opacity: .5; + `)])]),Nc=Object.assign(Object.assign({},lt.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let Mn;const Oc=tt({name:"Switch",props:Nc,setup(g){Mn===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?Mn=CSS.supports("width","max(1px)"):Mn=!1:Mn=!0);const{mergedClsPrefixRef:E,inlineThemeDisabled:b}=Xt(g),y=lt("Switch","-switch",Rc,Ec,g,E),D=ba(g),{mergedSizeRef:A,mergedDisabledRef:M}=D,l=Fe(g.defaultValue),o=Nt(g,"value"),e=Ta(o,l),t=we(()=>e.value===g.checkedValue),n=Fe(!1),a=Fe(!1),r=we(()=>{const{railStyle:f}=g;if(f)return f({focused:a.value,checked:t.value})});function i(f){const{"onUpdate:value":v,onChange:N,onUpdateValue:O}=g,{nTriggerFormInput:I,nTriggerFormChange:T}=D;v&&Ke(v,f),O&&Ke(O,f),N&&Ke(N,f),l.value=f,I(),T()}function s(){const{nTriggerFormFocus:f}=D;f()}function c(){const{nTriggerFormBlur:f}=D;f()}function _(){g.loading||M.value||(e.value!==g.checkedValue?i(g.checkedValue):i(g.uncheckedValue))}function d(){a.value=!0,s()}function u(){a.value=!1,c(),n.value=!1}function p(f){g.loading||M.value||f.key===" "&&(e.value!==g.checkedValue?i(g.checkedValue):i(g.uncheckedValue),n.value=!1)}function S(f){g.loading||M.value||f.key===" "&&(f.preventDefault(),n.value=!0)}const h=we(()=>{const{value:f}=A,{self:{opacityDisabled:v,railColor:N,railColorActive:O,buttonBoxShadow:I,buttonColor:T,boxShadowFocus:R,loadingColor:w,textColor:x,iconColor:k,[rt("buttonHeight",f)]:B,[rt("buttonWidth",f)]:U,[rt("buttonWidthPressed",f)]:F,[rt("railHeight",f)]:W,[rt("railWidth",f)]:K,[rt("railBorderRadius",f)]:G,[rt("buttonBorderRadius",f)]:Y},common:{cubicBezierEaseInOut:$}}=y.value;let te,j,re;return Mn?(te=`calc((${W} - ${B}) / 2)`,j=`max(${W}, ${B})`,re=`max(${K}, calc(${K} + ${B} - ${W}))`):(te=ea((ht(W)-ht(B))/2),j=ea(Math.max(ht(W),ht(B))),re=ht(W)>ht(B)?K:ea(ht(K)+ht(B)-ht(W))),{"--n-bezier":$,"--n-button-border-radius":Y,"--n-button-box-shadow":I,"--n-button-color":T,"--n-button-width":U,"--n-button-width-pressed":F,"--n-button-height":B,"--n-height":j,"--n-offset":te,"--n-opacity-disabled":v,"--n-rail-border-radius":G,"--n-rail-color":N,"--n-rail-color-active":O,"--n-rail-height":W,"--n-rail-width":K,"--n-width":re,"--n-box-shadow-focus":R,"--n-loading-color":w,"--n-text-color":x,"--n-icon-color":k}}),m=b?Kn("switch",we(()=>A.value[0]),h,g):void 0;return{handleClick:_,handleBlur:u,handleFocus:d,handleKeyup:p,handleKeydown:S,mergedRailStyle:r,pressed:n,mergedClsPrefix:E,mergedValue:e,checked:t,mergedDisabled:M,cssVars:b?void 0:h,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender}},render(){const{mergedClsPrefix:g,mergedDisabled:E,checked:b,mergedRailStyle:y,onRender:D,$slots:A}=this;D==null||D();const{checked:M,unchecked:l,icon:o,"checked-icon":e,"unchecked-icon":t}=A,n=!(Jn(o)&&Jn(e)&&Jn(t));return z("div",{role:"switch","aria-checked":b,class:[`${g}-switch`,this.themeClass,n&&`${g}-switch--icon`,b&&`${g}-switch--active`,E&&`${g}-switch--disabled`,this.round&&`${g}-switch--round`,this.loading&&`${g}-switch--loading`,this.pressed&&`${g}-switch--pressed`,this.rubberBand&&`${g}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},z("div",{class:`${g}-switch__rail`,"aria-hidden":"true",style:y},_t(M,a=>_t(l,r=>a||r?z("div",{"aria-hidden":!0,class:`${g}-switch__children-placeholder`},z("div",{class:`${g}-switch__rail-placeholder`},z("div",{class:`${g}-switch__button-placeholder`}),a),z("div",{class:`${g}-switch__rail-placeholder`},z("div",{class:`${g}-switch__button-placeholder`}),r)):null)),z("div",{class:`${g}-switch__button`},_t(o,a=>_t(e,r=>_t(t,i=>z(Xa,null,{default:()=>this.loading?z(Ja,{key:"loading",clsPrefix:g,strokeWidth:20}):this.checked&&(r||a)?z("div",{class:`${g}-switch__button-icon`,key:r?"checked-icon":"icon"},r||a):!this.checked&&(i||a)?z("div",{class:`${g}-switch__button-icon`,key:i?"unchecked-icon":"icon"},i||a):null})))),_t(M,a=>a&&z("div",{key:"checked",class:`${g}-switch__checked`},a)),_t(l,a=>a&&z("div",{key:"unchecked",class:`${g}-switch__unchecked`},a)))))}}),Ac={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ic=ft("path",{d:"M400 148l-21.12-24.57A191.43 191.43 0 0 0 240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 0 0 181.07-128",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Dc=ft("path",{d:"M464 97.42V208a16 16 0 0 1-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z",fill:"currentColor"},null,-1),wc=[Ic,Dc],xc=tt({name:"ReloadOutline",render:function(E,b){return Xe(),ct("svg",Ac,wc)}}),Mc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},kc=ft("path",{d:"M380.93 57.37A32 32 0 0 0 358.3 48H94.22A46.21 46.21 0 0 0 48 94.22v323.56A46.21 46.21 0 0 0 94.22 464h323.56A46.36 46.36 0 0 0 464 417.78V153.7a32 32 0 0 0-9.37-22.63zM256 416a64 64 0 1 1 64-64a63.92 63.92 0 0 1-64 64zm48-224H112a16 16 0 0 1-16-16v-64a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16v64a16 16 0 0 1-16 16z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Lc=[kc],Pc=tt({name:"SaveOutline",render:function(E,b){return Xe(),ct("svg",Mc,Lc)}});var lr={exports:{}};const Fc=sl(Fo);(function(g,E){(function(b,y){g.exports=y(Fc)})(typeof self<"u"?self:il,function(b){return(()=>{var y={7679:function(l,o){var e,t,n;(function(a,r){t=[],e=r,n=typeof e=="function"?e.apply(o,t):e,n===void 0||(l.exports=n)})(typeof self<"u"&&self,function(){function a(){var r=Object.getOwnPropertyDescriptor(document,"currentScript");if(!r&&"currentScript"in document&&document.currentScript||r&&r.get!==a&&document.currentScript)return document.currentScript;try{throw new Error}catch(v){var i,s,c,_=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,d=/@([^@]*):(\d+):(\d+)\s*$/gi,u=_.exec(v.stack)||d.exec(v.stack),p=u&&u[1]||!1,S=u&&u[2]||!1,h=document.location.href.replace(document.location.hash,""),m=document.getElementsByTagName("script");p===h&&(i=document.documentElement.outerHTML,s=new RegExp("(?:[^\\n]+?\\n){0,"+(S-2)+"}[^<]* + + + +
+ + + diff --git a/framework/platforms/http_service.py b/framework/platforms/http_service.py index 5c7d9980..6ffe4095 100644 --- a/framework/platforms/http_service.py +++ b/framework/platforms/http_service.py @@ -2,6 +2,7 @@ import json import typing import random +import os.path from functools import wraps import asyncio @@ -9,7 +10,7 @@ import contextlib from graia.ariadne.message.chain import MessageChain from graia.ariadne.message.element import Plain -from quart import Quart, request, make_response, jsonify +from quart import Quart, request, make_response, jsonify, send_from_directory, safe_join from werkzeug.security import generate_password_hash, check_password_hash import constants @@ -42,6 +43,8 @@ jwt_secret_key = hashlib.sha256(constants.config.http.password.encode('utf-8')).digest() +webui_static = safe_join(os.path.dirname(os.path.pardir), 'assets/webui') + def generate_token(): """生成 JWT 令牌""" @@ -84,12 +87,19 @@ async def login(): # 防止暴力破解,限制登录尝试次数 ip = request.remote_addr + now = time.monotonic() if ip in login_attempts: - wait_time = min(2 ** login_attempts[ip], 3600) - seconds_since_last_attempt = int(time.time() - login_attempts[ip]) - remaining_wait_time = wait_time - seconds_since_last_attempt - if remaining_wait_time > 0: - return jsonify({"error": f"登录失败次数过多,请在 {remaining_wait_time} 秒后重试"}), 429 + failed_attempts, last_attempt_time = login_attempts[ip] + if failed_attempts >= 6: + wait_time = 600 # set wait time to 10 minutes + seconds_since_last_attempt = int(now - last_attempt_time) + remaining_wait_time = wait_time - seconds_since_last_attempt + if remaining_wait_time > 0: + return jsonify({"error": f"登录失败次数过多,请在 {remaining_wait_time} 秒后重试"}), 429 + else: + login_attempts[ip] = (failed_attempts + 1, now) + else: + login_attempts[ip] = (1, now) password_hash = constants.config.http.password # 检查密码 @@ -99,10 +109,8 @@ async def login(): return jsonify({"token": token}), 200 # 如果认证失败,则增加登录尝试次数并返回错误响应 - if ip in login_attempts: - login_attempts[ip] += 1 - else: - login_attempts[ip] = 1 + login_attempts[ip] = login_attempts.get(ip, (0, 0)) + login_attempts[ip] = (login_attempts[ip][0] + 1, now) return jsonify({"error": "密码不正确"}), 401 @app.get('/backend-api/v1/config') @@ -257,3 +265,13 @@ async def send_events(): ) response.timeout = None return response + + @app.route('/') + async def _home(): + return await send_from_directory(webui_static, 'index.html') + + @app.route('/') + async def _static(path): + if os.path.isdir(safe_join(webui_static, path)): + path = os.path.join(path, 'index.html') + return await send_from_directory(webui_static, path)