UNPKG

cc-ui-plus

Version:

24 lines (22 loc) 48.9 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");function T(r,e){return r.install=n=>{n.component(e,r)},r}const Ae=(r,e)=>(r.install=n=>{r._context=n._context,n.config.globalProperties[e]=r},r);function Oe(r){let e=0;for(let n=0;n<r.length;++n)r[n]==="&"&&++e;return e}const he=/\s*,(?![^(]*\))\s*/g,Se=/\s+/g;function Te(r,e){const n=[];return e.split(he).forEach(a=>{let o=Oe(a);if(o){if(o===1){r.forEach(i=>{n.push(a.replace("&",i))});return}}else{r.forEach(i=>{n.push((i&&i+" ")+a)});return}let l=[a];for(;o--;){const i=[];l.forEach(s=>{r.forEach(c=>{i.push(s.replace("&",c))})}),l=i}l.forEach(i=>n.push(i))}),n}function Pe(r,e){const n=[];return e.split(he).forEach(a=>{r.forEach(o=>{n.push((o&&o+" ")+a)})}),n}function je(r){let e=[""];return r.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=Te(e,n):e=Pe(e,n))}),e.join(", ").replace(Se," ")}const Me=/[A-Z]/g;function ge(r){return r.replace(Me,e=>"-"+e.toLowerCase())}function Re(r,e=" "){return typeof r=="object"&&r!==null?` { `+Object.entries(r).map(n=>e+` ${ge(n[0])}: ${n[1]};`).join(` `)+` `+e+"}":`: ${r};`}function Ie(r,e,n){return typeof r=="function"?r({context:e.context,props:n}):r}function le(r,e,n,a){if(!e)return"";const o=Ie(e,n,a);if(!o)return"";if(typeof o=="string")return`${r} { ${o} }`;const l=Object.keys(o);if(l.length===0)return n.config.keepEmptyBlock?r+` { }`:"";const i=r?[r+" {"]:[];return l.forEach(s=>{const c=o[s];if(s==="raw"){i.push(` `+c+` `);return}s=ge(s),c!=null&&i.push(` ${s}${Re(c)}`)}),r&&i.push("}"),i.join(` `)}function Y(r,e,n){!r||r.forEach(a=>{if(Array.isArray(a))Y(a,e,n);else if(typeof a=="function"){const o=a(e);Array.isArray(o)?Y(o,e,n):o&&n(o)}else a&&n(a)})}function ve(r,e,n,a,o,l){const i=r.$;!i||typeof i=="string"?e.push(i):typeof i=="function"?e.push(i({context:a.context,props:o})):(i.before&&i.before(a.context),!i.$||typeof i.$=="string"?e.push(i.$):i.$&&e.push(i.$({context:a.context,props:o})));const s=je(e),c=le(s,r.props,a,o);l&&c&&l.insertRule(c),!l&&c.length&&n.push(c),r.children&&Y(r.children,{context:a.context,props:o},d=>{if(typeof d=="string"){const g=le(s,{raw:d},a,o);l?l.insertRule(g):n.push(g)}else ve(d,e,n,a,o,l)}),e.pop(),i&&i.after&&i.after(a.context)}function ye(r,e,n,a=!1){const o=[];return ve(r,[],o,e,n,a?r.instance.__styleSheet:void 0),a?"":o.join(` `)}function Le(r){for(var e=0,n,a=0,o=r.length;o>=4;++a,o-=4)n=r.charCodeAt(a)&255|(r.charCodeAt(++a)&255)<<8|(r.charCodeAt(++a)&255)<<16|(r.charCodeAt(++a)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(r.charCodeAt(a+2)&255)<<16;case 2:e^=(r.charCodeAt(a+1)&255)<<8;case 1:e^=r.charCodeAt(a)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Q(r){if(!r)return;const e=r.parentElement;e&&e.removeChild(r)}function ie(r){return document.querySelector(`style[cssr-id="${r}"]`)}function De(r){const e=document.createElement("style");return e.setAttribute("cssr-id",r),e}window&&(window.__cssrContext={});function we(r){const e=r.getAttribute("mount-count");return e===null?null:Number(e)}function G(r,e){r.setAttribute("mount-count",String(e))}function se(r,e,n,a){const{els:o}=e;if(n===void 0)o.forEach(Q),e.els=[];else{const l=ie(n);if(l&&o.includes(l)){const i=we(l);a?i===null?console.error(`[css-render/unmount]: The style with target='${n}' is mounted in count mode.`):i<=1?(Q(l),e.els=o.filter(s=>s!==l)):G(l,i-1):i!==null?console.error(`[css-render/unmount]: The style with target='${n}' is mounted in no-count mode.`):(Q(l),e.els=o.filter(s=>s!==l))}}}function We(r,e){r.push(e)}function Ue(r,e,n,a,o,l,i,s,c){if(i&&!c){if(n===void 0){console.error("[css-render/mount]: `id` is required in `boost` mode.");return}const w=window.__cssrContext;w[n]||(w[n]=!0,ye(e,r,a,i));return}let d;const{els:g}=e;let f;if(n===void 0&&(f=e.render(a),n=Le(f)),c){c(n,f!=null?f:e.render(a));return}const p=ie(n);if(s||p===null){if(d=p===null?De(n):p,f===void 0&&(f=e.render(a)),d.textContent=f,p!==null)return;if(o){const w=document.head.getElementsByTagName("style")[0]||null;document.head.insertBefore(d,w)}else document.head.appendChild(d);l&&G(d,1),We(g,d)}else{const w=we(p);l?w===null?console.error(`[css-render/mount]: The style with id='${n}' has been mounted in no-count mode.`):G(p,w+1):w!==null&&console.error(`[css-render/mount]: The style with id='${n}' has been mounted in count mode.`)}return p!=null?p:d}function Ze(r){return ye(this,this.instance,r)}function Je(r={}){const{target:e,id:n,ssr:a,props:o,count:l=!1,head:i=!1,boost:s=!1,force:c=!1}=r;return Ue(this.instance,this,n!=null?n:e,o,i,l,s,c,a)}function Ke(r={}){const{id:e,target:n,delay:a=0,count:o=!1}=r;a===0?se(this.instance,this,e!=null?e:n,o):setTimeout(()=>se(this.instance,this,e!=null?e:n,o),a)}const U=function(r,e,n,a){return{instance:r,$:e,props:n,children:a,els:[],render:Ze,mount:Je,unmount:Ke}},Qe=function(r,e,n,a){return Array.isArray(e)?U(r,{$:null},null,e):Array.isArray(n)?U(r,e,null,n):Array.isArray(a)?U(r,e,n,a):U(r,e,n,null)};function Xe(r={}){let e=null;const n={c:(...a)=>Qe(n,...a),use:(a,...o)=>a.install(n,...o),find:ie,context:{},config:r,get __styleSheet(){if(!e){const a=document.createElement("style");return document.head.appendChild(a),e=document.styleSheets[document.styleSheets.length-1],e}return e}};return n}const{c:X}=Xe(),He=X(".xicon",{width:"1em",height:"1em",display:"inline-flex"},[X("svg",{width:"1em",height:"1em"}),X("svg:not([fill])",{fill:"currentColor"})]),Ye=()=>{He.mount({id:"xicons-icon"})},xe={size:[String,Number],color:String,tag:String},be=Symbol("IconConfigInjection");t.defineComponent({name:"IconConfigProvider",props:xe,setup(r,{slots:e}){return t.provide(be,r),()=>t.renderSlot(e,"default")}});const Ge="span",et=t.defineComponent({name:"Icon",props:xe,setup(r,{slots:e}){const n=t.inject(be,null),a=t.computed(()=>{var i;const s=(i=r.size)!==null&&i!==void 0?i:n==null?void 0:n.size;if(s!==void 0)return typeof s=="number"||/^\d+$/.test(s)?`${s}px`:s}),o=t.computed(()=>{const{color:i}=r;return i===void 0?n?n.color:void 0:i}),l=t.computed(()=>{var i;const{tag:s}=r;return s===void 0?(i=n==null?void 0:n.tag)!==null&&i!==void 0?i:Ge:s});return t.onBeforeMount(()=>{Ye()}),()=>t.h(l.value,{class:"xicon",style:{color:o.value,fontSize:a.value}},[t.renderSlot(e,"default")])}}),tt=t.defineComponent({__name:"icon",props:{color:{default:"inherit"},size:{default:16},tag:{default:"span"}},setup(r){return(e,n)=>(t.openBlock(),t.createBlock(t.unref(et),{size:r.size,color:r.color,tag:r.tag},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["size","color","tag"]))}}),N=T(tt,"cc-icon");function Z(r,e,n){let a=r;return e&&(a+=`__${e}`),n&&(a+=`--${n}`),a}function D(r){const e=`cc-${r}`;return{b:()=>Z(e),e:i=>i?Z(e,i):"",m:i=>i?Z(e,"",i):"",em:(i,s)=>i&&s?Z(e,i,s):""}}const nt=(r,e)=>{if(e.value==="")return"";if(e.value==="small")return r.m("small");if(e.value==="large")return r.m("large")},rt=(r,e)=>{if(e.value==="")return r.m("default");if(e.value==="primary")return r.m("primary");if(e.value==="success")return r.m("success");if(e.value==="warning")return r.m("warning");if(e.value==="danger")return r.m("danger");if(e.value==="info")return r.m("info")},at=["nativeType","onClick"],ot=t.defineComponent({__name:"button",props:{size:{default:""},type:{default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},nativeType:{default:"button"},icon:null},emits:["click"],setup(r,{emit:e}){const n=r,a=D("button"),o=f=>{n.disabled||e("click",f)},l=nt(a,t.computed(()=>n.size)),i=rt(a,t.computed(()=>n.type)),s=t.computed(()=>n.plain?"is-plain":""),c=t.computed(()=>n.round?"is-round":""),d=t.computed(()=>n.disabled?"is-disabled":""),g=t.computed(()=>n.circle?"is-circle":"");return(f,p)=>(t.openBlock(),t.createElementBlock("button",{nativeType:r.nativeType,class:t.normalizeClass([t.unref(a).b(),t.unref(l),t.unref(i),t.unref(s),t.unref(c),t.unref(d),t.unref(g)]),onClick:t.withModifiers(o,["prevent","stop"])},[r.icon?(t.openBlock(),t.createBlock(t.unref(N),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.icon),{color:r.type?"#fff":"#000"},null,8,["color"]))]),_:1})):t.createCommentVNode("",!0),f.$slots.default?(t.openBlock(),t.createElementBlock("span",{key:1,style:t.normalizeStyle({marginLeft:r.icon?"8px":"0"})},[t.renderSlot(f.$slots,"default")],4)):t.createCommentVNode("",!0)],10,at))}}),Ce=T(ot,"cc-button"),it={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},lt=t.createElementVNode("path",{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0 0 51.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z",fill:"currentColor"},null,-1),st=t.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"},null,-1),ct=[lt,st],ut=t.defineComponent({name:"CheckCircleOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",it,ct)}}),ft={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},dt=t.createElementVNode("path",{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4l-66.1-.3c-4.4 0-8 3.5-8 8c0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 0 0-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4l66 .3c4.4 0 8-3.5 8-8c0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z",fill:"currentColor"},null,-1),mt=t.createElementVNode("path",{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448s448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"},null,-1),pt=[dt,mt],ke=t.defineComponent({name:"CloseCircleOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",ft,pt)}}),ht={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},gt=t.createElementVNode("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8L295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512L196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1l216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z",fill:"currentColor"},null,-1),vt=[gt],Ee=t.defineComponent({name:"CloseOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",ht,vt)}}),yt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},wt=t.createElementVNode("path",{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512C791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5zm-63.57-320.64L836 122.88a8 8 0 0 0-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 0 0 0 11.31L155.17 889a8 8 0 0 0 11.31 0l712.15-712.12a8 8 0 0 0 0-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 0 0-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 0 1 146.2-106.69L401.31 546.2A112 112 0 0 1 396 512z",fill:"currentColor"},null,-1),xt=t.createElementVNode("path",{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 0 0 227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 0 1-112 112z",fill:"currentColor"},null,-1),bt=[wt,xt],Ct=t.defineComponent({name:"EyeInvisibleOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",yt,bt)}}),kt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},Et=t.createElementVNode("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3c7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112s112 50.1 112 112s-50.1 112-112 112z",fill:"currentColor"},null,-1),Bt=[Et],$t=t.defineComponent({name:"EyeOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",kt,Bt)}}),Vt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},Nt=t.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"},null,-1),Ft=t.createElementVNode("path",{d:"M464 336a48 48 0 1 0 96 0a48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z",fill:"currentColor"},null,-1),_t=[Nt,Ft],qt=t.defineComponent({name:"InfoCircleOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",Vt,_t)}}),zt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},At=t.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281l360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"},null,-1),Ot=[At],St=t.defineComponent({name:"LeftOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",zt,Ot)}}),Tt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},Pt=t.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1l-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"},null,-1),jt=[Pt],Mt=t.defineComponent({name:"RightOutlined",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",Tt,jt)}}),Rt=["maxlength"],It=["type","placeholder","readonly","disabled","maxlength"],Lt=t.defineComponent({__name:"input",props:{modelValue:null,type:{default:"text"},placeholder:{default:""},maxlength:null,minlength:null,clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},prefixIcon:null,suffixIcon:null,rows:{default:1}},emits:["update:modelValue","input","blur","focus","clear","change"],setup(r,{expose:e,emit:n}){const a=r,o=D("input"),l=t.inject("setValidateChangeFlag",void 0),i=t.inject("setValidateBlurFlag",void 0),s=t.ref(0),c=t.ref(0),d=t.ref(),g=t.ref(a.showPassword),f=t.ref(a.modelValue),p=async()=>{var u;await t.nextTick(),(u=d.value)==null||u.focus()},w=()=>{var u;return(u=d.value)==null?void 0:u.blur()},E=u=>{a.disabled||(n("update:modelValue",u.target.value),n("input",u.target.value),s.value++,l==null||l(s.value))},h=u=>{a.disabled||(n("blur",u),c.value++,i==null||i(c.value))},k=u=>{a.disabled||(l==null||l(0),i==null||i(0),n("focus",u))},m=u=>{n("change",u.target.value)},V=u=>{n("update:modelValue",""),n("clear",u),p()},v=()=>{g.value=!g.value,p()};return t.watch(()=>a.modelValue,u=>{f.value=u}),e({foucs:p,blur:w}),(u,x)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(o).b(),{"is-disabled":r.disabled}])},[t.createElementVNode("div",{class:t.normalizeClass([t.unref(o).e("wrapper"),`${r.disabled?t.unref(o).e("wrapper-disabled"):""}`]),style:t.normalizeStyle({padding:r.type==="textarea"?"0":"0px 12px"})},[u.$slots.prefix||r.prefixIcon?(t.openBlock(),t.createElementBlock("span",{key:0,style:{color:"#a8abb2"},class:t.normalizeClass([t.unref(o).e("wrapper-content")])},[t.createElementVNode("span",null,[r.prefixIcon?(t.openBlock(),t.createBlock(t.unref(N),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.prefixIcon)))]),_:1})):t.renderSlot(u.$slots,"prefix",{key:1})])],2)):t.createCommentVNode("",!0),r.type==="textarea"?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:1,"onUpdate:modelValue":x[0]||(x[0]=y=>f.value=y),class:t.normalizeClass([t.unref(o).e("textarea")]),style:t.normalizeStyle([{height:40*Number(r.rows)+"px"},{width:"100%"}]),maxlength:r.maxlength,onInput:E,onBlur:h,onFocus:k,onChange:m},null,46,Rt)),[[t.vModelText,f.value]]):t.createCommentVNode("",!0),r.type==="text"?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:2,ref_key:"inputRef",ref:d,"onUpdate:modelValue":x[1]||(x[1]=y=>f.value=y),type:`${g.value?"password":r.type}`,placeholder:r.placeholder,readonly:r.readonly,disabled:r.disabled,maxlength:Number(r.maxlength),class:t.normalizeClass([t.unref(o).e("input"),`${r.disabled?t.unref(o).e("input-disabled"):""}`]),onInput:E,onBlur:h,onFocus:k,onChange:m},null,42,It)),[[t.vModelDynamic,f.value]]):t.createCommentVNode("",!0),u.$slots.suffix||r.suffixIcon?(t.openBlock(),t.createElementBlock("span",{key:3,style:{color:"#a8abb2"},class:t.normalizeClass([t.unref(o).e("input-wrapper")])},[t.createElementVNode("span",null,[r.suffixIcon?(t.openBlock(),t.createBlock(t.unref(N),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.suffixIcon)))]),_:1})):t.renderSlot(u.$slots,"suffix",{key:1})])],2)):t.createCommentVNode("",!0),r.clearable&&r.modelValue.length?(t.openBlock(),t.createElementBlock("span",{key:4,style:{color:"#a8abb2"},class:t.normalizeClass([t.unref(o).e("clear")]),onClick:V},[t.createElementVNode("span",null,[t.createVNode(t.unref(N),null,{default:t.withCtx(()=>[t.createVNode(t.unref(ke))]),_:1})])],2)):t.createCommentVNode("",!0),r.showPassword&&f.value.length?(t.openBlock(),t.createElementBlock("span",{key:5,style:{color:"#a8abb2"},class:t.normalizeClass([t.unref(o).e("password")]),onClick:v},[t.createElementVNode("span",null,[t.createVNode(t.unref(N),null,{default:t.withCtx(()=>[g.value?(t.openBlock(),t.createBlock(t.unref($t),{key:0})):(t.openBlock(),t.createBlock(t.unref(Ct),{key:1}))]),_:1})])],2)):t.createCommentVNode("",!0),r.maxlength&&r.showWordLimit?(t.openBlock(),t.createElementBlock("div",{key:6,class:t.normalizeClass([t.unref(o).e("limit")])},t.toDisplayString(f.value.length)+" / "+t.toDisplayString(r.maxlength),3)):t.createCommentVNode("",!0)],6)],2))}}),Be=T(Lt,"cc-input"),Dt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Wt=t.createElementVNode("path",{d:"M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2zm0 26a12 12 0 1 1 12-12a12 12 0 0 1-12 12z",fill:"currentColor"},null,-1),Ut=t.createElementVNode("path",{d:"M15 8h2v11h-2z",fill:"currentColor"},null,-1),Zt=t.createElementVNode("path",{d:"M16 22a1.5 1.5 0 1 0 1.5 1.5A1.5 1.5 0 0 0 16 22z",fill:"currentColor"},null,-1),Jt=[Wt,Ut,Zt],Kt=t.defineComponent({name:"Warning",render:function(e,n){return t.openBlock(),t.createElementBlock("svg",Dt,Jt)}}),Qt=["onClick"],Xt=t.defineComponent({__name:"message",props:{message:{default:""},type:{default:"info"},center:{type:Boolean,default:!1},showClose:{type:Boolean,default:!1},offset:{default:20}},setup(r,{expose:e}){const n=r,a=D("message"),o=t.ref(!1),l=t.ref(!1),i=t.ref(n.offset),s=(p,w=300)=>new Promise(E=>{o.value=p,setTimeout(()=>{E("")},w)}),c=p=>{i.value=p},d=p=>{l.value=p},g=()=>{d(!0),s(!1,0)};e({setVisible:s,setTop:c,setCloseFlag:d,closeFlag:l});const f=t.computed(()=>n.type==="success"?"bg-success":n.type==="info"?"bg-info":n.type==="danger"?"bg-danger":n.type==="warning"?"bg-warning":"");return(p,w)=>(t.openBlock(),t.createBlock(t.Transition,{name:"cc-message"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{style:t.normalizeStyle({top:i.value+"px"}),class:t.normalizeClass([t.unref(a).b(),t.unref(f),r.center?t.unref(a).m("center"):""])},[t.createElementVNode("div",{class:t.normalizeClass([t.unref(a).e("icon")])},[r.type==="success"?(t.openBlock(),t.createBlock(t.unref(N),{key:0,color:"var(--cc-color-success)"},{default:t.withCtx(()=>[t.createVNode(t.unref(ut))]),_:1})):t.createCommentVNode("",!0),r.type==="warning"?(t.openBlock(),t.createBlock(t.unref(N),{key:1,color:"var(--cc-color-warning)"},{default:t.withCtx(()=>[t.createVNode(t.unref(Kt))]),_:1})):t.createCommentVNode("",!0),r.type==="info"?(t.openBlock(),t.createBlock(t.unref(N),{key:2,color:"var(--cc-color-info)"},{default:t.withCtx(()=>[t.createVNode(t.unref(qt))]),_:1})):t.createCommentVNode("",!0),r.type==="danger"?(t.openBlock(),t.createBlock(t.unref(N),{key:3,color:"var(--cc-color-danger)"},{default:t.withCtx(()=>[t.createVNode(t.unref(ke))]),_:1})):t.createCommentVNode("",!0)],2),t.createElementVNode("div",null,t.toDisplayString(r.message),1),r.showClose?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(a).e("close-btn")]),onClick:t.withModifiers(g,["stop"])},[t.createVNode(t.unref(N),{color:"var(--cc-message-close-icon-color)",size:"var(--cc-message-close-icon-size)"},{default:t.withCtx(()=>[t.createVNode(t.unref(Ee))]),_:1})],10,Qt)):t.createCommentVNode("",!0)],6),[[t.vShow,o.value]])]),_:1}))}}),Ht=60,Yt=28,O=t.ref([]),F=r=>{typeof r=="string"&&(r={message:r,duration:3e3});const e=t.createApp(Xt,r);Gt(e,r.duration)},Gt=(r,e=3e3)=>{const n=document.createDocumentFragment(),a=r.mount(n);O.value.push(a),ce(a),a.setVisible(!0),t.watch(()=>O.value,()=>ce(a)),document.body.appendChild(n),en(r,a,e)},en=(r,e,n=3e3)=>{t.watch(()=>e.closeFlag,a=>{a&&(e.closeTimer=setTimeout(()=>{r.unmount(),O.value=O.value.filter(o=>o!==e),clearTimeout(e.closeTimer),e.closeTimer=null,e.closeFlag=!1},300))}),e.timer=setTimeout(async()=>{await e.setVisible(!1),r.unmount(),O.value=O.value.filter(a=>a!==e),clearTimeout(e.timer),e.timer=null},n)},ce=r=>{const e=O.value.indexOf(r);r.setTop(Ht*e+Yt)};F.success=r=>{F(typeof r=="string"?{type:"success",message:r}:{type:"success",message:r.message,...r})};F.info=r=>{F(typeof r=="string"?{type:"info",message:r}:{type:"info",message:r.message,...r})};F.warning=r=>{F(typeof r=="string"?{type:"warning",message:r}:{type:"warning",message:r.message,...r})};F.error=r=>{F(typeof r=="string"?{type:"danger",message:r}:{type:"danger",message:r.message,...r})};const tn=Ae(F,"$message"),ee=Symbol("TabsProvide"),nn={style:{overflow:"hidden"}},rn=["id","onClick"],an={key:1},on=["onClick"],ln=["onClick"],sn=t.defineComponent({__name:"tabs",props:{modelValue:null,type:{default:""},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1}},emits:["update:modelValue","tab-click","tab-remove","tab-change"],setup(r,{emit:e}){var v;const n=r,a=D("tabs"),o=(v=t.getCurrentInstance())==null?void 0:v.uid,l=t.ref([]),i=t.ref(n.modelValue),s=t.ref(""),c=t.ref(""),d=t.ref(),g=t.ref(),f=t.ref(!1),p=t.ref(0),w=u=>{u.disabled||l.value.push(u)},E=(u,x)=>{l.value.length===1?(i.value="",l.value=[]):(x===l.value.length-1&&x>=0&&(i.value=l.value[x-1].name),l.value=l.value.filter(y=>y.name!==u),e("tab-remove",u))},h=(u,x)=>{u.disabled||(i.value=u.name,k(i.value,!0),e("tab-click",u,x))},k=(u,x=!1)=>{u&&t.nextTick(()=>{const y=document.querySelector(`#tab-${u}-${o}`),C=window.getComputedStyle(y,null),$=Number(C.paddingLeft.replace("px","")),A=Number(C.paddingRight.replace("px","")),P=Number(C.width.replace("px",""));s.value=`${P-$-A}px`,x&&(c.value=`${y.offsetLeft+$}px`)})},m=()=>{p.value=0},V=()=>{t.nextTick(()=>{const u=Number(window.getComputedStyle(d.value,null).width.replace("px",""));let x=0;for(let y=0;y<l.value.length;y++)x+=Number(window.getComputedStyle(document.querySelector(`#tab-${l.value[y].name}-${o}`)).width.replace("px",""));p.value=-(x-u+20*2)})};return t.watch(()=>n.modelValue,u=>{i.value=u,e("tab-change",u)}),t.watch(()=>i.value,u=>{t.nextTick(()=>{k(u)})},{immediate:!0}),t.watch(()=>l.value,u=>{let x=0;t.nextTick(()=>{const y=Number(window.getComputedStyle(d.value,null).width.replace("px",""));u.forEach(C=>{x+=Number(window.getComputedStyle(document.querySelector(`#tab-${C.name}-${o}`)).width.replace("px",""))}),f.value=x>y})},{deep:!0}),t.provide(ee,{addTabPaneContext:w,currentName:t.computed(()=>i.value)}),(u,x)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(a).b()])},[t.createElementVNode("div",{ref_key:"wrap",ref:d,class:t.normalizeClass([t.unref(a).e("wrap")]),style:t.normalizeStyle({padding:f.value?"0 20px":"0"})},[f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(a).e("icon-left")]),onClick:m},[t.createVNode(t.unref(N),null,{default:t.withCtx(()=>[t.createVNode(t.unref(St))]),_:1})],2)):t.createCommentVNode("",!0),t.createElementVNode("div",nn,[t.createElementVNode("div",{ref_key:"label",ref:g,class:t.normalizeClass([t.unref(a).e("label")]),style:t.normalizeStyle({transform:`translateX(${p.value}px)`})},[r.type?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(a).e("active-bar")]),style:t.normalizeStyle({width:s.value,transform:`translateX(${c.value})`})},null,6)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(y,C)=>(t.openBlock(),t.createElementBlock("div",{id:`tab-${y.name}-${t.unref(o)}`,key:y.name,class:t.normalizeClass([t.unref(a).e("label-item"),t.unref(a).m(`${r.type}`),,{"is-disabled":y.disabled}]),style:t.normalizeStyle({color:y.name===i.value?"var(--cc-color-primary)":"inherit",paddingLeft:C===0&&!r.type?0:"12px"}),onClick:$=>h(y,$)},[y.slot?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(y.slot),{key:0})):(t.openBlock(),t.createElementBlock("span",an,t.toDisplayString(y.label),1)),r.closable||y.closable?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass([t.unref(a).e("close-btn")]),onClick:t.withModifiers($=>E(y.name,C),["stop"])},[t.createVNode(t.unref(N),null,{default:t.withCtx(()=>[t.createVNode(t.unref(Ee))]),_:1})],10,on)):t.createCommentVNode("",!0)],14,rn))),128))],6)]),f.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass([t.unref(a).e("icon-right")]),onClick:t.withModifiers(V,["stop"])},[t.createVNode(t.unref(N),null,{default:t.withCtx(()=>[t.createVNode(t.unref(Mt))]),_:1})],10,ln)):t.createCommentVNode("",!0)],6),t.createElementVNode("div",{class:t.normalizeClass([t.unref(a).e("content")])},[t.renderSlot(u.$slots,"default")],2)],2))}}),cn={style:{display:"none"}},un=t.defineComponent({__name:"tab-pane",props:{label:{default:""},name:null,disabled:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},setup(r){var o,l;const e=r,n=(o=t.inject(ee))==null?void 0:o.addTabPaneContext,a=(l=t.inject(ee))==null?void 0:l.currentName;return n({label:t.computed(()=>e.label).value,name:t.computed(()=>e.name).value,disabled:t.computed(()=>e.disabled).value,closable:t.computed(()=>e.closable).value,slot:t.useSlots().label}),(i,s)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",null,[t.renderSlot(i.$slots,"default"),t.createElementVNode("div",cn,[i.$slots.label?t.renderSlot(i.$slots,"label",{key:0}):t.createCommentVNode("",!0)])],512)),[[t.vShow,t.unref(a)===r.name]])}}),fn=T(sn,"cc-tabs"),dn=T(un,"cc-tab-pane"),mn={Tabs:fn,TabPane:dn},pn=t.defineComponent({__name:"form",props:{model:null,rules:null,labelWidth:{default:""},inline:{type:Boolean,default:!1}},setup(r,{expose:e}){const n=r,a=t.ref([]),o=d=>{a.value.push(d)};return e({validate:d=>{if(a.value&&a.value.length){const g=a.value.map(f=>f.validate());Promise.all(g).then(f=>{const p=f.every(w=>w===!0);d(p)}).catch(()=>d(!1))}},resetFields:()=>{a.value&&a.value.length&&a.value.forEach(d=>{d.resetField()})},validateField:(d,g)=>{var f;if(a.value&&a.value.length){const p=(f=a.value.find(w=>w.name===d))==null?void 0:f.validate();Promise.all([p]).then(w=>{const E=w.every(h=>h===!0);g(E)}).catch(()=>g(!1))}},clearValidate:d=>{a.value&&a.value.length&&a.value.find(f=>f.name===d).clearValidate()}}),t.provide("labelWidth",t.computed(()=>n.labelWidth)),t.provide("model",t.computed(()=>n.model)),t.provide("rules",t.computed(()=>n.rules)),t.provide("inline",t.computed(()=>n.inline)),t.provide("addFiled",o),(d,g)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["w-full",[`${r.inline?"inline-flex":""}`]])},[t.renderSlot(d.$slots,"default")],2))}});function S(){return S=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},S.apply(this,arguments)}function hn(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,L(r,e)}function te(r){return te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},te(r)}function L(r,e){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,o){return a.__proto__=o,a},L(r,e)}function gn(){if(typeof Reflect>"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 K(r,e,n){return gn()?K=Reflect.construct.bind():K=function(o,l,i){var s=[null];s.push.apply(s,l);var c=Function.bind.apply(o,s),d=new c;return i&&L(d,i.prototype),d},K.apply(null,arguments)}function vn(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function ne(r){var e=typeof Map=="function"?new Map:void 0;return ne=function(a){if(a===null||!vn(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(a))return e.get(a);e.set(a,o)}function o(){return K(a,arguments,te(this).constructor)}return o.prototype=Object.create(a.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),L(o,a)},ne(r)}var yn=/%[sdj%]/g,$e=function(){};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&($e=function(e,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(a){return typeof a=="string"})&&console.warn(e,n)});function re(r){if(!r||!r.length)return null;var e={};return r.forEach(function(n){var a=n.field;e[a]=e[a]||[],e[a].push(n)}),e}function q(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a<e;a++)n[a-1]=arguments[a];var o=0,l=n.length;if(typeof r=="function")return r.apply(null,n);if(typeof r=="string"){var i=r.replace(yn,function(s){if(s==="%%")return"%";if(o>=l)return s;switch(s){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch{return"[Circular]"}break;default:return s}});return i}return r}function wn(r){return r==="string"||r==="url"||r==="hex"||r==="email"||r==="date"||r==="pattern"}function B(r,e){return!!(r==null||e==="array"&&Array.isArray(r)&&!r.length||wn(e)&&typeof r=="string"&&!r)}function xn(r,e,n){var a=[],o=0,l=r.length;function i(s){a.push.apply(a,s||[]),o++,o===l&&n(a)}r.forEach(function(s){e(s,i)})}function ue(r,e,n){var a=0,o=r.length;function l(i){if(i&&i.length){n(i);return}var s=a;a=a+1,s<o?e(r[s],l):n([])}l([])}function bn(r){var e=[];return Object.keys(r).forEach(function(n){e.push.apply(e,r[n]||[])}),e}var fe=function(r){hn(e,r);function e(n,a){var o;return o=r.call(this,"Async Validation Error")||this,o.errors=n,o.fields=a,o}return e}(ne(Error));function Cn(r,e,n,a,o){if(e.first){var l=new Promise(function(p,w){var E=function(m){return a(m),m.length?w(new fe(m,re(m))):p(o)},h=bn(r);ue(h,n,E)});return l.catch(function(p){return p}),l}var i=e.firstFields===!0?Object.keys(r):e.firstFields||[],s=Object.keys(r),c=s.length,d=0,g=[],f=new Promise(function(p,w){var E=function(k){if(g.push.apply(g,k),d++,d===c)return a(g),g.length?w(new fe(g,re(g))):p(o)};s.length||(a(g),p(o)),s.forEach(function(h){var k=r[h];i.indexOf(h)!==-1?ue(k,n,E):xn(k,n,E)})});return f.catch(function(p){return p}),f}function kn(r){return!!(r&&r.message!==void 0)}function En(r,e){for(var n=r,a=0;a<e.length;a++){if(n==null)return n;n=n[e[a]]}return n}function de(r,e){return function(n){var a;return r.fullFields?a=En(e,r.fullFields):a=e[n.field||r.fullField],kn(n)?(n.field=n.field||r.fullField,n.fieldValue=a,n):{message:typeof n=="function"?n():n,fieldValue:a,field:n.field||r.fullField}}}function me(r,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];typeof a=="object"&&typeof r[n]=="object"?r[n]=S({},r[n],a):r[n]=a}}return r}var Ve=function(e,n,a,o,l,i){e.required&&(!a.hasOwnProperty(e.field)||B(n,i||e.type))&&o.push(q(l.messages.required,e.fullField))},Bn=function(e,n,a,o,l){(/^\s+$/.test(n)||n==="")&&o.push(q(l.messages.whitespace,e.fullField))},J,$n=function(){if(J)return J;var r="[a-fA-F\\d:]",e=function(u){return u&&u.includeBoundaries?"(?:(?<=\\s|^)(?="+r+")|(?<="+r+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",a="[a-fA-F\\d]{1,4}",o=(` (?: (?:`+a+":){7}(?:"+a+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 (?:`+a+":){6}(?:"+n+"|:"+a+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 (?:`+a+":){5}(?::"+n+"|(?::"+a+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 (?:`+a+":){4}(?:(?::"+a+"){0,1}:"+n+"|(?::"+a+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 (?:`+a+":){3}(?:(?::"+a+"){0,2}:"+n+"|(?::"+a+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 (?:`+a+":){2}(?:(?::"+a+"){0,3}:"+n+"|(?::"+a+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 (?:`+a+":){1}(?:(?::"+a+"){0,4}:"+n+"|(?::"+a+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 (?::(?:(?::`+a+"){0,5}:"+n+"|(?::"+a+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),l=new RegExp("(?:^"+n+"$)|(?:^"+o+"$)"),i=new RegExp("^"+n+"$"),s=new RegExp("^"+o+"$"),c=function(u){return u&&u.exact?l:new RegExp("(?:"+e(u)+n+e(u)+")|(?:"+e(u)+o+e(u)+")","g")};c.v4=function(v){return v&&v.exact?i:new RegExp(""+e(v)+n+e(v),"g")},c.v6=function(v){return v&&v.exact?s:new RegExp(""+e(v)+o+e(v),"g")};var d="(?:(?:[a-z]+:)?//)",g="(?:\\S+(?::\\S*)?@)?",f=c.v4().source,p=c.v6().source,w="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",E="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",h="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",k="(?::\\d{2,5})?",m='(?:[/?#][^\\s"]*)?',V="(?:"+d+"|www\\.)"+g+"(?:localhost|"+f+"|"+p+"|"+w+E+h+")"+k+m;return J=new RegExp("(?:^"+V+"$)","i"),J},pe={email:/^(([^<>()\[\]\\.,;:\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},R={integer:function(e){return R.number(e)&&parseInt(e,10)===e},float:function(e){return R.number(e)&&!R.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"&&!R.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(pe.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match($n())},hex:function(e){return typeof e=="string"&&!!e.match(pe.hex)}},Vn=function(e,n,a,o,l){if(e.required&&n===void 0){Ve(e,n,a,o,l);return}var i=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=e.type;i.indexOf(s)>-1?R[s](n)||o.push(q(l.messages.types[s],e.fullField,e.type)):s&&typeof n!==e.type&&o.push(q(l.messages.types[s],e.fullField,e.type))},Nn=function(e,n,a,o,l){var i=typeof e.len=="number",s=typeof e.min=="number",c=typeof e.max=="number",d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g=n,f=null,p=typeof n=="number",w=typeof n=="string",E=Array.isArray(n);if(p?f="number":w?f="string":E&&(f="array"),!f)return!1;E&&(g=n.length),w&&(g=n.replace(d,"_").length),i?g!==e.len&&o.push(q(l.messages[f].len,e.fullField,e.len)):s&&!c&&g<e.min?o.push(q(l.messages[f].min,e.fullField,e.min)):c&&!s&&g>e.max?o.push(q(l.messages[f].max,e.fullField,e.max)):s&&c&&(g<e.min||g>e.max)&&o.push(q(l.messages[f].range,e.fullField,e.min,e.max))},j="enum",Fn=function(e,n,a,o,l){e[j]=Array.isArray(e[j])?e[j]:[],e[j].indexOf(n)===-1&&o.push(q(l.messages[j],e.fullField,e[j].join(", ")))},_n=function(e,n,a,o,l){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||o.push(q(l.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var i=new RegExp(e.pattern);i.test(n)||o.push(q(l.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},b={required:Ve,whitespace:Bn,type:Vn,range:Nn,enum:Fn,pattern:_n},qn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n,"string")&&!e.required)return a();b.required(e,n,o,i,l,"string"),B(n,"string")||(b.type(e,n,o,i,l),b.range(e,n,o,i,l),b.pattern(e,n,o,i,l),e.whitespace===!0&&b.whitespace(e,n,o,i,l))}a(i)},zn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l),n!==void 0&&b.type(e,n,o,i,l)}a(i)},An=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(n===""&&(n=void 0),B(n)&&!e.required)return a();b.required(e,n,o,i,l),n!==void 0&&(b.type(e,n,o,i,l),b.range(e,n,o,i,l))}a(i)},On=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l),n!==void 0&&b.type(e,n,o,i,l)}a(i)},Sn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l),B(n)||b.type(e,n,o,i,l)}a(i)},Tn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l),n!==void 0&&(b.type(e,n,o,i,l),b.range(e,n,o,i,l))}a(i)},Pn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l),n!==void 0&&(b.type(e,n,o,i,l),b.range(e,n,o,i,l))}a(i)},jn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(n==null&&!e.required)return a();b.required(e,n,o,i,l,"array"),n!=null&&(b.type(e,n,o,i,l),b.range(e,n,o,i,l))}a(i)},Mn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l),n!==void 0&&b.type(e,n,o,i,l)}a(i)},Rn="enum",In=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l),n!==void 0&&b[Rn](e,n,o,i,l)}a(i)},Ln=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n,"string")&&!e.required)return a();b.required(e,n,o,i,l),B(n,"string")||b.pattern(e,n,o,i,l)}a(i)},Dn=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n,"date")&&!e.required)return a();if(b.required(e,n,o,i,l),!B(n,"date")){var c;n instanceof Date?c=n:c=new Date(n),b.type(e,c,o,i,l),c&&b.range(e,c.getTime(),o,i,l)}}a(i)},Wn=function(e,n,a,o,l){var i=[],s=Array.isArray(n)?"array":typeof n;b.required(e,n,o,i,l,s),a(i)},H=function(e,n,a,o,l){var i=e.type,s=[],c=e.required||!e.required&&o.hasOwnProperty(e.field);if(c){if(B(n,i)&&!e.required)return a();b.required(e,n,o,s,l,i),B(n,i)||b.type(e,n,o,s,l)}a(s)},Un=function(e,n,a,o,l){var i=[],s=e.required||!e.required&&o.hasOwnProperty(e.field);if(s){if(B(n)&&!e.required)return a();b.required(e,n,o,i,l)}a(i)},I={string:qn,method:zn,number:An,boolean:On,regexp:Sn,integer:Tn,float:Pn,array:jn,object:Mn,enum:In,pattern:Ln,date:Dn,url:H,hex:H,email:H,required:Wn,any:Un};function ae(){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 oe=ae(),W=function(){function r(n){this.rules=null,this._messages=oe,this.define(n)}var e=r.prototype;return e.define=function(a){var o=this;if(!a)throw new Error("Cannot configure a schema with no rules");if(typeof a!="object"||Array.isArray(a))throw new Error("Rules must be an object");this.rules={},Object.keys(a).forEach(function(l){var i=a[l];o.rules[l]=Array.isArray(i)?i:[i]})},e.messages=function(a){return a&&(this._messages=me(ae(),a)),this._messages},e.validate=function(a,o,l){var i=this;o===void 0&&(o={}),l===void 0&&(l=function(){});var s=a,c=o,d=l;if(typeof c=="function"&&(d=c,c={}),!this.rules||Object.keys(this.rules).length===0)return d&&d(null,s),Promise.resolve(s);function g(h){var k=[],m={};function V(u){if(Array.isArray(u)){var x;k=(x=k).concat.apply(x,u)}else k.push(u)}for(var v=0;v<h.length;v++)V(h[v]);k.length?(m=re(k),d(k,m)):d(null,s)}if(c.messages){var f=this.messages();f===oe&&(f=ae()),me(f,c.messages),c.messages=f}else c.messages=this.messages();var p={},w=c.keys||Object.keys(this.rules);w.forEach(function(h){var k=i.rules[h],m=s[h];k.forEach(function(V){var v=V;typeof v.transform=="function"&&(s===a&&(s=S({},s)),m=s[h]=v.transform(m)),typeof v=="function"?v={validator:v}:v=S({},v),v.validator=i.getValidationMethod(v),v.validator&&(v.field=h,v.fullField=v.fullField||h,v.type=i.getType(v),p[h]=p[h]||[],p[h].push({rule:v,value:m,source:s,field:h}))})});var E={};return Cn(p,c,function(h,k){var m=h.rule,V=(m.type==="object"||m.type==="array")&&(typeof m.fields=="object"||typeof m.defaultField=="object");V=V&&(m.required||!m.required&&h.value),m.field=h.field;function v(y,C){return S({},C,{fullField:m.fullField+"."+y,fullFields:m.fullFields?[].concat(m.fullFields,[y]):[y]})}function u(y){y===void 0&&(y=[]);var C=Array.isArray(y)?y:[y];!c.suppressWarning&&C.length&&r.warning("async-validator:",C),C.length&&m.message!==void 0&&(C=[].concat(m.message));var $=C.map(de(m,s));if(c.first&&$.length)return E[m.field]=1,k($);if(!V)k($);else{if(m.required&&!h.value)return m.message!==void 0?$=[].concat(m.message).map(de(m,s)):c.error&&($=[c.error(m,q(c.messages.required,m.field))]),k($);var A={};m.defaultField&&Object.keys(h.value).map(function(_){A[_]=m.defaultField}),A=S({},A,h.rule.fields);var P={};Object.keys(A).forEach(function(_){var z=A[_],ze=Array.isArray(z)?z:[z];P[_]=ze.map(v.bind(null,_))});var M=new r(P);M.messages(c.messages),h.rule.options&&(h.rule.options.messages=c.messages,h.rule.options.error=c.error),M.validate(h.value,h.rule.options||c,function(_){var z=[];$&&$.length&&z.push.apply(z,$),_&&_.length&&z.push.apply(z,_),k(z.length?z:null)})}}var x;if(m.asyncValidator)x=m.asyncValidator(m,h.value,u,h.source,c);else if(m.validator){try{x=m.validator(m,h.value,u,h.source,c)}catch(y){console.error==null||console.error(y),c.suppressValidatorError||setTimeout(function(){throw y},0),u(y.message)}x===!0?u():x===!1?u(typeof m.message=="function"?m.message(m.fullField||m.field):m.message||(m.fullField||m.field)+" fails"):x instanceof Array?u(x):x instanceof Error&&u(x.message)}x&&x.then&&x.then(function(){return u()},function(y){return u(y)})},function(h){g(h)},s)},e.getType=function(a){if(a.type===void 0&&a.pattern instanceof RegExp&&(a.type="pattern"),typeof a.validator!="function"&&a.type&&!I.hasOwnProperty(a.type))throw new Error(q("Unknown rule type %s",a.type));return a.type||"string"},e.getValidationMethod=function(a){if(typeof a.validator=="function")return a.validator;var o=Object.keys(a),l=o.indexOf("message");return l!==-1&&o.splice(l,1),o.length===1&&o[0]==="required"?I.required:I[this.getType(a)]||void 0},r}();W.register=function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");I[e]=n};W.warning=$e;W.messages=oe;W.validators=I;const Zn=t.defineComponent({__name:"form-item",props:{label:{default:""},prop:{default:""},labelWidth:{default:""},required:{type:Boolean,default:!1},labelAlign:{default:"left"},contentAlign:{default:"left"}},setup(r){const e=r,n=D("form-item"),a=t.ref(""),o=t.ref(0),l=t.ref(0),i=t.ref(),s=t.ref(),c=t.inject("labelWidth"),d=t.inject("inline"),g=t.computed(()=>c!=null&&c.value?`${c==null?void 0:c.value}px`:`${e.labelWidth}px`),f=C=>{l.value=C},p=C=>{o.value=C},w=t.inject("model"),E=t.inject("rules");t.provide("setValidateBlurFlag",f),t.provide("setValidateChangeFlag",p);const h=t.inject("addFiled"),k=t.computed(()=>i.value&&i.value.length?i.value.find(C=>C.required):!1),m=t.computed(()=>e.labelAlign==="left"?"flex-start":e.labelAlign==="center"?"center":"flex-end"),V=t.computed(()=>e.contentAlign==="left"?"flex-start":e.contentAlign==="center"?"center":"flex-end"),v=()=>{const C=w.value[e.prop],$=E.value[e.prop],A={[e.prop]:$},P=new W(A);if(e.prop)return new Promise(M=>{P.validate({[e.prop]:C},{firstFields:!0},_=>{_&&_.length?(a.value=_[0].message,M(!1)):(a.value="",M(!0))})})},u=()=>{(w==null?void 0:w.value)[e.prop]=s.value,a.value=""},x=()=>{a.value=""},y=()=>{i.value=(E==null?void 0:E.value)[e.prop],i.value&&i.value.length&&i.value.forEach(C=>{Array.isArray(C.trigger)?(C.trigger.includes("change")&&o.value>0&&v(),C.trigger.includes("blur")&&l.value>0&&v()):(C.trigger==="blur"&&l.value>0&&v(),C.trigger==="change"&&o.value>0&&v())})};return t.watch(()=>l.value,()=>{y()}),t.watch(()=>o.value,()=>{y()}),t.onMounted(()=>{y(),e.prop&&h({validate:v,resetField:u,clearValidate:x,name:e.prop}),e.prop&&(s.value=w==null?void 0:w.value[e.prop])}),(C,$)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(n).b()]),style:t.normalizeStyle({display:t.unref(d)?"inline-flex":"flex",marginRight:t.unref(d)?"32px":"0"})},[r.label?(t.openBlock(),t.createElementBlock("div",{key:0,style:t.normalizeStyle({width:t.unref(g),justifyContent:t.unref(m)}),class:t.normalizeClass([t.unref(n).e("label")])},[t.createElementVNode("div",{class:t.normalizeClass({"cc-form-item-label-required":r.required||t.unref(k)})},t.toDisplayString(r.label),3)],6)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass([t.unref(n).e("content")]),style:t.normalizeStyle({marginLeft:r.label?0:t.unref(g),justifyContent:t.unref(V)})},[t.renderSlot(C.$slots,"default"),t.createElementVNode("div",{class:t.normalizeClass([t.unref(n).e("error")])},t.toDisplayString(a.value),3)],6)],6))}}),Jn=T(pn,"cc-form"),Kn=T(Zn,"cc-form-item"),Qn={Form:Jn,FormItem:Kn},{Tabs:Ne,TabPane:Fe}=mn,{Form:_e,FormItem:qe}=Qn,Xn=[N,Ce,Be,tn,Ne,Fe,_e,qe],Hn={install(r){Xn.forEach(e=>{r.use(e)})}};exports.CcButton=Ce;exports.CcForm=_e;exports.CcFormItem=qe;exports.CcIcon=N;exports.CcInput=Be;exports.CcMessage=F;exports.CcTabPane=Fe;exports.CcTabs=Ne;exports.default=Hn;