From d00c78e88cd1efb8034c0a84db28c076e74ff45a Mon Sep 17 00:00:00 2001
From: lss233 <8984680+lss233@users.noreply.github.com>
Date: Tue, 16 May 2023 00:29:58 +0800
Subject: [PATCH] feat(http-api): support password changing
---
assets/webui/assets/AboutView.css | 1 +
assets/webui/assets/AboutView.js | 1 +
assets/webui/assets/AccountConfigView.css | 1 +
assets/webui/assets/AccountConfigView.js | 1 +
assets/webui/assets/ConfigurationList.css | 1 +
assets/webui/assets/ConfigurationList.js | 552 ++++++++++++++
.../{LoginView-69f14d49.css => LoginView.css} | 0
assets/webui/assets/LoginView.js | 1 +
assets/webui/assets/PlatformConfigView.css | 1 +
assets/webui/assets/PlatformConfigView.js | 1 +
assets/webui/assets/UtilitiesConfigView.css | 1 +
assets/webui/assets/UtilitiesConfigView.js | 1 +
assets/webui/assets/cryptojs.js | 14 +
.../assets/{index-60c2ab7f.css => index.css} | 0
assets/webui/assets/index.js | 685 ++++++++++++++++++
assets/webui/assets/use-message.js | 1 +
assets/webui/index.html | 4 +-
config.py | 25 +-
framework/platforms/http_service.py | 9 +-
19 files changed, 1276 insertions(+), 24 deletions(-)
create mode 100644 assets/webui/assets/AboutView.css
create mode 100644 assets/webui/assets/AboutView.js
create mode 100644 assets/webui/assets/AccountConfigView.css
create mode 100644 assets/webui/assets/AccountConfigView.js
create mode 100644 assets/webui/assets/ConfigurationList.css
create mode 100644 assets/webui/assets/ConfigurationList.js
rename assets/webui/assets/{LoginView-69f14d49.css => LoginView.css} (100%)
create mode 100644 assets/webui/assets/LoginView.js
create mode 100644 assets/webui/assets/PlatformConfigView.css
create mode 100644 assets/webui/assets/PlatformConfigView.js
create mode 100644 assets/webui/assets/UtilitiesConfigView.css
create mode 100644 assets/webui/assets/UtilitiesConfigView.js
create mode 100644 assets/webui/assets/cryptojs.js
rename assets/webui/assets/{index-60c2ab7f.css => index.css} (100%)
create mode 100644 assets/webui/assets/index.js
create mode 100644 assets/webui/assets/use-message.js
diff --git a/assets/webui/assets/AboutView.css b/assets/webui/assets/AboutView.css
new file mode 100644
index 00000000..736bd8c0
--- /dev/null
+++ b/assets/webui/assets/AboutView.css
@@ -0,0 +1 @@
+.wrapper[data-v-ec33436b]{display:flex;justify-content:center;align-items:center;height:100vh}.container[data-v-ec33436b]{justify-content:center;align-items:center;flex-direction:column;text-align:center}
diff --git a/assets/webui/assets/AboutView.js b/assets/webui/assets/AboutView.js
new file mode 100644
index 00000000..6a373653
--- /dev/null
+++ b/assets/webui/assets/AboutView.js
@@ -0,0 +1 @@
+import{_ as o,o as c,c as s,x as a,y as _,a as e}from"./index.js";const n={},r=t=>(a("data-v-ec33436b"),t=t(),_(),t),p={class:"wrapper"},i=r(()=>e("div",{class:"container"},[e("h1",null,"We're working in progress"),e("h2",null,"当前页面仍在施工中,请在左侧菜单选择其他页面。"),e("p",null,[e("a",{href:"https://github.com/DarkSkyTeam/chatgpt-for-bot-webui",target:"_blank"},"GitHub")])],-1)),d=[i];function l(t,u){return c(),s("div",p,d)}const b=o(n,[["render",l],["__scopeId","data-v-ec33436b"]]);export{b as default};
diff --git a/assets/webui/assets/AccountConfigView.css b/assets/webui/assets/AccountConfigView.css
new file mode 100644
index 00000000..e2fb47fe
--- /dev/null
+++ b/assets/webui/assets/AccountConfigView.css
@@ -0,0 +1 @@
+.sub-content-wrapper[data-v-d283c043]{display:flex;flex-grow:1;height:100%}.sidebar-wrapper[data-v-d283c043]{width:256px;background-color:var(--vt-c-gray)}.sub-main-content-wrapper[data-v-d283c043]{flex-grow:1}.account-remark[data-v-d283c043]{font-weight:500}.account-status[data-v-d283c043]{font-size:.9em}
diff --git a/assets/webui/assets/AccountConfigView.js b/assets/webui/assets/AccountConfigView.js
new file mode 100644
index 00000000..1d360468
--- /dev/null
+++ b/assets/webui/assets/AccountConfigView.js
@@ -0,0 +1 @@
+import{C as j,N as I}from"./ConfigurationList.js";import{i as z,j as L,k as O,d as b,o as s,c as r,a as o,l as P,r as k,F as A,m as S,f as u,n as v,b as q,u as D,t as $,p as h,N as M,q as V,s as R,x as F,y as H,z as G,_ as J}from"./index.js";import{a as K,u as U}from"./use-message.js";import"./cryptojs.js";function Q(){const i=z(O,null);return i===null&&L("use-dialog","No outer founded."),i}const W={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},X=o("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),Y=o("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),Z=o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M88 176v112"},null,-1),ee=o("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),oe=[X,Y,Z,ee],te=b({name:"PersonAddOutline",render:function(d,a){return s(),r("svg",W,oe)}}),ne={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},se=P('',6),re=[se],ae=b({name:"TrashOutline",render:function(d,a){return s(),r("svg",ne,re)}}),ie=i=>(F("data-v-d283c043"),i=i(),H(),i),ce={class:"sub-content-wrapper"},le={class:"sidebar-wrapper"},ue=ie(()=>o("div",{class:"sidebar-title"},[o("p",null,"账号管理")],-1)),de={class:"sidebar"},pe={class:"sidebar-nav"},he={class:"sidebar-nav-item"},ve={class:"sidebar-nav-text"},_e={class:"sidebar-nav-child"},ke=["onClick"],fe={class:"account-remark"},ge={key:0,class:"account-status",style:{color:"mediumseagreen"}},we={key:1,class:"account-status",style:{color:"brown"}},me={key:0,class:"sub-main-content-wrapper"},Ce={key:1,class:"sub-main-content-wrapper"},be=b({__name:"AccountConfigView",setup(i){D();const d=K(),a=U(),N=Q(),c=k(-1),l=k("chatgpt-web"),m=k([]),f=k({}),p=k(null);async function x(){const t=await(await fetch("/backend-api/v1/accounts/model?key="+l.value)).json();delete t.properties.ok,m.value=[t]}async function C(){var _;const t=await(await fetch("/backend-api/v1/accounts/list")).json();f.value=t;const e=G();(_=e==null?void 0:e.proxy)==null||_.$forceUpdate()}function B(n,t){l.value=n,c.value=t,g()}function g(){a.start(),x().then(()=>p.value?(p.value={},Promise.resolve()):C()).then(()=>{a.finish()}).catch(n=>{d.error("配置读取失败!"),console.error(n),a.error()})}function y(n){a.start();const t="/backend-api/v1/accounts/"+l.value+(p.value?"":"/"+c.value);fetch(t,{method:"POST",body:JSON.stringify(n),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(e=>{if(e.ok)return d.success("配置保存成功!"),a.finish(),e.json();throw new Error("Something went wrong.")}).then(C).catch(e=>{d.error("配置保存失败!"),a.error()})}function T(n){c.value=-1,p.value={},l.value=n,x()}function E(n,t){N.warning({title:"删除账号",content:"你确定要删除这个账号吗?希望你不是点错了。",positiveText:"很确定",negativeText:"点错了",onPositiveClick:()=>{c.value=-1,p.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 d.success("账号已删除"),a.finish(),e.json();throw new Error("Something went wrong.")}).then(C).catch(e=>{d.error("账号删除失败"),a.error()})}})}return g(),(n,t)=>(s(),r("div",ce,[o("div",le,[ue,o("div",de,[o("ul",pe,[(s(!0),r(A,null,S(Object.keys(f.value),e=>(s(),r("li",{key:e},[o("div",he,[o("div",ve,$(e),1),u(h(I),{class:"sidebar-nav-action"},{default:v(()=>[u(h(M),{quaternary:"",size:"tiny",onClick:_=>T(e)},{icon:v(()=>[u(h(V),null,{default:v(()=>[u(h(te))]),_:1})]),_:2},1032,["onClick"])]),_:2},1024)]),o("ul",_e,[(s(!0),r(A,null,S(f.value[e],(_,w)=>(s(),r("li",{class:R({"sidebar-nav-sub-item":!0,"sidebar-nav-sub-item-active":c.value==w&&l.value==e}),onClick:xe=>B(e,w),key:w},[o("div",null,[o("p",fe,"账号 "+$(w+1),1),_.ok?(s(),r("p",ge,"可用")):(s(),r("p",we,"不可用"))])],10,ke))),128))])]))),128))])])]),c.value>=0?(s(),r("div",me,[u(j,{title:"修改账号","configuration-groups":m.value,configurationValue:f.value[l.value][c.value],onSave:y,onReset:g},{tools:v(()=>[u(h(M),{quaternary:"",onClick:t[0]||(t[0]=e=>E(l.value,c.value))},{icon:v(()=>[u(h(V),null,{default:v(()=>[u(h(ae))]),_:1})]),_:1})]),_:1},8,["configuration-groups","configurationValue"])])):p.value?(s(),r("div",Ce,[u(j,{title:"添加账号:"+l.value,"configuration-groups":m.value,configurationValue:p.value,onSave:y,onReset:g},null,8,["title","configuration-groups","configurationValue"])])):q("",!0)]))}});const $e=J(be,[["__scopeId","data-v-d283c043"]]);export{$e as default};
diff --git a/assets/webui/assets/ConfigurationList.css b/assets/webui/assets/ConfigurationList.css
new file mode 100644
index 00000000..e03a642f
--- /dev/null
+++ b/assets/webui/assets/ConfigurationList.css
@@ -0,0 +1 @@
+.topbar[data-v-268c7ca8]{background-color:var(--vt-c-white-mute);color:#111;height:50px;display:flex;justify-content:space-between;align-items:center;padding:0 20px}ul[data-v-268c7ca8]{list-style:none;display:flex}li[data-v-268c7ca8]{margin-right:20px}a[data-v-268c7ca8]{color:#111;text-decoration:none}a[data-v-268c7ca8]:hover{text-decoration:underline}
diff --git a/assets/webui/assets/ConfigurationList.js b/assets/webui/assets/ConfigurationList.js
new file mode 100644
index 00000000..ddff90b4
--- /dev/null
+++ b/assets/webui/assets/ConfigurationList.js
@@ -0,0 +1,552 @@
+import{g as _r,c as dr,a as ur,C as zn}from"./cryptojs.js";import{C as pr,D as mr,E as gr,F as St,K as Er,R as Sr,G as fr,H as br,T as hr,I as Tr,J as $a,L as vr,V as Cr,M as yr,O as Rr,P as Nr,Q as Or,U as Ar,W as Ir,X as Dr,Y as we,Z as wr,$ as xt,b as la,c as ct,a as ft,a0 as xr,a1 as Mr,a2 as kr,a3 as Lr,a4 as Pr,l as Fr,a5 as Mt,f as qe,a6 as Ur,a7 as Br,d as tt,a8 as Gr,a9 as Yr,aa as qr,ab as Vr,ac as zr,ad as Hr,ae as $r,af as Wr,z as Sa,ag as jr,ah as Qr,ai as Kr,aj as z,ak as Zr,al as Xr,am as Jr,an as ei,i as zt,ao as ti,ap as ni,aq as ai,ar as ri,as as ii,at as oi,au as si,av as li,aw as ci,ax as _i,ay as di,az as Qn,s as ui,aA as pi,aB as mi,aC as gi,aD as Ei,aE as Wa,aF as Si,aG as fi,aH as bi,aI as fa,aJ as hi,aK as Ti,aL as vi,aM as Ci,aN as yi,aO as Ri,o as Ze,y as Ni,aP as Fn,aQ as Oi,x as Ai,aR as Ii,aS as Di,aT as wi,r as Fe,aU as xi,aV as Mi,m as cn,aW as ja,h as ki,aX as Li,aY as Pi,aZ as Fi,a_ as Ui,a$ as Bi,b0 as Gi,b1 as Yi,b2 as qi,b3 as Vi,b4 as zi,b5 as Hi,b6 as $i,b7 as Wi,t as _n,b8 as ji,b9 as Qi,ba as Ki,bb as Nt,bc as Zi,bd as Xi,be as Ji,p as xe,bf as eo,bg as to,bh as no,bi as ao,bj as ro,bk as io,bl as oo,bm as so,bn as lo,bo as co,v as _o,bp as uo,bq as po,br as mo,bs as Vt,bt as ca,bu as go,bv as Eo,bw as So,n as He,bx as fo,w as bo,by as ho,bz as To,e as vo,bA as Co,bB as Qa,bC as Ka,bD as Za,bE as yo,bF as Ro,bG as No,bH as Me,bI as je,bJ as ee,bK as _a,bL as Xa,bM as Ja,bN as Zt,bO as dn,bP as er,bQ as Bn,bR as Wn,bS as ba,bT as Oo,bU as Ie,bV as Rt,bW as Xt,bX as lt,bY as Ao,bZ as ha,b_ as kt,b$ as Ta,c0 as Zn,c1 as _t,c2 as tr,c3 as Io,c4 as Kn,c5 as rt,c6 as Do,c7 as Ke,c8 as Na,c9 as wo,ca as xo,cb as Mo,cc as ht,cd as Oa,ce as Jn,cf as ko,cg as Aa,ch as Lo,ci as Ia,cj as Po,ck as Fo,cl as Uo,cm as Da,cn as ea,co as ta,N as Yt,q as wa,_ as Bo}from"./index.js";const Go=()=>{},Yo=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:pr,Comment:mr,EffectScope:gr,Fragment:St,KeepAlive:Er,ReactiveEffect:Sr,Static:fr,Suspense:br,Teleport:hr,Text:Tr,Transition:$a,TransitionGroup:vr,VueElement:Cr,assertNumber:yr,callWithAsyncErrorHandling:Rr,callWithErrorHandling:Nr,camelize:Or,capitalize:Ar,cloneVNode:Ir,compatUtils:Dr,compile:Go,computed:we,createApp:wr,createBlock:xt,createCommentVNode:la,createElementBlock:ct,createElementVNode:ft,createHydrationRenderer:xr,createPropsRestProxy:Mr,createRenderer:kr,createSSRApp:Lr,createSlots:Pr,createStaticVNode:Fr,createTextVNode:Mt,createVNode:qe,customRef:Ur,defineAsyncComponent:Br,defineComponent:tt,defineCustomElement:Gr,defineEmits:Yr,defineExpose:qr,defineProps:Vr,defineSSRCustomElement:zr,get devtools(){return Hr},effect:$r,effectScope:Wr,getCurrentInstance:Sa,getCurrentScope:jr,getTransitionRawChildren:Qr,guardReactiveProps:Kr,h:z,handleError:Zr,hydrate:Xr,initCustomFormatter:Jr,initDirectivesForSSR:ei,inject:zt,isMemoSame:ti,isProxy:ni,isReactive:ai,isReadonly:ri,isRef:ii,isRuntimeOnly:oi,isShallow:si,isVNode:li,markRaw:ci,mergeDefaults:_i,mergeProps:di,nextTick:Qn,normalizeClass:ui,normalizeProps:pi,normalizeStyle:mi,onActivated:gi,onBeforeMount:Ei,onBeforeUnmount:Wa,onBeforeUpdate:Si,onDeactivated:fi,onErrorCaptured:bi,onMounted:fa,onRenderTracked:hi,onRenderTriggered:Ti,onScopeDispose:vi,onServerPrefetch:Ci,onUnmounted:yi,onUpdated:Ri,openBlock:Ze,popScopeId:Ni,provide:Fn,proxyRefs:Oi,pushScopeId:Ai,queuePostFlushCb:Ii,reactive:Di,readonly:wi,ref:Fe,registerRuntimeCompiler:xi,render:Mi,renderList:cn,renderSlot:ja,resolveComponent:ki,resolveDirective:Li,resolveDynamicComponent:Pi,resolveFilter:Fi,resolveTransitionHooks:Ui,setBlockTracking:Bi,setDevtoolsHook:Gi,setTransitionHooks:Yi,shallowReactive:qi,shallowReadonly:Vi,shallowRef:zi,ssrContextKey:Hi,ssrUtils:$i,stop:Wi,toDisplayString:_n,toHandlerKey:ji,toHandlers:Qi,toRaw:Ki,toRef:Nt,toRefs:Zi,transformVNodeArgs:Xi,triggerRef:Ji,unref:xe,useAttrs:eo,useCssModule:to,useCssVars:no,useSSRContext:ao,useSlots:ro,useTransitionState:io,vModelCheckbox:oo,vModelDynamic:so,vModelRadio:lo,vModelSelect:co,vModelText:_o,vShow:uo,version:po,warn:mo,watch:Vt,watchEffect:ca,watchPostEffect:go,watchSyncEffect:Eo,withAsyncContext:So,withCtx:He,withDefaults:fo,withDirectives:bo,withKeys:ho,withMemo:To,withModifiers:vo,withScopeId:Co},Symbol.toStringTag,{value:"Module"}));function qo(g,E="default",b=[]){const x=g.$slots[E];return x===void 0?b:x()}function Vo(g,E,b){var y;const x=zt(g,null);if(x===null)return;const A=(y=Sa())===null||y===void 0?void 0:y.proxy;Vt(b,M),M(b.value),Wa(()=>{M(void 0,b.value)});function M(e,t){const n=x[E];t!==void 0&&l(n,t),e!==void 0&&s(n,e)}function l(e,t){e[t]||(e[t]=[]),e[t].splice(e[t].findIndex(n=>n===A),1)}function s(e,t){e[t]||(e[t]=[]),~e[t].findIndex(n=>n===A)||e[t].push(A)}}function va(g,E){return Vt(g,b=>{b!==void 0&&(E.value=b)}),we(()=>g.value===void 0?E.value:g.value)}var zo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ho=/^\w*$/;function $o(g,E){if(Qa(g))return!1;var b=typeof g;return b=="number"||b=="symbol"||b=="boolean"||g==null||Ka(g)?!0:Ho.test(g)||!zo.test(g)||E!=null&&g in Object(E)}var Wo="Expected a function";function Ca(g,E){if(typeof g!="function"||E!=null&&typeof E!="function")throw new TypeError(Wo);var b=function(){var y=arguments,x=E?E.apply(this,y):y[0],A=b.cache;if(A.has(x))return A.get(x);var M=g.apply(this,y);return b.cache=A.set(x,M)||A,M};return b.cache=new(Ca.Cache||Za),b}Ca.Cache=Za;var jo=500;function Qo(g){var E=Ca(g,function(y){return b.size===jo&&b.clear(),y}),b=E.cache;return E}var Ko=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zo=/\\(\\)?/g,Xo=Qo(function(g){var E=[];return g.charCodeAt(0)===46&&E.push(""),g.replace(Ko,function(b,y,x,A){E.push(x?A.replace(Zo,"$1"):y||b)}),E});const Jo=Xo;function es(g,E){return Qa(g)?g:$o(g,E)?[g]:Jo(yo(g))}var ts=1/0;function ns(g){if(typeof g=="string"||Ka(g))return g;var E=g+"";return E=="0"&&1/g==-ts?"-0":E}function as(g,E){E=es(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"}},is=rs;function na(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",x;if(y==="formatting"&&g.formattingValues){var A=g.defaultFormattingWidth||g.defaultWidth,M=b!=null&&b.width?String(b.width):A;x=g.formattingValues[M]||g.formattingValues[A]}else{var l=g.defaultWidth,s=b!=null&&b.width?String(b.width):g.defaultWidth;x=g.values[s]||g.values[l]}var e=g.argumentCallback?g.argumentCallback(E):E;return x[e]}}function xn(g){return function(E){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=b.width,x=y&&g.matchPatterns[y]||g.matchPatterns[g.defaultMatchWidth],A=E.match(x);if(!A)return null;var M=A[0],l=y&&g.parsePatterns[y]||g.parsePatterns[g.defaultParseWidth],s=Array.isArray(l)?ss(l,function(n){return n.test(M)}):os(l,function(n){return n.test(M)}),e;e=g.valueCallback?g.valueCallback(s):s,e=b.valueCallback?b.valueCallback(e):e;var t=E.slice(M.length);return{value:e,rest:t}}}function os(g,E){for(var b in g)if(g.hasOwnProperty(b)&&E(g[b]))return b}function ss(g,E){for(var b=0;b1&&arguments[1]!==void 0?arguments[1]:{},y=E.match(g.matchPattern);if(!y)return null;var x=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(x.length);return{value:M,rest:l}}}var cs={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"}},_s=function(E,b,y){var x,A=cs[E];return typeof A=="string"?x=A:b===1?x=A.one:x=A.other.replace("{{count}}",b.toString()),y!=null&&y.addSuffix?y.comparison&&y.comparison>0?"in "+x:x+" ago":x};const ds=_s;var us={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ps={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ms={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gs={date:na({formats:us,defaultWidth:"full"}),time:na({formats:ps,defaultWidth:"full"}),dateTime:na({formats:ms,defaultWidth:"full"})};const Es=gs;var Ss={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fs=function(E,b,y,x){return Ss[E]};const bs=fs;var hs={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ts={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vs={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"]},Cs={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"]},ys={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"}},Rs={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"}},Ns=function(E,b){var y=Number(E),x=y%100;if(x>20||x<10)switch(x%10){case 1:return y+"st";case 2:return y+"nd";case 3:return y+"rd"}return y+"th"},Os={ordinalNumber:Ns,era:wn({values:hs,defaultWidth:"wide"}),quarter:wn({values:Ts,defaultWidth:"wide",argumentCallback:function(E){return E-1}}),month:wn({values:vs,defaultWidth:"wide"}),day:wn({values:Cs,defaultWidth:"wide"}),dayPeriod:wn({values:ys,defaultWidth:"wide",formattingValues:Rs,defaultFormattingWidth:"wide"})};const As=Os;var Is=/^(\d+)(th|st|nd|rd)?/i,Ds=/\d+/i,ws={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},xs={any:[/^b/i,/^(a|c)/i]},Ms={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ks={any:[/1/i,/2/i,/3/i,/4/i]},Ls={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},Ps={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]},Fs={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},Us={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]},Bs={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},Gs={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}},Ys={ordinalNumber:ls({matchPattern:Is,parsePattern:Ds,valueCallback:function(E){return parseInt(E,10)}}),era:xn({matchPatterns:ws,defaultMatchWidth:"wide",parsePatterns:xs,defaultParseWidth:"any"}),quarter:xn({matchPatterns:Ms,defaultMatchWidth:"wide",parsePatterns:ks,defaultParseWidth:"any",valueCallback:function(E){return E+1}}),month:xn({matchPatterns:Ls,defaultMatchWidth:"wide",parsePatterns:Ps,defaultParseWidth:"any"}),day:xn({matchPatterns:Fs,defaultMatchWidth:"wide",parsePatterns:Us,defaultParseWidth:"any"}),dayPeriod:xn({matchPatterns:Bs,defaultMatchWidth:"any",parsePatterns:Gs,defaultParseWidth:"any"})};const qs=Ys;var Vs={code:"en-US",formatDistance:ds,formatLong:Es,formatRelative:bs,localize:As,match:qs,options:{weekStartsOn:0,firstWeekContainsDate:1}};const zs=Vs,Hs={name:"en-US",locale:zs},$s=Hs;function ar(g){const{mergedLocaleRef:E,mergedDateLocaleRef:b}=zt(Ro,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:is[g]});return{dateLocaleRef:we(()=>{var A;return(A=b==null?void 0:b.value)!==null&&A!==void 0?A:$s}),localeRef:y}}const Ws=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"}))}}),js=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"}))}}),Qs=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"}))}}),Ks=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;
+ `}))}}),Zs=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"}))}}),Xs=No("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"}))))),Js=Me("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%);
+ `,[_a({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),da=tt({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(g){return Xa("-base-clear",Js,Nt(g,"clsPrefix")),{handleMouseDown(E){E.preventDefault()}}},render(){const{clsPrefix:g}=this;return z("div",{class:`${g}-base-clear`},z(Ja,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(Xs,null)})])):z("div",{key:"icon",class:`${g}-base-clear__placeholder`},(b=(E=this.$slots).placeholder)===null||b===void 0?void 0:b.call(E))}}))}}),el=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(er,{clsPrefix:b,class:`${b}-base-suffix`,strokeWidth:24,scale:.85,show:g.loading},{default:()=>g.showArrow?z(da,{clsPrefix:b,show:g.showClear,onClear:g.onClear},{placeholder:()=>z(dn,{clsPrefix:b,class:`${b}-base-suffix__arrow`},{default:()=>Zt(E.default,()=>[z(Zs,null)])})}):null})}}}),tl={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},nl=g=>{const{textColor2:E,textColor3:b,textColorDisabled:y,primaryColor:x,primaryColorHover:A,inputColor:M,inputColorDisabled:l,borderColor:s,warningColor:e,warningColorHover:t,errorColor:n,errorColorHover:a,borderRadius:r,lineHeight:i,fontSizeTiny:o,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:D,iconColorPressed:w}=g;return Object.assign(Object.assign({},tl),{countTextColorDisabled:y,countTextColor:b,heightTiny:u,heightSmall:p,heightMedium:S,heightLarge:h,fontSizeTiny:o,fontSizeSmall:c,fontSizeMedium:_,fontSizeLarge:d,lineHeight:i,lineHeightTextarea:i,borderRadius:r,iconSize:"16px",groupLabelColor:m,groupLabelTextColor:E,textColor:E,textColorDisabled:y,textDecorationColor:E,caretColor:x,placeholderColor:O,placeholderColorDisabled:I,color:M,colorDisabled:l,colorFocus:M,groupLabelBorder:`1px solid ${s}`,border:`1px solid ${s}`,borderHover:`1px solid ${A}`,borderDisabled:`1px solid ${s}`,borderFocus:`1px solid ${A}`,boxShadowFocus:`0 0 0 2px ${Wn(x,{alpha:.2})}`,loadingColor:x,loadingColorWarning:e,borderWarning:`1px solid ${e}`,borderHoverWarning:`1px solid ${t}`,colorFocusWarning:M,borderFocusWarning:`1px solid ${t}`,boxShadowFocusWarning:`0 0 0 2px ${Wn(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 ${Wn(n,{alpha:.2})}`,caretColorError:n,clearColor:f,clearColorHover:v,clearColorPressed:N,iconColor:T,iconColorDisabled:R,iconColorHover:D,iconColorPressed:w,suffixTextColor:E})},al={name:"Input",common:Bn,self:nl},rr=al,ir=ba("n-input");function rl(g){let E=0;for(const b of g)E++;return E}function Hn(g){return g===""||g==null}function il(g){const E=Fe(null);function b(){const{value:A}=g;if(!(A!=null&&A.focus)){x();return}const{selectionStart:M,selectionEnd:l,value:s}=A;if(M==null||l==null){x();return}E.value={start:M,end:l,beforeText:s.slice(0,M),afterText:s.slice(l)}}function y(){var A;const{value:M}=E,{value:l}=g;if(!M||!l)return;const{value:s}=l,{start:e,beforeText:t,afterText:n}=M;let a=s.length;if(s.endsWith(n))a=s.length-n.length;else if(s.startsWith(t))a=t.length;else{const r=t[e-1],i=s.indexOf(r,e-1);i!==-1&&(a=i+1)}(A=l.setSelectionRange)===null||A===void 0||A.call(l,a,a)}function x(){E.value=null}return Vt(g,x),{recordCursor:b,restoreCursor:y}}const xa=tt({name:"InputWordCount",setup(g,{slots:E}){const{mergedValueRef:b,maxlengthRef:y,mergedClsPrefixRef:x,countGraphemesRef:A}=zt(ir),M=we(()=>{const{value:l}=b;return l===null||Array.isArray(l)?0:(A.value||rl)(l)});return()=>{const{value:l}=y,{value:s}=b;return z("span",{class:`${x.value}-input-word-count`},Oo(E.default,{value:s===null||Array.isArray(s)?"":s},()=>[l===void 0?M.value:`${M.value} / ${l}`]))}}}),ol=Me("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%;
+ `)]),Me("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%;",[Me("input-word-count",`
+ position: absolute;
+ right: var(--n-padding-right);
+ bottom: var(--n-padding-vertical);
+ `),Ie("resizable",[Me("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;
+ `,[Me("icon",`
+ color: var(--n-icon-color);
+ `),Me("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);",[Me("icon",`
+ color: var(--n-icon-color-disabled);
+ `),Me("base-icon",`
+ color: var(--n-icon-color-disabled);
+ `)]),Me("input-word-count",`
+ color: var(--n-count-text-color-disabled);
+ `),ee("suffix, prefix","color: var(--n-text-color-disabled);",[Me("icon",`
+ color: var(--n-icon-color-disabled);
+ `),Me("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);
+ `,[Me("base-loading",`
+ font-size: var(--n-icon-size);
+ margin: 0 2px;
+ color: var(--n-loading-color);
+ `),Me("base-clear",`
+ font-size: var(--n-icon-size);
+ `,[ee("placeholder",[Me("base-icon",`
+ transition: color .3s var(--n-bezier);
+ color: var(--n-icon-color);
+ font-size: var(--n-icon-size);
+ `)])]),je(">",[Me("icon",`
+ transition: color .3s var(--n-bezier);
+ color: var(--n-icon-color);
+ font-size: var(--n-icon-size);
+ `)]),Me("base-icon",`
+ font-size: var(--n-icon-size);
+ `)]),Me("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",[Me("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});
+ `)])])]))]),sl=Me("input",[Ie("disabled",[ee("input-el, textarea-el",`
+ -webkit-text-fill-color: var(--n-text-color-disabled);
+ `)])]),ll=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}),kn=tt({name:"Input",props:ll,setup(g){const{mergedClsPrefixRef:E,mergedBorderedRef:b,inlineThemeDisabled:y,mergedRtlRef:x}=Xt(g),A=lt("Input","-input",ol,rr,g,E);Ao&&Xa("-input-safari",sl,E);const M=Fe(null),l=Fe(null),s=Fe(null),e=Fe(null),t=Fe(null),n=Fe(null),a=Fe(null),r=il(a),i=Fe(null),{localeRef:o}=ar("Input"),c=Fe(g.defaultValue),_=Nt(g,"value"),d=va(_,c),u=ha(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?[o.value.placeholder]:[L]}),T=we(()=>{const{value:L}=v,{value:C}=d,{value:P}=I;return!L&&(Hn(C)||Array.isArray(C)&&Hn(C[0]))&&P[0]}),R=we(()=>{const{value:L}=v,{value:C}=d,{value:P}=I;return!L&&P[1]&&(Hn(C)||Array.isArray(C)&&Hn(C[1]))}),D=kt(()=>g.internalForceFocus||m.value),w=kt(()=>{if(S.value||g.readonly||!g.clearable||!D.value&&!f.value)return!1;const{value:L}=d,{value:C}=D;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}=s;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)});fa(()=>{const{value:L}=d;Array.isArray(L)||Tt(L)});const G=Sa().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||Qn(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(),Na("mouseup",document,C)};if(Kn("mouseup",document,C),k.value!=="mousedown")return;B.value=!0;const P=()=>{B.value=!1,Na("mouseup",document,P)};Kn("mouseup",document,P)}function Xe(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,Qn(()=>{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 Ht(){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}=s;oe&&(oe.textContent=(L??"")+`\r
+`)}else{const{value:oe}=e;oe&&(L?oe.textContent=L:oe.innerHTML=" ")}}function At(){W()}const Lt=Fe({top:"0"});function un(L){var C;const{scrollTop:P}=L.target;Lt.value.top=`${-P}px`,(C=i.value)===null||C===void 0||C.syncUnifiedContainer()}let Pt=null;ca(()=>{const{autosize:L,type:C}=g;L&&C==="textarea"?Pt=Vt(d,P=>{!Array.isArray(P)&&P!==O&&Tt(P)}):Pt==null||Pt()});let vt=null;ca(()=>{g.type==="textarea"?vt=Vt(d,L=>{var C;!Array.isArray(L)&&L!==O&&((C=i.value)===null||C===void 0||C.syncUnifiedContainer())}):vt==null||vt()}),Fn(ir,{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:Ht,activate:Ot,scrollTo:Ge},en=Ta("Input",x,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:$t,placeholderColorDisabled:Wt,lineHeightTextarea:pn,colorDisabled:jt,colorFocus:mn,textColorDisabled:gn,boxShadowFocus:En,iconSize:nn,colorFocusWarning:Ft,boxShadowFocusWarning:Sn,borderWarning:fn,borderFocusWarning:bn,borderHoverWarning:hn,colorFocusError:mt,boxShadowFocusError:an,borderError:rn,borderFocusError:Tn,borderHoverError:vn,clearSize:Ut,clearColor:Cn,clearColorHover:Z,clearColorPressed:pe,iconColor:Ae,iconColorDisabled:Be,suffixTextColor:Qe,countTextColor:st,countTextColorDisabled:gt,iconColorHover:Bt,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:Gt}=Do(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":Gt,"--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":$t,"--n-placeholder-color-disabled":Wt,"--n-icon-size":nn,"--n-line-height-textarea":pn,"--n-color-disabled":jt,"--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":Ft,"--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":Ut,"--n-clear-color-hover":Z,"--n-clear-color-pressed":pe,"--n-icon-color":Ae,"--n-icon-color-hover":Bt,"--n-icon-color-pressed":ot,"--n-icon-color-disabled":Be,"--n-suffix-text-color":Qe}}),It=y?Zn("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:s,textareaScrollbarInstRef:i,rtlEnabled:en,uncontrolledValue:c,mergedValue:d,passwordVisible:B,mergedPlaceholder:I,showPlaceholder1:T,showPlaceholder2:R,mergedFocus:D,isComposing:v,activated:N,showClearButton:w,mergedSize:p,mergedDisabled:S,textDecorationStyle:U,mergedClsPrefix:E,mergedBordered:b,mergedShowPasswordOn:k,placeholderStyle:Lt,mergedStatus:h,textAreaScrollContainerWidth:F,handleTextAreaScroll:un,handleCompositionStart:ve,handleCompositionEnd:V,handleInput:X,handleInputBlur:Q,handleInputFocus:q,handleWrapperBlur:fe,handleWrapperFocus:ie,handleMouseEnter:$e,handleMouseLeave:Oe,handleMouseDown:Ne,handleChange:de,handleClick:me,handleClear:Ce,handlePasswordToggleClick:Le,handlePasswordToggleMousedown:We,handleWrapperKeydown:Xe,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:x,type:A,countGraphemes:M,onRender:l}=this,s=this.$slots;return l==null||l(),z("div",{ref:"wrapperElRef",class:[`${b}-input`,x,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(s.prefix,e=>e&&z("div",{class:`${b}-input__prefix`},e)),A==="textarea"?z(tr,{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(Io,{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(s.suffix,e=>e||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?z("div",{class:`${b}-input__suffix`},[_t(s["clear-icon-placeholder"],t=>(this.clearable||t)&&z(da,{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(el,{clsPrefix:b,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?e:null,this.showCount&&this.type!=="textarea"?z(xa,null,{default:t=>{var n;return(n=s.count)===null||n===void 0?void 0:n.call(s,t)}}):null,this.mergedShowPasswordOn&&this.type==="password"?z("div",{class:`${b}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Zt(s["password-visible-icon"],()=>[z(dn,{clsPrefix:b},{default:()=>z(js,null)})]):Zt(s["password-invisible-icon"],()=>[z(dn,{clsPrefix:b},{default:()=>z(Qs,null)})])):null]):null)),this.pair?z("span",{class:`${b}-input__separator`},Zt(s.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(s.suffix,e=>(this.clearable||e)&&z("div",{class:`${b}-input__suffix`},[this.clearable&&z(da,{clsPrefix:b,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var t;return(t=s["clear-icon"])===null||t===void 0?void 0:t.call(s)},placeholder:()=>{var t;return(t=s["clear-icon-placeholder"])===null||t===void 0?void 0:t.call(s)}}),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(xa,null,{default:e=>{var t;const{renderCount:n}=this;return n?n(e):(t=s.count)===null||t===void 0?void 0:t.call(s,e)}}):null)}}),cl=g=>{const{textColor1:E,dividerColor:b,fontWeightStrong:y}=g;return{textColor:E,color:b,fontWeight:y}},_l={name:"Divider",common:Bn,self:cl},dl=_l,ul=Me("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)"})]),pl=Object.assign(Object.assign({},lt.props),{titlePlacement:{type:String,default:"center"},dashed:Boolean,vertical:Boolean}),Ma=tt({name:"Divider",props:pl,setup(g){const{mergedClsPrefixRef:E,inlineThemeDisabled:b}=Xt(g),y=lt("Divider","-divider",ul,dl,g,E),x=we(()=>{const{common:{cubicBezierEaseInOut:M},self:{color:l,textColor:s,fontWeight:e}}=y.value;return{"--n-bezier":M,"--n-color":l,"--n-text-color":s,"--n-font-weight":e}}),A=b?Zn("divider",void 0,x,g):void 0;return{mergedClsPrefix:E,cssVars:b?void 0:x,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:x,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`]:x,[`${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)}}),ml={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},gl=()=>ml,El={name:"Space",self:gl},Sl=El;let aa;const fl=()=>{if(!wo)return!0;if(aa===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),aa=E}return aa},bl=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}}),ra=tt({name:"Space",props:bl,setup(g){const{mergedClsPrefixRef:E,mergedRtlRef:b}=Xt(g),y=lt("Space","-space",void 0,Sl,g,E),x=Ta("Space",b,E);return{useGap:fl(),rtlEnabled:x,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:s}=Mo(M);return{horizontal:ht(s),vertical:ht(l)}})}},render(){const{vertical:g,align:E,inline:b,justify:y,itemStyle:x,margin:A,wrap:M,mergedClsPrefix:l,rtlEnabled:s,useGap:e,wrapItem:t,internalUseGap:n}=this,a=xo(qo(this));if(!a.length)return null;const r=`${A.horizontal}px`,i=`${A.horizontal/2}px`,o=`${A.vertical}px`,c=`${A.vertical/2}px`,_=a.length-1,d=y.startsWith("space-");return z("div",{role:"none",class:[`${l}-space`,s&&`${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:[x,{maxWidth:"100%"},e?"":g?{marginBottom:p!==_?o:""}:s?{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)))}}),hl={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"},Tl=g=>{const{heightSmall:E,heightMedium:b,heightLarge:y,textColor1:x,errorColor:A,warningColor:M,lineHeight:l,textColor3:s}=g;return Object.assign(Object.assign({},hl),{blankHeightSmall:E,blankHeightMedium:b,blankHeightLarge:y,lineHeight:l,labelTextColor:x,asteriskColor:A,feedbackTextColorError:A,feedbackTextColorWarning:M,feedbackTextColor:s})},vl={name:"Form",common:Bn,self:Tl},or=vl,Cl=Me("form",[Ie("inline",`
+ width: 100%;
+ display: inline-flex;
+ align-items: flex-start;
+ align-content: space-around;
+ `,[Me("form-item",{width:"auto",marginRight:"18px"},[je("&:last-child",{marginRight:0})])])]),Gn=ba("n-form"),sr=ba("n-form-item-insts");var yl=globalThis&&globalThis.__awaiter||function(g,E,b,y){function x(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 s(t){try{e(y.throw(t))}catch(n){M(n)}}function e(t){t.done?A(t.value):x(t.value).then(l,s)}e((y=y.apply(g,E||[])).next())})};const Rl=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}),Nl=tt({name:"Form",props:Rl,setup(g){const{mergedClsPrefixRef:E}=Xt(g);lt("Form","-form",Cl,or,g,E);const b={},y=Fe(void 0),x=s=>{const e=y.value;(e===void 0||s>=e)&&(y.value=s)};function A(s,e=()=>!0){return yl(this,void 0,void 0,function*(){return yield new Promise((t,n)=>{const a=[];for(const r of Oa(b)){const i=b[r];for(const o of i)o.path&&a.push(o.internalValidate(null,e))}Promise.all(a).then(r=>{if(r.some(i=>!i.valid)){const i=r.filter(o=>o.errors).map(o=>o.errors);s&&s(i),n(i)}else s&&s(),t()})})})}function M(){for(const s of Oa(b)){const e=b[s];for(const t of e)t.restoreValidation()}}return Fn(Gn,{props:g,maxChildLabelWidthRef:y,deriveMaxChildLabelWidth:x}),Fn(sr,{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 jn(g,E,b){return Al()?jn=Reflect.construct.bind():jn=function(x,A,M){var l=[null];l.push.apply(l,A);var s=Function.bind.apply(x,l),e=new s;return M&&Un(e,M.prototype),e},jn.apply(null,arguments)}function Il(g){return Function.toString.call(g).indexOf("[native code]")!==-1}function pa(g){var E=typeof Map=="function"?new Map:void 0;return pa=function(y){if(y===null||!Il(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,x)}function x(){return jn(y,arguments,ua(this).constructor)}return x.prototype=Object.create(y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),Un(x,y)},pa(g)}var Dl=/%[sdj%]/g,wl=function(){};typeof process<"u"&&process.env;function ma(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[x++]);case"%d":return Number(b[x++]);case"%j":try{return JSON.stringify(b[x++])}catch{return"[Circular]"}break;default:return l}});return M}return g}function xl(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||xl(E)&&typeof g=="string"&&!g)}function Ml(g,E,b){var y=[],x=0,A=g.length;function M(l){y.push.apply(y,l||[]),x++,x===A&&b(y)}g.forEach(function(l){E(l,M)})}function ka(g,E,b){var y=0,x=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},Ln={integer:function(E){return Ln.number(E)&&parseInt(E,10)===E},float:function(E){return Ln.number(E)&&!Ln.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"&&!Ln.array(E)},method:function(E){return typeof E=="function"},email:function(E){return typeof E=="string"&&E.length<=320&&!!E.match(Ua.email)},url:function(E){return typeof E=="string"&&E.length<=2048&&!!E.match(Bl())},hex:function(E){return typeof E=="string"&&!!E.match(Ua.hex)}},Gl=function(E,b,y,x,A){if(E.required&&b===void 0){lr(E,b,y,x,A);return}var M=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=E.type;M.indexOf(l)>-1?Ln[l](b)||x.push(ut(A.messages.types[l],E.fullField,E.type)):l&&typeof b!==E.type&&x.push(ut(A.messages.types[l],E.fullField,E.type))},Yl=function(E,b,y,x,A){var M=typeof E.len=="number",l=typeof E.min=="number",s=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&&x.push(ut(A.messages[n].len,E.fullField,E.len)):l&&!s&&tE.max?x.push(ut(A.messages[n].max,E.fullField,E.max)):l&&s&&(tE.max)&&x.push(ut(A.messages[n].range,E.fullField,E.min,E.max))},ln="enum",ql=function(E,b,y,x,A){E[ln]=Array.isArray(E[ln])?E[ln]:[],E[ln].indexOf(b)===-1&&x.push(ut(A.messages[ln],E.fullField,E[ln].join(", ")))},Vl=function(E,b,y,x,A){if(E.pattern){if(E.pattern instanceof RegExp)E.pattern.lastIndex=0,E.pattern.test(b)||x.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)||x.push(ut(A.messages.pattern.mismatch,E.fullField,b,E.pattern))}}},ke={required:lr,whitespace:Ul,type:Gl,range:Yl,enum:ql,pattern:Vl},zl=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b,"string")&&!E.required)return y();ke.required(E,b,x,M,A,"string"),it(b,"string")||(ke.type(E,b,x,M,A),ke.range(E,b,x,M,A),ke.pattern(E,b,x,M,A),E.whitespace===!0&&ke.whitespace(E,b,x,M,A))}y(M)},Hl=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A),b!==void 0&&ke.type(E,b,x,M,A)}y(M)},$l=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(b===""&&(b=void 0),it(b)&&!E.required)return y();ke.required(E,b,x,M,A),b!==void 0&&(ke.type(E,b,x,M,A),ke.range(E,b,x,M,A))}y(M)},Wl=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A),b!==void 0&&ke.type(E,b,x,M,A)}y(M)},jl=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A),it(b)||ke.type(E,b,x,M,A)}y(M)},Ql=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A),b!==void 0&&(ke.type(E,b,x,M,A),ke.range(E,b,x,M,A))}y(M)},Kl=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A),b!==void 0&&(ke.type(E,b,x,M,A),ke.range(E,b,x,M,A))}y(M)},Zl=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(b==null&&!E.required)return y();ke.required(E,b,x,M,A,"array"),b!=null&&(ke.type(E,b,x,M,A),ke.range(E,b,x,M,A))}y(M)},Xl=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A),b!==void 0&&ke.type(E,b,x,M,A)}y(M)},Jl="enum",ec=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A),b!==void 0&&ke[Jl](E,b,x,M,A)}y(M)},tc=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b,"string")&&!E.required)return y();ke.required(E,b,x,M,A),it(b,"string")||ke.pattern(E,b,x,M,A)}y(M)},nc=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b,"date")&&!E.required)return y();if(ke.required(E,b,x,M,A),!it(b,"date")){var s;b instanceof Date?s=b:s=new Date(b),ke.type(E,s,x,M,A),s&&ke.range(E,s.getTime(),x,M,A)}}y(M)},ac=function(E,b,y,x,A){var M=[],l=Array.isArray(b)?"array":typeof b;ke.required(E,b,x,M,A,l),y(M)},ia=function(E,b,y,x,A){var M=E.type,l=[],s=E.required||!E.required&&x.hasOwnProperty(E.field);if(s){if(it(b,M)&&!E.required)return y();ke.required(E,b,x,l,A,M),it(b,M)||ke.type(E,b,x,l,A)}y(l)},rc=function(E,b,y,x,A){var M=[],l=E.required||!E.required&&x.hasOwnProperty(E.field);if(l){if(it(b)&&!E.required)return y();ke.required(E,b,x,M,A)}y(M)},Pn={string:zl,method:Hl,number:$l,boolean:Wl,regexp:jl,integer:Ql,float:Kl,array:Zl,object:Xl,enum:ec,pattern:tc,date:nc,url:ia,hex:ia,email:ia,required:ac,any:rc};function ga(){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 Ea=ga(),Yn=function(){function g(b){this.rules=null,this._messages=Ea,this.define(b)}var E=g.prototype;return E.define=function(y){var x=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];x.rules[A]=Array.isArray(M)?M:[M]})},E.messages=function(y){return y&&(this._messages=Fa(ga(),y)),this._messages},E.validate=function(y,x,A){var M=this;x===void 0&&(x={}),A===void 0&&(A=function(){});var l=y,s=x,e=A;if(typeof s=="function"&&(e=s,s={}),!this.rules||Object.keys(this.rules).length===0)return e&&e(null,l),Promise.resolve(l);function t(o){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 oc(g){const E=zt(Gn,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")),x=we(()=>{if(b.value==="top")return;const{labelWidth:r}=g;if(r!==void 0&&r!=="auto")return Jn(r);if(y.value){const i=E==null?void 0:E.maxChildLabelWidthRef.value;return i!==void 0?Jn(i):void 0}if((E==null?void 0:E.props.labelWidth)!==void 0)return Jn(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:x.value}]}),l=we(()=>{const{showRequireMark:r}=g;return r!==void 0?r:E==null?void 0:E.props.showRequireMark}),s=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:s,mergedValidationStatus:t,mergedShowFeedback:n,mergedShowLabel:a,isAutoLabelWidth:y}}function sc(g){const E=zt(Gn,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:s}=E.props,{value:e}=b;if(s!==void 0&&e!==void 0){const t=nr(s,e);t!==void 0&&(Array.isArray(t)?M.push(...t):M.push(t))}}return M}),x=we(()=>y.value.some(M=>M.required)),A=we(()=>x.value||g.required);return{mergedRules:y,mergedRequired:A}}const{cubicBezierEaseInOut:Ba}=ko;function lc({name:g="fade-down",fromOffset:E="-4px",enterDuration:b=".3s",leaveDuration:y=".3s",enterCubicBezier:x=Ba,leaveCubicBezier:A=Ba}={}){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} ${x}, transform ${b} ${x}`})]}const cc=Me("form-item",`
+ display: grid;
+ line-height: var(--n-line-height);
+`,[Me("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;
+ `)]),Me("form-item-blank",`
+ grid-area: blank;
+ min-height: var(--n-blank-height);
+ `),Ie("auto-label-width",[Me("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;
+ `,[Me("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;
+ `),Me("form-item-label",`
+ display: flex;
+ align-items: flex-start;
+ justify-content: var(--n-label-text-align);
+ `)]),Me("form-item-blank",`
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ position: relative;
+ `),Me("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);
+ `),Me("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)"}),lc({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var Ga=globalThis&&globalThis.__awaiter||function(g,E,b,y){function x(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 s(t){try{e(y.throw(t))}catch(n){M(n)}}function e(t){t.done?A(t.value):x(t.value).then(l,s)}e((y=y.apply(g,E||[])).next())})};const _c=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 Ya(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||Ia("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){Ia("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:_c,setup(g){Vo(sr,"formItems",Nt(g,"path"));const{mergedClsPrefixRef:E,inlineThemeDisabled:b}=Xt(g),y=zt(Gn,null),x=ic(g),A=oc(g),{validationErrored:M}=A,{mergedRequired:l,mergedRules:s}=sc(g),{mergedSize:e}=x,{mergedLabelPlacement:t,mergedLabelAlign:n,mergedRequireMarkPlacement:a}=A,r=Fe([]),i=Fe(Aa()),o=y?Nt(y.props,"disabled"):Fe(!1),c=lt("Form","-form-item",cc,or,g,E);Vt(Nt(g,"path"),()=>{g.ignorePathChange||_()});function _(){r.value=[],M.value=!1,g.feedback&&(i.value=Aa())}function d(){m("blur")}function u(){m("change")}function p(){m("focus")}function S(){m("input")}function h(T,R){return Ga(this,void 0,void 0,function*(){let D,w,k,B;return typeof T=="string"?(D=T,w=R):T!==null&&typeof T=="object"&&(D=T.trigger,w=T.callback,k=T.shouldRuleBeApplied,B=T.options),yield new Promise((U,F)=>{m(D,k,B).then(({valid:W,errors:K})=>{W?(w&&w(),U()):(w&&w(K),F(K))})})})}const m=(T=null,R=()=>!0,D={suppressWarning:!0})=>Ga(this,void 0,void 0,function*(){const{path:w}=g;D?D.first||(D.first=g.first):D={};const{value:k}=s,B=y?nr(y.props.model,w||""):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=Ya(j.validator,!1)),j.asyncValidator&&(j.asyncValidator=Ya(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=w??"__n_no_path__",G=new Yn({[K]:W}),{validateMessages:Y}=(y==null?void 0:y.props)||{};return Y&&G.messages(Y),yield new Promise($=>{G.validate({[K]:B},D,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}))})})});Fn(Lo,{path:Nt(g,"path"),disabled:o,mergedSize:x.mergedSize,mergedValidationStatus:A.mergedValidationStatus,restoreValidation:_,handleContentBlur:d,handleContentChange:u,handleContentFocus:p,handleContentInput:S});const f={validate:h,restoreValidation:_,internalValidate:m},v=Fe(null);fa(()=>{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:D}=t,w=D==="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",w)]:Re,[rt("labelTextAlign",w)]:Te,[rt(rt("labelFontSize",D),R)]:De}}=c.value;let Ee=(T=n.value)!==null&&T!==void 0?T:Te;return D==="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?Zn("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),x),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:x,onRender:A}=this,M=y!==void 0?y:this.mergedRequired;A==null||A();const l=()=>{const s=this.$slots.label?this.$slots.label():this.label;if(!s)return null;const e=z("span",{class:`${E}-form-item-label__text`},s),t=M?z("span",{class:`${E}-form-item-label__asterisk`},x!=="left"?" *":"* "):x==="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--${x}-mark`,this.reverseColSpace&&`${E}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),x==="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($a,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:s}=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?s==="warning"?z("div",{key:"controlled-warning",class:`${E}-form-item-feedback ${E}-form-item-feedback--warning`},a):s==="error"?z("div",{key:"controlled-error",class:`${E}-form-item-feedback ${E}-form-item-feedback--error`},a):s==="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)}}),dc=g=>{const{textColorDisabled:E}=g;return{iconColorDisabled:E}},uc=Po({name:"InputNumber",common:Bn,peers:{Button:Fo,Input:rr},self:dc}),pc=uc,mc={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"},gc=g=>{const{primaryColor:E,opacityDisabled:b,borderRadius:y,textColor3:x}=g,A="rgba(0, 0, 0, .14)";return Object.assign(Object.assign({},mc),{iconColor:x,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 ${Wn(E,{alpha:.2})}`})},Ec={name:"Switch",common:Bn,self:gc},Sc=Ec;function fc(g){return g==null||typeof g=="string"&&g.trim()===""?null:Number(g)}function bc(g){return g.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(g)||/^\.\d+$/.test(g))}function oa(g){return g==null?!0:!Number.isNaN(g)}function qa(g,E){return g==null?"":E===void 0?String(g):g.toFixed(E)}function sa(g){if(g===null)return null;if(typeof g=="number")return g;{const E=Number(g);return Number.isNaN(E)?null:E}}const hc=je([Me("input-number-suffix",`
+ display: inline-block;
+ margin-right: 10px;
+ `),Me("input-number-prefix",`
+ display: inline-block;
+ margin-left: 10px;
+ `)]),Va=800,za=100,Tc=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]}),vc=tt({name:"InputNumber",props:Tc,setup(g){const{mergedBorderedRef:E,mergedClsPrefixRef:b,mergedRtlRef:y}=Xt(g),x=lt("InputNumber","-input-number",hc,pc,g,b),{localeRef:A}=ar("InputNumber"),M=ha(g),{mergedSizeRef:l,mergedDisabledRef:s,mergedStatusRef:e}=M,t=Fe(null),n=Fe(null),a=Fe(null),r=Fe(g.defaultValue),i=Nt(g,"value"),o=va(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=kt(()=>{const{placeholder:V}=g;return V!==void 0?V:A.value.placeholder}),p=kt(()=>{const V=sa(g.step);return V!==null?V===0?1:Math.abs(V):1}),S=kt(()=>{const V=sa(g.min);return V!==null?V:null}),h=kt(()=>{const V=sa(g.max);return V!==null?V:null}),m=V=>{const{value:X}=o;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&&bc(q))return!1;const fe=(g.parse||fc)(q);if(fe===null)return X&&m(null),null;if(oa(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}=o;if(oa(V)){const{format:X,precision:ce}=g;X?c.value=X(V):V===null||ce===void 0||_(V)>ce?c.value=qa(V,void 0):c.value=qa(V,ce)}else c.value=String(V)};v();const N=kt(()=>f({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),O=kt(()=>{const{value:V}=o;if(g.validator&&V===null)return!1;const{value:X}=p;return f({offset:-X,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),I=kt(()=>{const{value:V}=o;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||"")),o.value===Q&&v()}else v();const{onBlur:q}=g,{nTriggerFormBlur:fe}=M;q&&Ke(q,V),fe(),Qn(()=>{v()})}function D(V){const{onClear:X}=g;X&&Ke(X,V)}function w(){const{value:V}=I;if(!V){j();return}const{value:X}=o;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}=o;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){D(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()},za)},Va),Kn("mouseup",document,te,{once:!0})}let le=null;function Re(){j(),le=window.setTimeout(()=>{Y=window.setInterval(()=>{w()},za)},Va),Kn("mouseup",document,j,{once:!0})}const Te=()=>{Y||w()},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&&w()}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})}Vt(o,()=>{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=Ta("InputNumber",y,b);return Object.assign(Object.assign({},Se),{rtlEnabled:ve,inputInstRef:t,minusButtonInstRef:n,addButtonInstRef:a,mergedClsPrefix:b,mergedBordered:E,uncontrolledValue:r,mergedValue:o,mergedPlaceholder:u,displayedValueInvalid:N,mergedSize:l,mergedDisabled:s,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:x,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:we(()=>{const{self:{iconColorDisabled:V}}=x.value,[X,ce,Q,q]=Uo(V);return{textColorTextDisabled:`rgb(${X}, ${ce}, ${Q})`,opacityDisabled:`${q}`}})})},render(){const{mergedClsPrefix:g,$slots:E}=this,b=()=>z(Da,{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(Ks,null)})])}),y=()=>z(Da,{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(Ws,null)})])});return z("div",{class:[`${g}-input-number`,this.rtlEnabled&&`${g}-input-number--rtl`]},z(kn,{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 x;return this.showButton&&this.buttonPlacement==="both"?[b(),_t(E.prefix,A=>A?z("span",{class:`${g}-input-number-prefix`},A):null)]:(x=E.prefix)===null||x===void 0?void 0:x.call(E)},suffix:()=>{var x;return this.showButton?[_t(E.suffix,A=>A?z("span",{class:`${g}-input-number-suffix`},A):null),this.buttonPlacement==="right"?b():null,y()]:(x=E.suffix)===null||x===void 0?void 0:x.call(E)}}))}}),Cc=Object.assign(Object.assign({},lt.props),{trigger:String,xScrollable:Boolean,onScroll:Function}),yc=tt({name:"Scrollbar",props:Cc,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(tr,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),Rc=yc,Nc=Me("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);
+ `),Me("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);
+ `,[_a({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;
+ `,[_a()]),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;
+ `)])]),Oc=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 Ac=tt({name:"Switch",props:Oc,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",Nc,Sc,g,E),x=ha(g),{mergedSizeRef:A,mergedDisabledRef:M}=x,l=Fe(g.defaultValue),s=Nt(g,"value"),e=va(s,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}=x;v&&Ke(v,f),O&&Ke(O,f),N&&Ke(N,f),l.value=f,I(),T()}function o(){const{nTriggerFormFocus:f}=x;f()}function c(){const{nTriggerFormBlur:f}=x;f()}function _(){g.loading||M.value||(e.value!==g.checkedValue?i(g.checkedValue):i(g.uncheckedValue))}function d(){a.value=!0,o()}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:D,textColor:w,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=ta((ht(W)-ht(B))/2),j=ta(Math.max(ht(W),ht(B))),re=ht(W)>ht(B)?K:ta(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":D,"--n-text-color":w,"--n-icon-color":k}}),m=b?Zn("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:x,$slots:A}=this;x==null||x();const{checked:M,unchecked:l,icon:s,"checked-icon":e,"unchecked-icon":t}=A,n=!(ea(s)&&ea(e)&&ea(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(s,a=>_t(e,r=>_t(t,i=>z(Ja,null,{default:()=>this.loading?z(er,{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)))))}}),Ic={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Dc=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),wc=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),xc=[Dc,wc],Mc=tt({name:"ReloadOutline",render:function(E,b){return Ze(),ct("svg",Ic,xc)}}),kc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Lc=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),Pc=[Lc],Fc=tt({name:"SaveOutline",render:function(E,b){return Ze(),ct("svg",kc,Pc)}});var cr={exports:{}};const Uc=_r(Yo);(function(g,E){(function(b,y){g.exports=y(Uc)})(typeof self<"u"?self:dr,function(b){return(()=>{var y={7679:function(l,s){var e,t,n;(function(a,r){t=[],e=r,n=typeof e=="function"?e.apply(s,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,o,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,o=new RegExp("(?:[^\\n]+?\\n){0,"+(S-2)+"}[^<]*
-
+
+
diff --git a/config.py b/config.py
index 707a7533..4d247828 100644
--- a/config.py
+++ b/config.py
@@ -72,23 +72,25 @@ class DiscordBot(BaseModel):
class HttpService(BaseModel):
host: str = Field(
title="Host",
- description="0.0.0.0则不限制访问地址",
+ description="HTTP 服务绑定的 IP 地址,0.0.0.0 表示绑定于所有 IP 地址",
default="0.0.0.0"
)
port: int = Field(
title="Port",
- description="Http service port, 默认8080",
+ description="HTTP 服务绑定的端口号",
default=8080
)
debug: bool = Field(
title="Debug",
- description="是否开启debug,错误时展示日志",
+ description="是否开启 debug ,错误时展示日志",
default=False
)
password: Optional[str] = Field(
title="登录密码",
description="密码使用 SHA-512 哈希保存,如果未指定,则会在启动时随机生成一个密码。",
- default=None
+ default=None,
+ form_type="password",
+ password="HmacSHA512"
)
cloudflared: bool = Field(
title="开启 Cloudflare 转发",
@@ -98,21 +100,6 @@ class HttpService(BaseModel):
class WecomBot(BaseModel):
- host: str = Field(
- title="Host",
- description="企业微信回调地址,需要能够被公网访问,0.0.0.0则不限制访问地址",
- default="0.0.0.0"
- )
- port: int = Field(
- title="Port",
- description="Http service port, 默认5001",
- default=5001
- )
- debug: bool = Field(
- title="Debug",
- description="是否开启debug,错误时展示日志",
- default=False
- )
corp_id: str = Field(
title="企业 ID",
description="企业微信 的 企业 ID",
diff --git a/framework/platforms/http_service.py b/framework/platforms/http_service.py
index bf51f7d7..6808294c 100644
--- a/framework/platforms/http_service.py
+++ b/framework/platforms/http_service.py
@@ -41,7 +41,10 @@
constants.config.http.password = generate_password_hash(password, method="sha512", salt_length=6)
constants.Config.save_config(constants.config)
-jwt_secret_key = hashlib.sha256(constants.config.http.password.encode('utf-8')).digest()
+
+def get_jwt_secret_key():
+ return hashlib.sha256(constants.config.http.password.encode('utf-8')).digest()
+
webui_static = safe_join(os.path.dirname(os.path.pardir), 'assets/webui')
@@ -52,7 +55,7 @@ def generate_token():
expiration_time = datetime.now(timezone.utc) + timedelta(days=3)
# 令牌的 payload 包含过期时间和密码哈希
payload = {"exp": expiration_time}
- return jwt.encode(payload, jwt_secret_key, algorithm="HS256")
+ return jwt.encode(payload, get_jwt_secret_key(), algorithm="HS256")
def authenticate(func):
@@ -65,7 +68,7 @@ async def wrapper(*args, **kwargs):
# 验证 JWT 令牌
try:
- jwt.decode(token, jwt_secret_key, algorithms=["HS256"])
+ jwt.decode(token, get_jwt_secret_key(), algorithms=["HS256"])
except jwt.ExpiredSignatureError:
return jsonify({"error": "令牌已过期"}), 401
except Exception: