it-tools/dist/client/assets/chunks/chunk-015e5c20.js
2024-04-28 00:48:29 +08:00

360 lines
46 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{o as z,n as g,p as i,al as me,c as Cr,am as zr,q as _,M as te,u as no,v as ke,O as Sr,F as Ke,t as ao,w as c,x as io,af as ue,N as $r,ai as Br,ad as Je,P as E,ac as eo,a as lo,f as Se,ae as Pr}from"../entries/src_pages_Home.page.16dc467b.js";import{c as so}from"./chunk-a740628f.js";import{d as q,h as n,C as Pe,r as R,a1 as Rr,n as Ue,A as Ge,i as co,c as V,b as kr,a0 as Tr,w as oo,p as _r,F as Fr}from"./chunk-449c23a2.js";import{u as Xe}from"./chunk-416dc92c.js";import{u as Ar}from"./chunk-66ac4853.js";import{u as uo}from"./chunk-2749dac9.js";import{g as Er}from"./chunk-567e13ca.js";import{i as Ir}from"./chunk-26a03a7a.js";import{i as fo,N as ho}from"./chunk-f823181b.js";import{N as Re}from"./chunk-9519e52e.js";import{r as Mr}from"./chunk-f94e2689.js";import{N as vo}from"./chunk-1d5b5526.js";import{i as Te}from"./chunk-fc34c9a6.js";import{b as Dr}from"./chunk-af6e0163.js";import{c as ro}from"./chunk-b0332f36.js";import{N as Vr}from"./chunk-f206ee20.js";const Wr=q({name:"Eye",render(){return n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},n("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"}),n("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),Lr=q({name:"EyeOff",render(){return n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},n("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"}),n("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"}),n("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"}),n("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"}),n("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"}))}}),Or=q({name:"ChevronDown",render(){return n("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("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"}))}}),Hr=Mr("clear",n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("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"}))))),Nr=z("base-wave",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
`),jr=q({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(o){Xe("-base-wave",Nr,Pe(o,"clsPrefix"));const s=R(null),a=R(!1);let m=null;return Rr(()=>{m!==null&&window.clearTimeout(m)}),{active:a,selfRef:s,play(){m!==null&&(window.clearTimeout(m),a.value=!1,m=null),Ue(()=>{var k;(k=s.value)===null||k===void 0||k.offsetHeight,a.value=!0,m=window.setTimeout(()=>{a.value=!1,m=null},1e3)})}}},render(){const{clsPrefix:o}=this;return n("div",{ref:"selfRef","aria-hidden":!0,class:[`${o}-base-wave`,this.active&&`${o}-base-wave--active`]})}}),Kr=z("base-clear",`
flex-shrink: 0;
height: 1em;
width: 1em;
position: relative;
`,[g(">",[i("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;
`,[g("&:hover",`
color: var(--n-clear-color-hover)!important;
`),g("&:active",`
color: var(--n-clear-color-pressed)!important;
`)]),i("placeholder",`
display: flex;
`),i("clear, placeholder",`
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
`,[fo({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),qe=q({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(o){return Xe("-base-clear",Kr,Pe(o,"clsPrefix")),{handleMouseDown(s){var a;s.preventDefault(),(a=o.onClear)===null||a===void 0||a.call(o,s)}}},render(){const{clsPrefix:o}=this;return n("div",{class:`${o}-base-clear`},n(ho,null,{default:()=>{var s,a;return this.show?n("div",{key:"dismiss",class:`${o}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},me(this.$slots.icon,()=>[n(Re,{clsPrefix:o},{default:()=>n(Hr,null)})])):n("div",{key:"icon",class:`${o}-base-clear__placeholder`},(a=(s=this.$slots).placeholder)===null||a===void 0?void 0:a.call(s))}}))}}),Ur=q({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(o,{slots:s}){return()=>{const{clsPrefix:a}=o;return n(vo,{clsPrefix:a,class:`${a}-base-suffix`,strokeWidth:24,scale:.85,show:o.loading},{default:()=>o.showArrow?n(qe,{clsPrefix:a,show:o.showClear,onClear:o.onClear},{placeholder:()=>n(Re,{clsPrefix:a,class:`${a}-base-suffix__arrow`},{default:()=>me(s.default,()=>[n(Or,null)])})}):null})}}}),{cubicBezierEaseInOut:Y}=Cr;function Gr({duration:o=".2s",delay:s=".1s"}={}){return[g("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),g("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",`
opacity: 0!important;
margin-left: 0!important;
margin-right: 0!important;
`),g("&.fade-in-width-expand-transition-leave-active",`
overflow: hidden;
transition:
opacity ${o} ${Y},
max-width ${o} ${Y} ${s},
margin-left ${o} ${Y} ${s},
margin-right ${o} ${Y} ${s};
`),g("&.fade-in-width-expand-transition-enter-active",`
overflow: hidden;
transition:
opacity ${o} ${Y} ${s},
max-width ${o} ${Y},
margin-left ${o} ${Y},
margin-right ${o} ${Y};
`)]}const qr=Te&&"chrome"in window;Te&&navigator.userAgent.includes("Firefox");const po=Te&&navigator.userAgent.includes("Safari")&&!qr,bo=so("n-input");function Xr(o){let s=0;for(const a of o)s++;return s}function $e(o){return o===""||o==null}function Yr(o){const s=R(null);function a(){const{value:P}=o;if(!P?.focus){k();return}const{selectionStart:b,selectionEnd:d,value:v}=P;if(b==null||d==null){k();return}s.value={start:b,end:d,beforeText:v.slice(0,b),afterText:v.slice(d)}}function m(){var P;const{value:b}=s,{value:d}=o;if(!b||!d)return;const{value:v}=d,{start:h,beforeText:u,afterText:S}=b;let F=v.length;if(v.endsWith(S))F=v.length-S.length;else if(v.startsWith(u))F=u.length;else{const j=u[h-1],I=v.indexOf(j,h-1);I!==-1&&(F=I+1)}(P=d.setSelectionRange)===null||P===void 0||P.call(d,F,F)}function k(){s.value=null}return Ge(o,k),{recordCursor:a,restoreCursor:m}}const to=q({name:"InputWordCount",setup(o,{slots:s}){const{mergedValueRef:a,maxlengthRef:m,mergedClsPrefixRef:k,countGraphemesRef:P}=co(bo),b=V(()=>{const{value:d}=a;return d===null||Array.isArray(d)?0:(P.value||Xr)(d)});return()=>{const{value:d}=m,{value:v}=a;return n("span",{class:`${k.value}-input-word-count`},zr(s.default,{value:v===null||Array.isArray(v)?"":v},()=>[d===void 0?b.value:`${b.value} / ${d}`]))}}}),Qr=z("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);
`,[i("input, textarea",`
overflow: hidden;
flex-grow: 1;
position: relative;
`),i("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);
`),i("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;
`,[g("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
width: 0;
height: 0;
display: none;
`),g("&::placeholder",`
color: #0000;
-webkit-text-fill-color: transparent !important;
`),g("&:-webkit-autofill ~",[i("placeholder","display: none;")])]),_("round",[te("textarea","border-radius: calc(var(--n-height) / 2);")]),i("placeholder",`
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
color: var(--n-placeholder-color);
`,[g("span",`
width: 100%;
display: inline-block;
`)]),_("textarea",[i("placeholder","overflow: visible;")]),te("autosize","width: 100%;"),_("autosize",[i("textarea-el, input-el",`
position: absolute;
top: 0;
left: 0;
height: 100%;
`)]),z("input-wrapper",`
overflow: hidden;
display: inline-flex;
flex-grow: 1;
position: relative;
padding-left: var(--n-padding-left);
padding-right: var(--n-padding-right);
`),i("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;
`),i("input-el",`
padding: 0;
height: var(--n-height);
line-height: var(--n-height);
`,[g("+",[i("placeholder",`
display: flex;
align-items: center;
`)])]),te("textarea",[i("placeholder","white-space: nowrap;")]),i("eye",`
display: flex;
align-items: center;
justify-content: center;
transition: color .3s var(--n-bezier);
`),_("textarea","width: 100%;",[z("input-word-count",`
position: absolute;
right: var(--n-padding-right);
bottom: var(--n-padding-vertical);
`),_("resizable",[z("input-wrapper",`
resize: vertical;
min-height: var(--n-height);
`)]),i("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;
scroll-padding-block-end: var(--n-padding-vertical);
`),i("textarea-mirror",`
width: 100%;
pointer-events: none;
overflow: hidden;
visibility: hidden;
position: static;
white-space: pre-wrap;
overflow-wrap: break-word;
`)]),_("pair",[i("input-el, placeholder","text-align: center;"),i("separator",`
display: flex;
align-items: center;
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
white-space: nowrap;
`,[z("icon",`
color: var(--n-icon-color);
`),z("base-icon",`
color: var(--n-icon-color);
`)])]),_("disabled",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`,[i("border","border: var(--n-border-disabled);"),i("input-el, textarea-el",`
cursor: not-allowed;
color: var(--n-text-color-disabled);
text-decoration-color: var(--n-text-color-disabled);
`),i("placeholder","color: var(--n-placeholder-color-disabled);"),i("separator","color: var(--n-text-color-disabled);",[z("icon",`
color: var(--n-icon-color-disabled);
`),z("base-icon",`
color: var(--n-icon-color-disabled);
`)]),z("input-word-count",`
color: var(--n-count-text-color-disabled);
`),i("suffix, prefix","color: var(--n-text-color-disabled);",[z("icon",`
color: var(--n-icon-color-disabled);
`),z("internal-icon",`
color: var(--n-icon-color-disabled);
`)])]),te("disabled",[i("eye",`
color: var(--n-icon-color);
cursor: pointer;
`,[g("&:hover",`
color: var(--n-icon-color-hover);
`),g("&:active",`
color: var(--n-icon-color-pressed);
`)]),g("&:hover",[i("state-border","border: var(--n-border-hover);")]),_("focus","background-color: var(--n-color-focus);",[i("state-border",`
border: var(--n-border-focus);
box-shadow: var(--n-box-shadow-focus);
`)])]),i("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);
`),i("state-border",`
border-color: #0000;
z-index: 1;
`),i("prefix","margin-right: 4px;"),i("suffix",`
margin-left: 4px;
`),i("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);
`,[z("base-loading",`
font-size: var(--n-icon-size);
margin: 0 2px;
color: var(--n-loading-color);
`),z("base-clear",`
font-size: var(--n-icon-size);
`,[i("placeholder",[z("base-icon",`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)])]),g(">",[z("icon",`
transition: color .3s var(--n-bezier);
color: var(--n-icon-color);
font-size: var(--n-icon-size);
`)]),z("base-icon",`
font-size: var(--n-icon-size);
`)]),z("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(o=>_(`${o}-status`,[te("disabled",[z("base-loading",`
color: var(--n-loading-color-${o})
`),i("input-el, textarea-el",`
caret-color: var(--n-caret-color-${o});
`),i("state-border",`
border: var(--n-border-${o});
`),g("&:hover",[i("state-border",`
border: var(--n-border-hover-${o});
`)]),g("&:focus",`
background-color: var(--n-color-focus-${o});
`,[i("state-border",`
box-shadow: var(--n-box-shadow-focus-${o});
border: var(--n-border-focus-${o});
`)]),_("focus",`
background-color: var(--n-color-focus-${o});
`,[i("state-border",`
box-shadow: var(--n-box-shadow-focus-${o});
border: var(--n-border-focus-${o});
`)])])]))]),Zr=z("input",[_("disabled",[i("input-el, textarea-el",`
-webkit-text-fill-color: var(--n-text-color-disabled);
`)])]),Jr=Object.assign(Object.assign({},ke.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,Array],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:{type:Boolean,default:!0},showPasswordToggle:Boolean}),yt=q({name:"Input",props:Jr,setup(o){const{mergedClsPrefixRef:s,mergedBorderedRef:a,inlineThemeDisabled:m,mergedRtlRef:k}=no(o),P=ke("Input","-input",Qr,Ir,o,s);po&&Xe("-input-safari",Zr,s);const b=R(null),d=R(null),v=R(null),h=R(null),u=R(null),S=R(null),F=R(null),j=Yr(F),I=R(null),{localeRef:_e}=Ar("Input"),ne=R(o.defaultValue),Fe=Pe(o,"value"),W=Sr(Fe,ne),L=uo(o),{mergedSizeRef:f,mergedDisabledRef:w,mergedStatusRef:O}=L,t=R(!1),K=R(!1),D=R(!1),U=R(!1);let Q=null;const M=V(()=>{const{placeholder:e,pair:r}=o;return r?Array.isArray(e)?e:e===void 0?["",""]:[e,e]:e===void 0?[_e.value.placeholder]:[e]}),fe=V(()=>{const{value:e}=D,{value:r}=W,{value:l}=M;return!e&&($e(r)||Array.isArray(r)&&$e(r[0]))&&l[0]}),G=V(()=>{const{value:e}=D,{value:r}=W,{value:l}=M;return!e&&l[1]&&($e(r)||Array.isArray(r)&&$e(r[1]))}),Z=Ke(()=>o.internalForceFocus||t.value),H=Ke(()=>{if(w.value||o.readonly||!o.clearable||!Z.value&&!K.value)return!1;const{value:e}=W,{value:r}=Z;return o.pair?!!(Array.isArray(e)&&(e[0]||e[1]))&&(K.value||r):!!e&&(K.value||r)}),x=V(()=>{const{showPasswordOn:e}=o;if(e)return e;if(o.showPasswordToggle)return"click"}),X=R(!1),he=V(()=>{const{textDecoration:e}=o;return e?Array.isArray(e)?e.map(r=>({textDecoration:r})):[{textDecoration:e}]:["",""]}),N=R(void 0),Ae=()=>{var e,r;if(o.type==="textarea"){const{autosize:l}=o;if(l&&(N.value=(r=(e=I.value)===null||e===void 0?void 0:e.$el)===null||r===void 0?void 0:r.offsetWidth),!d.value||typeof l=="boolean")return;const{paddingTop:C,paddingBottom:T,lineHeight:y}=window.getComputedStyle(d.value),J=Number(C.slice(0,-2)),ee=Number(T.slice(0,-2)),oe=Number(y.slice(0,-2)),{value:be}=v;if(!be)return;if(l.minRows){const ge=Math.max(l.minRows,1),je=`${J+ee+oe*ge}px`;be.style.minHeight=je}if(l.maxRows){const ge=`${J+ee+oe*l.maxRows}px`;be.style.maxHeight=ge}}},xe=V(()=>{const{maxlength:e}=o;return e===void 0?void 0:Number(e)});kr(()=>{const{value:e}=W;Array.isArray(e)||Ne(e)});const Ee=Tr().proxy;function ae(e){const{onUpdateValue:r,"onUpdate:value":l,onInput:C}=o,{nTriggerFormInput:T}=L;r&&E(r,e),l&&E(l,e),C&&E(C,e),ne.value=e,T()}function ie(e){const{onChange:r}=o,{nTriggerFormChange:l}=L;r&&E(r,e),ne.value=e,l()}function $(e){const{onBlur:r}=o,{nTriggerFormBlur:l}=L;r&&E(r,e),l()}function le(e){const{onFocus:r}=o,{nTriggerFormFocus:l}=L;r&&E(r,e),l()}function ye(e){const{onClear:r}=o;r&&E(r,e)}function p(e){const{onInputBlur:r}=o;r&&E(r,e)}function ve(e){const{onInputFocus:r}=o;r&&E(r,e)}function pe(){const{onDeactivate:e}=o;e&&E(e)}function Ie(){const{onActivate:e}=o;e&&E(e)}function Me(e){const{onClick:r}=o;r&&E(r,e)}function De(e){const{onWrapperFocus:r}=o;r&&E(r,e)}function Ve(e){const{onWrapperBlur:r}=o;r&&E(r,e)}function We(){D.value=!0}function Le(e){D.value=!1,e.target===S.value?se(e,1):se(e,0)}function se(e,r=0,l="input"){const C=e.target.value;if(Ne(C),e instanceof InputEvent&&!e.isComposing&&(D.value=!1),o.type==="textarea"){const{value:y}=I;y&&y.syncUnifiedContainer()}if(Q=C,D.value)return;j.recordCursor();const T=Oe(C);if(T)if(!o.pair)l==="input"?ae(C):ie(C);else{let{value:y}=W;Array.isArray(y)?y=[y[0],y[1]]:y=["",""],y[r]=C,l==="input"?ae(y):ie(y)}Ee.$forceUpdate(),T||Ue(j.restoreCursor)}function Oe(e){const{countGraphemes:r,maxlength:l,minlength:C}=o;if(r){let y;if(l!==void 0&&(y===void 0&&(y=r(e)),y>Number(l))||C!==void 0&&(y===void 0&&(y=r(e)),y<Number(l)))return!1}const{allowInput:T}=o;return typeof T=="function"?T(e):!0}function B(e){p(e),e.relatedTarget===b.value&&pe(),e.relatedTarget!==null&&(e.relatedTarget===u.value||e.relatedTarget===S.value||e.relatedTarget===d.value)||(U.value=!1),we(e,"blur"),F.value=null}function A(e,r){ve(e),t.value=!0,U.value=!0,Ie(),we(e,"focus"),r===0?F.value=u.value:r===1?F.value=S.value:r===2&&(F.value=d.value)}function ce(e){o.passivelyActivated&&(Ve(e),we(e,"blur"))}function go(e){o.passivelyActivated&&(t.value=!0,De(e),we(e,"focus"))}function we(e,r){e.relatedTarget!==null&&(e.relatedTarget===u.value||e.relatedTarget===S.value||e.relatedTarget===d.value||e.relatedTarget===b.value)||(r==="focus"?(le(e),t.value=!0):r==="blur"&&($(e),t.value=!1))}function mo(e,r){se(e,r,"change")}function xo(e){Me(e)}function yo(e){ye(e),o.pair?(ae(["",""]),ie(["",""])):(ae(""),ie(""))}function wo(e){const{onMousedown:r}=o;r&&r(e);const{tagName:l}=e.target;if(l!=="INPUT"&&l!=="TEXTAREA"){if(o.resizable){const{value:C}=b;if(C){const{left:T,top:y,width:J,height:ee}=C.getBoundingClientRect(),oe=14;if(T+J-oe<e.clientX&&e.clientX<T+J&&y+ee-oe<e.clientY&&e.clientY<y+ee)return}}e.preventDefault(),t.value||Ye()}}function Co(){var e;K.value=!0,o.type==="textarea"&&((e=I.value)===null||e===void 0||e.handleMouseEnterWrapper())}function zo(){var e;K.value=!1,o.type==="textarea"&&((e=I.value)===null||e===void 0||e.handleMouseLeaveWrapper())}function So(){w.value||x.value==="click"&&(X.value=!X.value)}function $o(e){if(w.value)return;e.preventDefault();const r=C=>{C.preventDefault(),eo("mouseup",document,r)};if(Je("mouseup",document,r),x.value!=="mousedown")return;X.value=!0;const l=()=>{X.value=!1,eo("mouseup",document,l)};Je("mouseup",document,l)}function Bo(e){o.onKeyup&&E(o.onKeyup,e)}function Po(e){switch(o.onKeydown&&E(o.onKeydown,e),e.key){case"Escape":He();break;case"Enter":Ro(e);break}}function Ro(e){var r,l;if(o.passivelyActivated){const{value:C}=U;if(C){o.internalDeactivateOnEnter&&He();return}e.preventDefault(),o.type==="textarea"?(r=d.value)===null||r===void 0||r.focus():(l=u.value)===null||l===void 0||l.focus()}}function He(){o.passivelyActivated&&(U.value=!1,Ue(()=>{var e;(e=b.value)===null||e===void 0||e.focus()}))}function Ye(){var e,r,l;w.value||(o.passivelyActivated?(e=b.value)===null||e===void 0||e.focus():((r=d.value)===null||r===void 0||r.focus(),(l=u.value)===null||l===void 0||l.focus()))}function ko(){var e;!((e=b.value)===null||e===void 0)&&e.contains(document.activeElement)&&document.activeElement.blur()}function To(){var e,r;(e=d.value)===null||e===void 0||e.select(),(r=u.value)===null||r===void 0||r.select()}function _o(){w.value||(d.value?d.value.focus():u.value&&u.value.focus())}function Fo(){const{value:e}=b;e?.contains(document.activeElement)&&e!==document.activeElement&&He()}function Ao(e){if(o.type==="textarea"){const{value:r}=d;r?.scrollTo(e)}else{const{value:r}=u;r?.scrollTo(e)}}function Ne(e){const{type:r,pair:l,autosize:C}=o;if(!l&&C)if(r==="textarea"){const{value:T}=v;T&&(T.textContent=(e??"")+`\r
`)}else{const{value:T}=h;T&&(e?T.textContent=e:T.innerHTML="&nbsp;")}}function Eo(){Ae()}const Qe=R({top:"0"});function Io(e){var r;const{scrollTop:l}=e.target;Qe.value.top=`${-l}px`,(r=I.value)===null||r===void 0||r.syncUnifiedContainer()}let Ce=null;oo(()=>{const{autosize:e,type:r}=o;e&&r==="textarea"?Ce=Ge(W,l=>{!Array.isArray(l)&&l!==Q&&Ne(l)}):Ce?.()});let ze=null;oo(()=>{o.type==="textarea"?ze=Ge(W,e=>{var r;!Array.isArray(e)&&e!==Q&&((r=I.value)===null||r===void 0||r.syncUnifiedContainer())}):ze?.()}),_r(bo,{mergedValueRef:W,maxlengthRef:xe,mergedClsPrefixRef:s,countGraphemesRef:Pe(o,"countGraphemes")});const Mo={wrapperElRef:b,inputElRef:u,textareaElRef:d,isCompositing:D,focus:Ye,blur:ko,select:To,deactivate:Fo,activate:_o,scrollTo:Ao},Do=ao("Input",k,s),Ze=V(()=>{const{value:e}=f,{common:{cubicBezierEaseInOut:r},self:{color:l,borderRadius:C,textColor:T,caretColor:y,caretColorError:J,caretColorWarning:ee,textDecorationColor:oe,border:be,borderDisabled:ge,borderHover:je,borderFocus:Vo,placeholderColor:Wo,placeholderColorDisabled:Lo,lineHeightTextarea:Oo,colorDisabled:Ho,colorFocus:No,textColorDisabled:jo,boxShadowFocus:Ko,iconSize:Uo,colorFocusWarning:Go,boxShadowFocusWarning:qo,borderWarning:Xo,borderFocusWarning:Yo,borderHoverWarning:Qo,colorFocusError:Zo,boxShadowFocusError:Jo,borderError:er,borderFocusError:or,borderHoverError:rr,clearSize:tr,clearColor:nr,clearColorHover:ar,clearColorPressed:ir,iconColor:lr,iconColorDisabled:sr,suffixTextColor:cr,countTextColor:dr,countTextColorDisabled:ur,iconColorHover:fr,iconColorPressed:hr,loadingColor:vr,loadingColorError:pr,loadingColorWarning:br,[c("padding",e)]:gr,[c("fontSize",e)]:mr,[c("height",e)]:xr}}=P.value,{left:yr,right:wr}=Er(gr);return{"--n-bezier":r,"--n-count-text-color":dr,"--n-count-text-color-disabled":ur,"--n-color":l,"--n-font-size":mr,"--n-border-radius":C,"--n-height":xr,"--n-padding-left":yr,"--n-padding-right":wr,"--n-text-color":T,"--n-caret-color":y,"--n-text-decoration-color":oe,"--n-border":be,"--n-border-disabled":ge,"--n-border-hover":je,"--n-border-focus":Vo,"--n-placeholder-color":Wo,"--n-placeholder-color-disabled":Lo,"--n-icon-size":Uo,"--n-line-height-textarea":Oo,"--n-color-disabled":Ho,"--n-color-focus":No,"--n-text-color-disabled":jo,"--n-box-shadow-focus":Ko,"--n-loading-color":vr,"--n-caret-color-warning":ee,"--n-color-focus-warning":Go,"--n-box-shadow-focus-warning":qo,"--n-border-warning":Xo,"--n-border-focus-warning":Yo,"--n-border-hover-warning":Qo,"--n-loading-color-warning":br,"--n-caret-color-error":J,"--n-color-focus-error":Zo,"--n-box-shadow-focus-error":Jo,"--n-border-error":er,"--n-border-focus-error":or,"--n-border-hover-error":rr,"--n-loading-color-error":pr,"--n-clear-color":nr,"--n-clear-size":tr,"--n-clear-color-hover":ar,"--n-clear-color-pressed":ir,"--n-icon-color":lr,"--n-icon-color-hover":fr,"--n-icon-color-pressed":hr,"--n-icon-color-disabled":sr,"--n-suffix-text-color":cr}}),de=m?io("input",V(()=>{const{value:e}=f;return e[0]}),Ze,o):void 0;return Object.assign(Object.assign({},Mo),{wrapperElRef:b,inputElRef:u,inputMirrorElRef:h,inputEl2Ref:S,textareaElRef:d,textareaMirrorElRef:v,textareaScrollbarInstRef:I,rtlEnabled:Do,uncontrolledValue:ne,mergedValue:W,passwordVisible:X,mergedPlaceholder:M,showPlaceholder1:fe,showPlaceholder2:G,mergedFocus:Z,isComposing:D,activated:U,showClearButton:H,mergedSize:f,mergedDisabled:w,textDecorationStyle:he,mergedClsPrefix:s,mergedBordered:a,mergedShowPasswordOn:x,placeholderStyle:Qe,mergedStatus:O,textAreaScrollContainerWidth:N,handleTextAreaScroll:Io,handleCompositionStart:We,handleCompositionEnd:Le,handleInput:se,handleInputBlur:B,handleInputFocus:A,handleWrapperBlur:ce,handleWrapperFocus:go,handleMouseEnter:Co,handleMouseLeave:zo,handleMouseDown:wo,handleChange:mo,handleClick:xo,handleClear:yo,handlePasswordToggleClick:So,handlePasswordToggleMousedown:$o,handleWrapperKeydown:Po,handleWrapperKeyup:Bo,handleTextAreaMirrorResize:Eo,getTextareaScrollContainer:()=>d.value,mergedTheme:P,cssVars:m?void 0:Ze,themeClass:de?.themeClass,onRender:de?.onRender})},render(){var o,s;const{mergedClsPrefix:a,mergedStatus:m,themeClass:k,type:P,countGraphemes:b,onRender:d}=this,v=this.$slots;return d?.(),n("div",{ref:"wrapperElRef",class:[`${a}-input`,k,m&&`${a}-input--${m}-status`,{[`${a}-input--rtl`]:this.rtlEnabled,[`${a}-input--disabled`]:this.mergedDisabled,[`${a}-input--textarea`]:P==="textarea",[`${a}-input--resizable`]:this.resizable&&!this.autosize,[`${a}-input--autosize`]:this.autosize,[`${a}-input--round`]:this.round&&P!=="textarea",[`${a}-input--pair`]:this.pair,[`${a}-input--focus`]:this.mergedFocus,[`${a}-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.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},n("div",{class:`${a}-input-wrapper`},ue(v.prefix,h=>h&&n("div",{class:`${a}-input__prefix`},h)),P==="textarea"?n($r,{ref:"textareaScrollbarInstRef",class:`${a}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var h,u;const{textAreaScrollContainerWidth:S}=this,F={width:this.autosize&&S&&`${S}px`};return n(Fr,null,n("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${a}-input__textarea-el`,(h=this.inputProps)===null||h===void 0?void 0:h.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:b?void 0:this.maxlength,minlength:b?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(u=this.inputProps)===null||u===void 0?void 0:u.style,F],onBlur:this.handleInputBlur,onFocus:j=>{this.handleInputFocus(j,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?n("div",{class:`${a}-input__placeholder`,style:[this.placeholderStyle,F],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?n(Br,{onResize:this.handleTextAreaMirrorResize},{default:()=>n("div",{ref:"textareaMirrorElRef",class:`${a}-input__textarea-mirror`,key:"mirror"})}):null)}}):n("div",{class:`${a}-input__input`},n("input",Object.assign({type:P==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":P},this.inputProps,{ref:"inputElRef",class:[`${a}-input__input-el`,(o=this.inputProps)===null||o===void 0?void 0:o.class],style:[this.textDecorationStyle[0],(s=this.inputProps)===null||s===void 0?void 0:s.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:b?void 0:this.maxlength,minlength:b?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:h=>{this.handleInputFocus(h,0)},onInput:h=>{this.handleInput(h,0)},onChange:h=>{this.handleChange(h,0)}})),this.showPlaceholder1?n("div",{class:`${a}-input__placeholder`},n("span",null,this.mergedPlaceholder[0])):null,this.autosize?n("div",{class:`${a}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&ue(v.suffix,h=>h||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?n("div",{class:`${a}-input__suffix`},[ue(v["clear-icon-placeholder"],u=>(this.clearable||u)&&n(qe,{clsPrefix:a,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>u,icon:()=>{var S,F;return(F=(S=this.$slots)["clear-icon"])===null||F===void 0?void 0:F.call(S)}})),this.internalLoadingBeforeSuffix?null:h,this.loading!==void 0?n(Ur,{clsPrefix:a,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?h:null,this.showCount&&this.type!=="textarea"?n(to,null,{default:u=>{var S;return(S=v.count)===null||S===void 0?void 0:S.call(v,u)}}):null,this.mergedShowPasswordOn&&this.type==="password"?n("div",{class:`${a}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?me(v["password-visible-icon"],()=>[n(Re,{clsPrefix:a},{default:()=>n(Wr,null)})]):me(v["password-invisible-icon"],()=>[n(Re,{clsPrefix:a},{default:()=>n(Lr,null)})])):null]):null)),this.pair?n("span",{class:`${a}-input__separator`},me(v.separator,()=>[this.separator])):null,this.pair?n("div",{class:`${a}-input-wrapper`},n("div",{class:`${a}-input__input`},n("input",{ref:"inputEl2Ref",type:this.type,class:`${a}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:b?void 0:this.maxlength,minlength:b?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:h=>{this.handleInputFocus(h,1)},onInput:h=>{this.handleInput(h,1)},onChange:h=>{this.handleChange(h,1)}}),this.showPlaceholder2?n("div",{class:`${a}-input__placeholder`},n("span",null,this.mergedPlaceholder[1])):null),ue(v.suffix,h=>(this.clearable||h)&&n("div",{class:`${a}-input__suffix`},[this.clearable&&n(qe,{clsPrefix:a,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var u;return(u=v["clear-icon"])===null||u===void 0?void 0:u.call(v)},placeholder:()=>{var u;return(u=v["clear-icon-placeholder"])===null||u===void 0?void 0:u.call(v)}}),h]))):null,this.mergedBordered?n("div",{class:`${a}-input__border`}):null,this.mergedBordered?n("div",{class:`${a}-input__state-border`}):null,this.showCount&&P==="textarea"?n(to,null,{default:h=>{var u;const{renderCount:S}=this;return S?S(h):(u=v.count)===null||u===void 0?void 0:u.call(v,h)}}):null)}});function re(o){return lo(o,[255,255,255,.16])}function Be(o){return lo(o,[0,0,0,.12])}const et=so("n-button-group"),ot=g([z("button",`
margin: 0;
font-weight: var(--n-font-weight);
line-height: 1;
font-family: inherit;
padding: var(--n-padding);
height: var(--n-height);
font-size: var(--n-font-size);
border-radius: var(--n-border-radius);
color: var(--n-text-color);
background-color: var(--n-color);
width: var(--n-width);
white-space: nowrap;
outline: none;
position: relative;
z-index: auto;
border: none;
display: inline-flex;
flex-wrap: nowrap;
flex-shrink: 0;
align-items: center;
justify-content: center;
user-select: none;
-webkit-user-select: none;
text-align: center;
cursor: pointer;
text-decoration: none;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[_("color",[i("border",{borderColor:"var(--n-border-color)"}),_("disabled",[i("border",{borderColor:"var(--n-border-color-disabled)"})]),te("disabled",[g("&:focus",[i("state-border",{borderColor:"var(--n-border-color-focus)"})]),g("&:hover",[i("state-border",{borderColor:"var(--n-border-color-hover)"})]),g("&:active",[i("state-border",{borderColor:"var(--n-border-color-pressed)"})]),_("pressed",[i("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),_("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[i("border",{border:"var(--n-border-disabled)"})]),te("disabled",[g("&:focus",{backgroundColor:"var(--n-color-focus)",color:"var(--n-text-color-focus)"},[i("state-border",{border:"var(--n-border-focus)"})]),g("&:hover",{backgroundColor:"var(--n-color-hover)",color:"var(--n-text-color-hover)"},[i("state-border",{border:"var(--n-border-hover)"})]),g("&:active",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[i("state-border",{border:"var(--n-border-pressed)"})]),_("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[i("state-border",{border:"var(--n-border-pressed)"})])]),_("loading","cursor: wait;"),z("base-wave",`
pointer-events: none;
top: 0;
right: 0;
bottom: 0;
left: 0;
animation-iteration-count: 1;
animation-duration: var(--n-ripple-duration);
animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
`,[_("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),Te&&"MozBoxSizing"in document.createElement("div").style?g("&::moz-focus-inner",{border:0}):null,i("border, state-border",`
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: inherit;
transition: border-color .3s var(--n-bezier);
pointer-events: none;
`),i("border",{border:"var(--n-border)"}),i("state-border",{border:"var(--n-border)",borderColor:"#0000",zIndex:1}),i("icon",`
margin: var(--n-icon-margin);
margin-left: 0;
height: var(--n-icon-size);
width: var(--n-icon-size);
max-width: var(--n-icon-size);
font-size: var(--n-icon-size);
position: relative;
flex-shrink: 0;
`,[z("icon-slot",`
height: var(--n-icon-size);
width: var(--n-icon-size);
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
`,[fo({top:"50%",originalTransform:"translateY(-50%)"})]),Gr()]),i("content",`
display: flex;
align-items: center;
flex-wrap: nowrap;
min-width: 0;
`,[g("~",[i("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),_("block",`
display: flex;
width: 100%;
`),_("dashed",[i("border, state-border",{borderStyle:"dashed !important"})]),_("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),g("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),g("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),rt=Object.assign(Object.assign({},ke.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!po}}),tt=q({name:"Button",props:rt,setup(o){const s=R(null),a=R(null),m=R(!1),k=Ke(()=>!o.quaternary&&!o.tertiary&&!o.secondary&&!o.text&&(!o.color||o.ghost||o.dashed)&&o.bordered),P=co(et,{}),{mergedSizeRef:b}=uo({},{defaultSize:"medium",mergedSize:f=>{const{size:w}=o;if(w)return w;const{size:O}=P;if(O)return O;const{mergedSize:t}=f||{};return t?t.value:"medium"}}),d=V(()=>o.focusable&&!o.disabled),v=f=>{var w;d.value||f.preventDefault(),!o.nativeFocusBehavior&&(f.preventDefault(),!o.disabled&&d.value&&((w=s.value)===null||w===void 0||w.focus({preventScroll:!0})))},h=f=>{var w;if(!o.disabled&&!o.loading){const{onClick:O}=o;O&&E(O,f),o.text||(w=a.value)===null||w===void 0||w.play()}},u=f=>{switch(f.key){case"Enter":if(!o.keyboard)return;m.value=!1}},S=f=>{switch(f.key){case"Enter":if(!o.keyboard||o.loading){f.preventDefault();return}m.value=!0}},F=()=>{m.value=!1},{inlineThemeDisabled:j,mergedClsPrefixRef:I,mergedRtlRef:_e}=no(o),ne=ke("Button","-button",ot,Dr,o,I),Fe=ao("Button",_e,I),W=V(()=>{const f=ne.value,{common:{cubicBezierEaseInOut:w,cubicBezierEaseOut:O},self:t}=f,{rippleDuration:K,opacityDisabled:D,fontWeight:U,fontWeightStrong:Q}=t,M=b.value,{dashed:fe,type:G,ghost:Z,text:H,color:x,round:X,circle:he,textColor:N,secondary:Ae,tertiary:xe,quaternary:Ee,strong:ae}=o,ie={"font-weight":ae?Q:U};let $={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const le=G==="tertiary",ye=G==="default",p=le?"default":G;if(H){const B=N||x;$={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":B||t[c("textColorText",p)],"--n-text-color-hover":B?re(B):t[c("textColorTextHover",p)],"--n-text-color-pressed":B?Be(B):t[c("textColorTextPressed",p)],"--n-text-color-focus":B?re(B):t[c("textColorTextHover",p)],"--n-text-color-disabled":B||t[c("textColorTextDisabled",p)]}}else if(Z||fe){const B=N||x;$={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":x||t[c("rippleColor",p)],"--n-text-color":B||t[c("textColorGhost",p)],"--n-text-color-hover":B?re(B):t[c("textColorGhostHover",p)],"--n-text-color-pressed":B?Be(B):t[c("textColorGhostPressed",p)],"--n-text-color-focus":B?re(B):t[c("textColorGhostHover",p)],"--n-text-color-disabled":B||t[c("textColorGhostDisabled",p)]}}else if(Ae){const B=ye?t.textColor:le?t.textColorTertiary:t[c("color",p)],A=x||B,ce=G!=="default"&&G!=="tertiary";$={"--n-color":ce?Se(A,{alpha:Number(t.colorOpacitySecondary)}):t.colorSecondary,"--n-color-hover":ce?Se(A,{alpha:Number(t.colorOpacitySecondaryHover)}):t.colorSecondaryHover,"--n-color-pressed":ce?Se(A,{alpha:Number(t.colorOpacitySecondaryPressed)}):t.colorSecondaryPressed,"--n-color-focus":ce?Se(A,{alpha:Number(t.colorOpacitySecondaryHover)}):t.colorSecondaryHover,"--n-color-disabled":t.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":A,"--n-text-color-hover":A,"--n-text-color-pressed":A,"--n-text-color-focus":A,"--n-text-color-disabled":A}}else if(xe||Ee){const B=ye?t.textColor:le?t.textColorTertiary:t[c("color",p)],A=x||B;xe?($["--n-color"]=t.colorTertiary,$["--n-color-hover"]=t.colorTertiaryHover,$["--n-color-pressed"]=t.colorTertiaryPressed,$["--n-color-focus"]=t.colorSecondaryHover,$["--n-color-disabled"]=t.colorTertiary):($["--n-color"]=t.colorQuaternary,$["--n-color-hover"]=t.colorQuaternaryHover,$["--n-color-pressed"]=t.colorQuaternaryPressed,$["--n-color-focus"]=t.colorQuaternaryHover,$["--n-color-disabled"]=t.colorQuaternary),$["--n-ripple-color"]="#0000",$["--n-text-color"]=A,$["--n-text-color-hover"]=A,$["--n-text-color-pressed"]=A,$["--n-text-color-focus"]=A,$["--n-text-color-disabled"]=A}else $={"--n-color":x||t[c("color",p)],"--n-color-hover":x?re(x):t[c("colorHover",p)],"--n-color-pressed":x?Be(x):t[c("colorPressed",p)],"--n-color-focus":x?re(x):t[c("colorFocus",p)],"--n-color-disabled":x||t[c("colorDisabled",p)],"--n-ripple-color":x||t[c("rippleColor",p)],"--n-text-color":N||(x?t.textColorPrimary:le?t.textColorTertiary:t[c("textColor",p)]),"--n-text-color-hover":N||(x?t.textColorHoverPrimary:t[c("textColorHover",p)]),"--n-text-color-pressed":N||(x?t.textColorPressedPrimary:t[c("textColorPressed",p)]),"--n-text-color-focus":N||(x?t.textColorFocusPrimary:t[c("textColorFocus",p)]),"--n-text-color-disabled":N||(x?t.textColorDisabledPrimary:t[c("textColorDisabled",p)])};let ve={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};H?ve={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:ve={"--n-border":t[c("border",p)],"--n-border-hover":t[c("borderHover",p)],"--n-border-pressed":t[c("borderPressed",p)],"--n-border-focus":t[c("borderFocus",p)],"--n-border-disabled":t[c("borderDisabled",p)]};const{[c("height",M)]:pe,[c("fontSize",M)]:Ie,[c("padding",M)]:Me,[c("paddingRound",M)]:De,[c("iconSize",M)]:Ve,[c("borderRadius",M)]:We,[c("iconMargin",M)]:Le,waveOpacity:se}=t,Oe={"--n-width":he&&!H?pe:"initial","--n-height":H?"initial":pe,"--n-font-size":Ie,"--n-padding":he||H?"initial":X?De:Me,"--n-icon-size":Ve,"--n-icon-margin":Le,"--n-border-radius":H?"initial":he||X?pe:We};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":w,"--n-bezier-ease-out":O,"--n-ripple-duration":K,"--n-opacity-disabled":D,"--n-wave-opacity":se},ie),$),ve),Oe)}),L=j?io("button",V(()=>{let f="";const{dashed:w,type:O,ghost:t,text:K,color:D,round:U,circle:Q,textColor:M,secondary:fe,tertiary:G,quaternary:Z,strong:H}=o;w&&(f+="a"),t&&(f+="b"),K&&(f+="c"),U&&(f+="d"),Q&&(f+="e"),fe&&(f+="f"),G&&(f+="g"),Z&&(f+="h"),H&&(f+="i"),D&&(f+="j"+ro(D)),M&&(f+="k"+ro(M));const{value:x}=b;return f+="l"+x[0],f+="m"+O[0],f}),W,o):void 0;return{selfElRef:s,waveElRef:a,mergedClsPrefix:I,mergedFocusable:d,mergedSize:b,showBorder:k,enterPressed:m,rtlEnabled:Fe,handleMousedown:v,handleKeydown:S,handleBlur:F,handleKeyup:u,handleClick:h,customColorCssVars:V(()=>{const{color:f}=o;if(!f)return null;const w=re(f);return{"--n-border-color":f,"--n-border-color-hover":w,"--n-border-color-pressed":Be(f),"--n-border-color-focus":w,"--n-border-color-disabled":f}}),cssVars:j?void 0:W,themeClass:L?.themeClass,onRender:L?.onRender}},render(){const{mergedClsPrefix:o,tag:s,onRender:a}=this;a?.();const m=ue(this.$slots.default,k=>k&&n("span",{class:`${o}-button__content`},k));return n(s,{ref:"selfElRef",class:[this.themeClass,`${o}-button`,`${o}-button--${this.type}-type`,`${o}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${o}-button--rtl`,this.disabled&&`${o}-button--disabled`,this.block&&`${o}-button--block`,this.enterPressed&&`${o}-button--pressed`,!this.text&&this.dashed&&`${o}-button--dashed`,this.color&&`${o}-button--color`,this.secondary&&`${o}-button--secondary`,this.loading&&`${o}-button--loading`,this.ghost&&`${o}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&m,n(Vr,{width:!0},{default:()=>ue(this.$slots.icon,k=>(this.loading||this.renderIcon||k)&&n("span",{class:`${o}-button__icon`,style:{margin:Pr(this.$slots.default)?"0":""}},n(ho,null,{default:()=>this.loading?n(vo,{clsPrefix:o,key:"loading",class:`${o}-icon-slot`,strokeWidth:20}):n("div",{key:"icon",class:`${o}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():k)})))}),this.iconPlacement==="left"&&m,this.text?null:n(jr,{ref:"waveElRef",clsPrefix:o}),this.showBorder?n("div",{"aria-hidden":!0,class:`${o}-button__border`,style:this.customColorCssVars}):null,this.showBorder?n("div",{"aria-hidden":!0,class:`${o}-button__state-border`,style:this.customColorCssVars}):null)}}),wt=tt;export{tt as B,yt as N,wt as X,et as b};