import{i as Fe,_ as A,r as b,s as Ie,v as De}from"./form-model.0762a291.js";import{d as qe,Z as We,$ as xe,a0 as He,b as ee,f as F,l as je,a1 as ve,a2 as Ue,U as Ee,i as ke,k as _e,m as Ke,a3 as Y,n as Me,a4 as Ge,a5 as Je,w as Pe}from"./index.b5a2f1c9.js";import{d as Ae,i as Xe,c as y,j as $,t as Ce,r as Re,o as Ze,b as ze,w as Ve,aI as C,p as ce,n as Qe}from"./arco.9755215d.js";import{u as Be,C as Ye,F as Ne,V as D,a as er}from"./index.44f805f6.js";/** * tdesign v1.9.9 * (c) 2024 tdesign * @license MIT */var rr={for:{type:String,default:""},help:{type:[String,Function]},label:{type:[String,Function],default:""},labelAlign:{type:String,validator:function(e){return e?["left","right","top"].includes(e):!0}},labelWidth:{type:[String,Number]},name:{type:String,default:""},requiredMark:{type:Boolean,default:void 0},rules:{type:Array},showErrorMessage:{type:Boolean,default:void 0},status:{type:String,default:""},statusIcon:{type:[Boolean,Function],default:void 0},successBorder:Boolean,tips:{type:[String,Function]}};/** * tdesign v1.9.9 * (c) 2024 tdesign * @license MIT */function ar(v,e){return v.replace(/\${(.*?)}/g,function(f,c){return e[c.trim()]||""})}/** * tdesign v1.9.9 * (c) 2024 tdesign * @license MIT */function $e(v,e){var f=Object.keys(v);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(v);e&&(c=c.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),f.push.apply(f,c)}return f}function Oe(v){for(var e=1;e0;return a!=null?a:d}),ne=y(function(){return c.label||e.label}),ge=y(function(){return!!(r!=null&&r.colon&&ne.value)}),q=ee("form__label"),W=y(function(){return Fe(e.labelAlign)?r==null?void 0:r.labelAlign:e.labelAlign}),S=y(function(){return Fe(e.labelWidth)?r==null?void 0:r.labelWidth:e.labelWidth}),pe=y(function(){return[p.value.label,F(F(F(F(F({},"".concat(q.value,"--required"),me.value),"".concat(q.value,"--colon"),ge.value),"".concat(q.value,"--top"),ne.value&&(W.value==="top"||!S.value)),"".concat(q.value,"--left"),W.value==="left"&&S.value),"".concat(q.value,"--right"),W.value==="right"&&S.value)]}),ye=function(){if(Number(S.value)!==0){var l={};return S.value&&W.value!=="top"&&(je(S.value)?l={width:"".concat(S.value,"px")}:l={width:S.value}),C("div",{class:pe.value,style:l},[C("label",{for:e.for||null},[E("label")])])}},le=function(){var l=function(h){return C("span",{class:p.value.status},[C(h,null,null)])},a=j.value;if(L.value===D.SUCCESS)return l(k);if(a!=null&&a[0]){var d=a[0].type||"error",o={error:I,warning:de}[d]||k;return l(o)}return null},ue=function(){var l=e.statusIcon;if(l!==!1){var a=E("statusIcon",{defaultNode:le()});if(a)return C("span",{class:p.value.status},[a]);if(a!==!1&&(a=r==null?void 0:r.renderContent("statusIcon",{defaultNode:le(),params:e}),a))return a}},be=y(function(){if(!_.value)return"";if(L.value===D.SUCCESS)return e.successBorder?[p.value.success,p.value.successBorder].join(" "):p.value.success;if(!!j.value.length){var t=j.value[0].type||"error";return t==="error"?p.value.error:p.value.warning}}),H=y(function(){return[p.value.controls,be.value]}),ie=y(function(){var t={};return S.value&&W.value!=="top"&&(je(S.value)?t={marginLeft:"".concat(S.value,"px")}:t={marginLeft:S.value}),t}),j=$([]),U=$([]),L=$(D.TO_BE_VALIDATED),Z=$(!1),z=$(!1),B=function(){z.value=!1,j.value=[],U.value=[],L.value=D.TO_BE_VALIDATED},he=function(){var l=Object.prototype.toString.call(ve(r==null?void 0:r.data,e.name)),a;return l==="[object String]"&&(a=""),l==="[object Array]"&&(a=[]),l==="[object Object]"&&(a={}),a},Se=function(){var t=A(b.mark(function l(){var a,d=arguments;return b.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(a=d.length>0&&d[0]!==void 0?d[0]:r==null?void 0:r.resetType,e.name){O.next=3;break}return O.abrupt("return");case 3:return a==="empty"?Ie(r==null?void 0:r.data,e.name,he()):a==="initial"&&Ie(r==null?void 0:r.data,e.name,w.value),O.next=6,Qe();case 6:Z.value?z.value=!0:B();case 7:case"end":return O.stop()}},l)}));return function(){return t.apply(this,arguments)}}(),se=y(function(){var t;return(t=r==null?void 0:r.errorMessage)!==null&&t!==void 0?t:re.value.errorMessage}),K=y(function(){var t;if((t=e.rules)!==null&&t!==void 0&&t.length)return e.rules;if(!e.name)return[];var l="".concat(e.name).lastIndexOf(".")||-1,a="".concat(e.name).slice(l+1);return ve(r==null?void 0:r.rules,e.name)||ve(r==null?void 0:r.rules,a)||[]}),g=function(){var t=A(b.mark(function l(a){var d,o;return b.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(o={successList:[],errorList:[],rules:[],resultList:[],allowSetValue:!1},o.rules=a==="all"?K.value:K.value.filter(function(m){return(m.trigger||"change")===a}),!(K.value.length&&!((d=o.rules)!==null&&d!==void 0&&d.length))){h.next=4;break}return h.abrupt("return",o);case 4:return o.allowSetValue=!0,h.next=7,De(i.value,o.rules);case 7:return o.resultList=h.sent,o.errorList=o.resultList.filter(function(m){return m.result!==!0}).map(function(m){return Object.keys(m).forEach(function(J){if(!m.message&&se.value[J]){var oe=Ke(e.label)?e.label:e.name;m.message=ar(se.value[J],{name:oe,validate:m[J]})}}),m}),o.successList=o.resultList.filter(function(m){return m.result===!0&&m.message&&m.type==="success"}),h.abrupt("return",o);case 11:case"end":return h.stop()}},l)}));return function(a){return t.apply(this,arguments)}}(),n=function(){var t=A(b.mark(function l(a,d){var o,O,h,m,J,oe;return b.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return Z.value=!0,x.value=d,X.next=4,g(a);case 4:return o=X.sent,O=o.successList,h=o.errorList,m=o.rules,J=o.resultList,oe=o.allowSetValue,oe&&(U.value=O,j.value=h),m.length&&(L.value=h.length?D.FAIL:D.SUCCESS),z.value&&B(),Z.value=!1,X.abrupt("return",F({},e.name,h.length===0?!0:J));case 15:case"end":return X.stop()}},l)}));return function(a,d){return t.apply(this,arguments)}}(),u=function(){var t=A(b.mark(function l(a){var d,o,O;return b.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,g(a);case 2:return d=m.sent,o=d.errorList,O=d.resultList,m.abrupt("return",F({},e.name,o.length===0?!0:O));case 6:case"end":return m.stop()}},l)}));return function(a){return t.apply(this,arguments)}}(),s=function(l){!l&&!_e(l)||(l.length===0&&(j.value=[],L.value=D.SUCCESS),j.value=l.map(function(a){return Oe(Oe({},a),{},{result:!1})}),L.value=D.FAIL)},i=y(function(){return(r==null?void 0:r.data)&&ve(r==null?void 0:r.data,e.name)}),w=$(void 0),M=Ce(e),P=M.name,N=Re({name:P,resetHandler:B,resetField:Se,validate:n,validateOnly:u,setValidateMessage:s});Ze(function(){w.value=Ue(i.value),r==null||r.children.push(N)}),ze(function(){r&&(r.children=r==null?void 0:r.children.filter(function(t){return t!==N}))}),Ve(i,A(b.mark(function t(){return b.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,n("change");case 2:case"end":return a.stop()}},t)})),{deep:!0}),Ve(function(){return[e.name,JSON.stringify(e.rules)].join(",")},function(){n("change")});var x=$(void 0),_=y(function(){return Ee(x.value)?x.value:Ee(e.showErrorMessage)?e.showErrorMessage:r==null?void 0:r.showErrorMessage}),V=y(function(){return[p.value.formItem,Te(te.value,e.name),F(F({},p.value.formItemWithHelp,Q.value),p.value.formItemWithExtra,we.value)]}),Q=y(function(){var t=E("help");return t?C("div",{class:p.value.help},[t]):null}),we=y(function(){var t,l=function(o){return C("div",{class:p.value.extra,title:o},[o])},a=j.value;return _.value&&a!==null&&a!==void 0&&(t=a[0])!==null&&t!==void 0&&t.message?l(a[0].message):U.value.length?l(U.value[0].message):null}),T=y(function(){var t=E("tips");if(!t)return null;var l=["".concat(te.value,"-tips"),"".concat(ae.value,"-tips"),"".concat(ae.value,"-is-").concat(e.status||"default")];return C("div",{class:l},[t])}),G=function(){var t=A(b.mark(function l(){return b.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,n("blur");case 2:case"end":return d.stop()}},l)}));return function(){return t.apply(this,arguments)}}();return ce(er,{handleBlur:G}),function(){return C("div",{class:V.value},[ye(),C("div",{class:H.value,style:ie.value},[C("div",{class:p.value.controlsContent},[E("default"),ue()]),Q.value,T.value,we.value])])}}});/** * tdesign v1.9.9 * (c) 2024 tdesign * @license MIT */var nr={colon:Boolean,data:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:void 0},errorMessage:{type:Object},formControlledComponents:{type:Array},labelAlign:{type:String,default:"right",validator:function(e){return e?["left","right","top"].includes(e):!0}},labelWidth:{type:[String,Number],default:"100px"},layout:{type:String,default:"vertical",validator:function(e){return e?["vertical","inline"].includes(e):!0}},preventSubmitDefault:{type:Boolean,default:!0},readonly:{type:Boolean,default:void 0},requiredMark:{type:Boolean,default:void 0},resetType:{type:String,default:"empty",validator:function(e){return e?["empty","initial"].includes(e):!0}},rules:{type:Object},scrollToFirstError:{type:String,validator:function(e){return e?["","smooth","auto"].includes(e):!0}},showErrorMessage:{type:Boolean,default:!0},statusIcon:{type:[Boolean,Function],default:void 0},submitWithWarningMessage:Boolean,onReset:Function,onSubmit:Function,onValidate:Function};/** * tdesign v1.9.9 * (c) 2024 tdesign * @license MIT */function Le(v,e){var f=Object.keys(v);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(v);e&&(c=c.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),f.push.apply(f,c)}return f}function lr(v){for(var e=1;e