@form-create/ant-design-vue
Version:
Ant Design Vue 版本低代码表单 | FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持多个 UI 框架,适配移动端,并且支持生成任何 Vue 组件。内置 20 种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。
15 lines • 147 kB
JavaScript
/*!
* FormCreate 低代码表单渲染器
* @form-create/ant-design-vue v3.3.6
* (c) 2018-2026 xaboy
* Github https://github.com/xaboy/form-create
* Site https://form-create.com/
* Released under the MIT License.
*/
(function(){"use strict";try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode('._fc-frame ._fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame ._fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-frame ._fc-upload-cover ._fc-frame-icon{color:#fff;font-size:16px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .anticon{font-size:16px;width:16px}._fc-frame .ant-upload{display:block}._fc-frame ._fc-upload-btn,._fc-frame ._fc-frame-icon{cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled ._fc-frame-icon{cursor:not-allowed!important;color:#999}._fc-frame ._fc-upload-btn,._fc-files{display:inline-block;width:104px;height:104px;text-align:center;line-height:104px;border:1px solid #c0ccda;border-radius:4px;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-group{display:flex;min-height:38px;justify-content:center;flex-direction:column;width:100%}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx._fc-group-drag{cursor:grab;width:auto;min-width:30px;padding:0 8px;gap:4px;user-select:none}._fc-group-idx._fc-group-drag:active{cursor:grabbing}._fc-group-grip{flex-shrink:0;color:#666;font-weight:500;line-height:1;font-size:14px}._fc-group-dragging{opacity:.55}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:500}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;border-radius:5px;margin:5px 5px 25px;padding:20px 20px 25px}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;width:100%;gap:16px}._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn,._fc-group._fc-group-card._fc-group-disabled ._fc-group-add{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{position:relative;background:#fff;border:1px solid #f0f0f0;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;padding:0;margin:0}._fc-group._fc-group-card ._fc-group-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;background:#fafafa}._fc-group._fc-group-card ._fc-group-idx{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:#f0f0f0;color:#666;border-radius:6px;font-size:12px;font-weight:500;margin-right:12px;flex-shrink:0;position:static;border:1px solid #e0e0e0}._fc-group._fc-group-card ._fc-group-title{flex:1;font-size:14px;font-weight:500;color:#000000d9;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{display:flex;align-items:center;gap:4px;margin-left:12px;flex-shrink:0;position:static;bottom:auto;right:auto;border-radius:0;border:none;padding:0;background-color:transparent;flex-direction:row}._fc-group._fc-group-card ._fc-group-idx._fc-group-drag{width:auto;min-width:24px;height:24px;padding:0 6px;gap:3px;cursor:grab}._fc-group._fc-group-card ._fc-group-drag-btn{cursor:grab;margin-right:8px;flex-shrink:0;color:#00000073;font-size:18px;font-weight:500;line-height:1;letter-spacing:-1px;user-select:none}._fc-group._fc-group-card ._fc-group-drag-btn:active{cursor:grabbing}._fc-group._fc-group-card ._fc-group-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-btn:hover{color:#1890ff;border-color:#1890ff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-btn:active{color:#096dd9;border-color:#096dd9}._fc-group._fc-group-card ._fc-group-plus-minus{position:relative;background:#409eff;border-color:#409eff;color:#fff;width:24px;height:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-add:hover{color:#409eff;border-color:#409eff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{width:24px;height:24px;background:#409eff;border-color:#409eff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-container._fc-group-drag-over,._fc-group._fc-group-card ._fc-group-container._fc-group-drag-over{border-color:#409eff}._fc-group._fc-group-card ._fc-group-empty{text-align:center;padding:40px 20px;color:#00000073;font-size:14px}@media (max-width: 768px){._fc-group._fc-group-card ._fc-group-container{margin:0 -8px;border-radius:0;border-left:none;border-right:none}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{width:22px;height:22px}}.form-create .form-create .ant-form-item{margin-bottom:22px}.form-create .form-create .ant-form-item.ant-form-item-with-help{margin-bottom:3px}.form-create .form-create .ant-form-item .ant-form-item.ant-form-item-with-help{margin-bottom:-22px}.form-create{width:100%}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .ant-form-item .ant-form-item-label>label.ant-form-item-required:before{display:none!important}.fc-form-footer{margin-top:12px}.form-create.is-numbered{counter-reset:q}.form-create.is-numbered .fc-form-title{counter-increment:q}.form-create.is-numbered .fc-form-title:before{content:counter(q) ". ";color:var(--fc-number-color, inherit);font-weight:600}.form-create.is-numbered.is-number-chinese .fc-form-title:before{content:counter(q,simp-chinese-informal) "、"}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
(function(te,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(te=typeof globalThis!="undefined"?globalThis:te||self,f(te.formCreate={},te.Vue))})(this,function(te,f){"use strict";var Bi=Object.defineProperty,Li=Object.defineProperties;var xi=Object.getOwnPropertyDescriptors;var dr=Object.getOwnPropertySymbols;var qi=Object.prototype.hasOwnProperty,Yi=Object.prototype.propertyIsEnumerable;var hr=(te,f,X)=>f in te?Bi(te,f,{enumerable:!0,configurable:!0,writable:!0,value:X}):te[f]=X,V=(te,f)=>{for(var X in f||(f={}))qi.call(f,X)&&hr(te,X,f[X]);if(dr)for(var X of dr(f))Yi.call(f,X)&&hr(te,X,f[X]);return te},oe=(te,f)=>Li(te,xi(f));function X(t){return Array.isArray(t)?t:[null,void 0,""].indexOf(t)>-1?[]:[t]}function pr(t,e){return Object.keys(t).reduce((r,n)=>((!e||e.indexOf(n)===-1)&&(r[n]=t[n]),r),{})}const Se=(t,e)=>{const r=t.__vccOpts||t;for(const[n,o]of e)r[n]=o;return r},mr={name:"PlusOutlined"},gr={class:"anticon"};function yr(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",gr,[...e[0]||(e[0]=[f.createElementVNode("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[f.createElementVNode("defs"),f.createElementVNode("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z",fill:"currentColor"}),f.createElementVNode("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z",fill:"currentColor"})],-1)])])}const $r=Se(mr,[["render",yr]]),br={name:"UploadOutlined"},_r={class:"anticon"};function wr(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",_r,[...e[0]||(e[0]=[f.createElementVNode("svg",{focusable:"false","data-icon":"upload",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[f.createElementVNode("path",{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})],-1)])])}const Or=Se(br,[["render",wr]]),bt=function(t,e){return typeof t=="object"?t:{url:t,is_string:!0,name:Cr(t),status:"done",uid:-1*(e+1)}},Cr=function(t){return(""+t).split("/").pop()},_t=function(t){return oe(V({},t),{file:t,value:t})},vr=f.defineComponent({name:"fcUpload",inheritAttrs:!1,formCreateParser:{toFormValue(t){return X(t)},toValue(t,e){return e.prop.props.limit===1?t[0]||"":t}},props:{limit:{type:Number,default:0},modelValue:{type:[Array,String,Object],default:()=>[]},onSuccess:{type:Function,required:!0},onPreview:Function,listType:String,uploadText:String,modalTitle:String,customRequest:Function,formCreateInject:Object,previewMask:void 0},emits:["update:modelValue","change","fc.el"],data(){return{previewImage:"",previewVisible:!1,uploadList:this.modelValue.map(bt).map(_t)}},watch:{modelValue(t){this.uploadList=t.map(bt).map(_t)}},methods:{handlePreview(t){this.onPreview?this.onPreview(...arguments):(this.previewImage=t.url,this.previewVisible=!0)},handleChange({file:t,fileList:e}){this.$emit("change",...arguments),this.uploadList=e,t.status==="done"?(this.onSuccess(t,e),this.input()):t.status==="removed"&&(e.forEach((r,n)=>{r.file===t&&e.splice(n,1)}),this.input())},input(){this.$emit("update:modelValue",this.uploadList.map(t=>t.is_string?t.url:t.value||t.url))},doCustomRequest(t){if(this.customRequest)return this.customRequest(t);t.source="upload",this.formCreateInject.api.fetch(t)}},render(){const t=!this.limit||this.limit>this.uploadList.length,e=f.resolveComponent("AModal"),r={[e.props.open?"open":"visible"]:this.previewVisible};return f.createVNode("div",{class:"_fc-upload"},[f.createVNode(f.resolveComponent("AUpload"),f.mergeProps({maxCount:this.limit,listType:this.listType||"picture-card"},this.$attrs,{onPreview:this.handlePreview,onChange:this.handleChange,fileList:this.uploadList,customRequest:this.doCustomRequest,ref:"upload"}),V({default:()=>{var n,o;return[t?(o=(n=this.$slots).default)!=null&&o.call(n)||["text","picture"].indexOf(this.listType)===-1?f.createVNode($r,{style:"font-size: 16px; width: 16px;"},null):f.createVNode(f.resolveComponent("AButton"),null,{default:()=>[f.createVNode(Or,null,null),this.formCreateInject.t("clickToUpload")||this.uploadText||"点击上传"]}):null]}},pr(this.$slots,["default"]))),f.createVNode(e,f.mergeProps({mask:this.previewMask,title:this.modalTitle},r,{onCancel:()=>this.previewVisible=!1,footer:null}),{default:()=>[f.createVNode("img",{style:"width: 100%",src:this.previewImage},null)]})])},mounted(){this.$emit("fc.el",this.$refs.upload)}});function wt(t){t=t||new Map;const e={$on(r,n){const o=t.get(r);o&&o.push(n)||t.set(r,[n])},$once(r,n){n._once=!0,e.$on(r,n)},$off(r,n){const o=t.get(r);o&&o.splice(o.indexOf(n)>>>0,1)},$emit(r,...n){(t.get(r)||[]).slice().map(o=>{o._once&&(e.$off(r,o),delete o._once),o(...n)}),(t.get("*")||[]).slice().map(o=>{o(r,n)})}};return e}const Sr={name:"CloseCircleOutlined"},kr={class:"anticon"};function Vr(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",kr,[...e[0]||(e[0]=[f.createElementVNode("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[f.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"}),f.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"})],-1)])])}const Dr=Se(Sr,[["render",Vr]]),Fr={name:"FolderOutlined"},Er={class:"anticon"};function Rr(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",Er,[...e[0]||(e[0]=[f.createElementVNode("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[f.createElementVNode("path",{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 0 0-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z",fill:"currentColor"})],-1)])])}const Ar=Se(Fr,[["render",Rr]]),Mr={name:"FileOutlined"},jr={class:"anticon"};function Nr(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",jr,[...e[0]||(e[0]=[f.createElementVNode("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[f.createElementVNode("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z",fill:"currentColor"})],-1)])])}const Pr=Se(Mr,[["render",Nr]]),Tr={name:"DeleteOutlined"},Ir={class:"anticon"};function Br(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",Ir,[...e[0]||(e[0]=[f.createElementVNode("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[f.createElementVNode("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z",fill:"currentColor"})],-1)])])}const Lr=Se(Tr,[["render",Br]]),xr={name:"EyeOutlined"},qr={class:"anticon"};function Yr(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",qr,[...e[0]||(e[0]=[f.createElementVNode("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[f.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"})],-1)])])}const Ur=Se(xr,[["render",Yr]]),Hr=f.defineComponent({name:"fcFrame",props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"FolderOutlined"},width:{type:[Number,String],default:500},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:""},closeBtnText:{type:String,default:""},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}},onLoad:{type:Function,default:()=>{}},onBeforeRemove:{type:Function,default:()=>{}},onRemove:{type:Function,default:()=>{}},onHandle:Function,modal:{type:Object,default:()=>({})},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{FolderOutlined:Ar,EyeOutlined:Ur},data(){return{fileList:X(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new wt}},watch:{modelValue(t){this.fileList=X(t)}},methods:{close(){this.closeModal(!0)},closeModal(t){this.bus.$emit(t?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel(){this.previewVisible=!1},showModal(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},input(){const t=this.fileList,e=this.maxLength===1?t[0]||"":t;this.$emit("update:modelValue",e),this.$emit("change",e)},makeInput(){const t=f.resolveComponent(this.icon),e={addonAfter:()=>f.createVNode(t,{class:"_fc-frame-icon",onClick:this.showModal},null)};return this.fileList.length&&!this.disabled&&(e.suffix=()=>f.createVNode(Dr,{class:"_fc-frame-icon",onClick:()=>{this.fileList=[],this.input()}},null)),f.createVNode(f.resolveComponent("AInput"),{readonly:!0,value:this.fileList.map(r=>this.getSrc(r)).toString(),key:1},e)},makeGroup(t){return(!this.maxLength||this.fileList.length<this.maxLength)&&t.push(this.makeBtn()),f.createVNode("div",{key:2},[t])},makeItem(t,e){return f.createVNode("div",{class:"_fc-files",key:"3"+t},[e])},valid(t){const e=this.formCreateInject.field||this.field;if(e&&t!==e)throw new Error("[frame]无效的字段值")},makeIcons(t,e){if(this.handleIcon!==!1||this.allowRemove===!0){const r=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&r.push(this.makeHandleIcon(t,e)),this.allowRemove&&r.push(this.makeRemoveIcon(t,e)),f.createVNode("div",{class:"_fc-upload-cover",key:4},[r])}},makeHandleIcon(t,e){const r=f.resolveComponent(this.handleIcon===!0||this.handleIcon===void 0?"EyeOutlined":this.handleIcon);return f.createVNode(r,{class:"_fc-frame-icon",onClick:()=>this.handleClick(t),key:"5"+e},null)},makeRemoveIcon(t,e){return f.createVNode(Lr,{class:"_fc-frame-icon",onClick:()=>this.handleRemove(t),key:"6"+e},null)},makeFiles(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[f.createVNode(Pr,{class:"_fc-frame-icon",onClick:()=>this.handleClick(t)},null),this.makeIcons(t,e)])))},makeImages(){return this.makeGroup(this.fileList.map((t,e)=>this.makeItem(e,[f.createVNode("img",{src:this.getSrc(t)},null),this.makeIcons(t,e)])))},makeBtn(){const t=f.resolveComponent(this.icon);return f.createVNode("div",{class:"_fc-upload-btn",onClick:()=>this.showModal(),key:7},[f.createVNode(t,{class:"_fc-frame-icon"},null)])},handleClick(t){if(this.onHandle)return this.onHandle(t);this.previewImage=this.getSrc(t),this.previewVisible=!0},handleRemove(t){this.disabled||this.onBeforeRemove(t)!==!1&&(this.fileList.splice(this.fileList.indexOf(t),1),this.input(),this.onRemove(t))},getSrc(t){return this.srcKey?t[this.srcKey]:t},onFrameLoad(t){this.frameLoad(t.target.contentWindow||{})},frameLoad(t){this.onLoad(t);try{this.helper===!0&&(t.form_create_helper={api:this.formCreateInject.api,close:e=>{this.valid(e),this.closeModal()},set:(e,r)=>{this.valid(e),this.disabled||this.$emit("update:modelValue",r)},get:e=>(this.valid(e),this.modelValue),onOk:e=>this.bus.$on("$ok",e),onClose:e=>this.bus.$on("$close",e)})}catch(e){console.error(e)}},makeFooter(){const{okBtnText:t,closeBtnText:e,closeBtn:r,okBtn:n,footer:o}=this.$props,i=[];return o&&(r&&i.push(f.createVNode(f.resolveComponent("AButton"),{onClick:()=>this.onCancel()!==!1&&this.closeModal(!0)},{default:()=>[e||this.formCreateInject.t("close")||"关闭"]})),n&&i.push(f.createVNode(f.resolveComponent("AButton"),{type:"primary",onClick:()=>this.onOk()!==!1&&this.closeModal()},{default:()=>[t||this.formCreateInject.t("ok")||"确定"]}))),i}},render(){const t=this.type;let e;t==="input"?e=this.makeInput():t==="image"?e=this.makeImages():e=this.makeFiles();const{width:r="30%",height:n,src:o,title:i,modalTitle:s}=this.$props,a=f.resolveComponent("AModal");return f.createVNode("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,f.createVNode(a,f.mergeProps({mask:this.previewMask,title:s},{[a&&a.props.open?"open":"visible"]:this.previewVisible},{onCancel:()=>this.previewVisible=!1,footer:null}),{default:()=>[f.createVNode("img",{style:"width: 100%",src:this.previewImage},null)]}),f.createVNode(a,f.mergeProps(V({width:r,title:i},this.modal),{[a&&a.props.open?"open":"visible"]:this.frameVisible},{onCancel:()=>this.closeModal(!0)}),{default:()=>[this.frameVisible||!this.reload?f.createVNode("iframe",{ref:"frame",src:o,frameborder:"0",onLoad:this.onFrameLoad,style:{height:n,border:"0 none",width:"100%"}},null):null],footer:()=>this.makeFooter()})])},beforeMount(){const{name:t,field:e,api:r}=this.formCreateInject;t&&r.on("fc:closeModal:"+t,this.close),e&&r.on("fc:closeModal:"+e,this.close)},beforeUnmount(){const{name:t,field:e,api:r}=this.formCreateInject;t&&r.off("fc:closeModal:"+t,this.close),e&&r.off("fc:closeModal:"+e,this.close)}}),g={type(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef(t){return t==null},Element(t){return typeof t=="object"&&t!==null&&t.nodeType===1&&!g.Object(t)},trueArray(t){return Array.isArray(t)&&t.length>0},Function(t){const e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType(t){const e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(t=>{g[t]=function(e){return g.type(e,t)}});function W(t,e){return{}.hasOwnProperty.call(t,e)}function fe(t,e,r){t[e]=r}function Ae(t,e){delete t[e]}function Pe(t,e={},r){let n=!1;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let i=e[o];if((n=Array.isArray(i))||g.Object(i)){let s=t[o]===void 0;if(n)n=!1,s&&fe(t,o,[]);else if(i._clone&&r!==void 0)if(r)i=i.getRule(),s&&fe(t,o,{});else{fe(t,o,i._clone());continue}else s&&fe(t,o,{});t[o]=Pe(t[o],i,r)}else fe(t,o,i),g.Undef(i)||(g.Undef(i.__json)||(t[o].__json=i.__json),g.Undef(i.__origin)||(t[o].__origin=i.__origin))}return r!==void 0&&Array.isArray(t)?t.filter(o=>!o||!o.__ctrl):t}function ye(t){return Pe({},{value:t}).value}const Wr=Object.assign||function(t){for(let e,r=1;r<arguments.length;r++)for(let n in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,n)&&fe(t,n,e[n]);return t};function R(){return Wr.apply(this,arguments)}function et(t){return typeof t!="object"||t===null?t:t instanceof Array?[...t]:V({},t)}function ke(t,e){var r=null;return function(...n){r!==null&&clearTimeout(r),r=setTimeout(()=>t.call(this,...n),e)}}function zr(t){return t==null?"":typeof t=="object"?JSON.stringify(t,null,2):String(t)}function Gr(t){return t&&typeof t=="object"&&typeof t.then=="function"}function qe(t){return Gr(t)?t:Promise.resolve(t)}function Te(t){let e=t.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return e.indexOf("-")===0&&(e=e.substr(1)),e}function Ot(t){return t.replace(t[0],t[0].toLocaleUpperCase())}function Ct(t,e,r){return`[form-create ${t}]: ${e}`}function tt(t,e){console.error(Ct("err",t))}function Jr(t){tt(t.toString()),console.error(t)}const rt="[[FORM-CREATE-PREFIX-",nt="-FORM-CREATE-SUFFIX]]";function Ie(t,e){return JSON.stringify(Pe(Array.isArray(t)?[]:{},t,!0),function(r,n){if(!(n&&n._isVue===!0)){if(typeof n!="function")return n;if(n.__json)return n.__json;if(n.__origin&&(n=n.__origin),!n.__emit)return rt+n+nt}},e)}function it(t){return new Function("return "+t)()}function $e(t,e){if(t&&g.String(t)&&t.length>4){let r=t.trim(),n=!1;try{if(r.indexOf(nt)>0&&r.indexOf(rt)===0)r=r.replace(nt,"").replace(rt,""),n=!0;else if(r.indexOf("$FN:")===0)r=r.substring(4),n=!0;else if(r.indexOf("$EXEC:")===0)r=r.substring(6),n=!0;else if(r.indexOf("$GLOBAL:")===0){const i=r.substring(8);return r=function(...s){const a=s[0].api.getGlobalEvent(i);if(a)return a.call(this,...s)},r.__json=t,r.__inject=!0,r}else{if(r.indexOf("$FNX:")===0)return r=it(`function($inject){
`+r.substring(5)+`
}`),r.__json=t,r.__inject=!0,r;(!e&&r.indexOf("function ")===0&&r!=="function "||!e&&r.indexOf("function(")===0&&r!=="function(")&&(n=!0)}if(!n)return t;let o;try{o=it(r)}catch(i){o=it("function "+r)}return o.__json=t,o}catch(o){tt(`解析失败:${r}
err: ${o}`);return}}return t}function vt(t,e){return JSON.parse(t,function(r,n){return g.Undef(n)||!n.indexOf?n:$e(n,e)})}let Qr=0;function Ye(){const t=370+ ++Qr;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+t.toString(36)+"c"}function Ve(t,e,r){let n=t,o;return(e||"").split(".").forEach(i=>{o&&((!n[o]||typeof n[o]!="object")&&(n[o]={}),n=n[o]),o=i}),n[o]=r,n}const Ue=4;function Kr(t,e,r){let n=null,o=1/0;return t.forEach((i,s)=>{if(e<i.left||e>i.right||r<i.top||r>i.bottom)return;const a=e-(i.left+i.right)/2,l=r-(i.top+i.bottom)/2,u=a*a+l*l;u<o&&(o=u,n=s)}),n}const Zr=f.defineComponent({name:"fcGroup",props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:()=>[]},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:()=>{}},onBeforeAdd:{type:Function,default:()=>{}},formCreateInject:Object,parse:Function},data(){return{len:0,cacheRule:{},cacheValue:{},sort:[],dragFrom:null,dragOverIndex:null,form:f.markRaw(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler(t,e){Object.keys(this.cacheRule).forEach(r=>{const n=this.cacheRule[r];if(n.$f){const o=n.$f.formData();if(t===e)n.$f.deferSyncValue(()=>{Pe(n.rule,t),n.$f.setValue(o)},!0);else{const i=n.$f.formData();n.$f.once("reloading",()=>{n.$f.setValue(i)}),n.rule=ye(t)}}})},deep:!0},expand(t){let e=t-this.modelValue.length;e>0&&this.expandRule(e)},modelValue:{handler(t){t=t||[];let e=this.sort,r=e.length,n=r-t.length;if(n<0){for(let o=n;o<0;o++)this.addRule(t.length+o,!0);for(let o=0;o<r;o++)this.setValue(e[o],t[o])}else{if(n>0)for(let o=0;o<n;o++)this.removeRule(e[r-o-1]);t.forEach((o,i)=>{this.setValue(e[i],t[i])})}},deep:!0}},methods:{_value(t){return t&&W(t,this.field)?t[this.field]:t},cache(t,e){this.cacheValue[t]=JSON.stringify(e)},input(t){this.$emit("update:modelValue",t),this.$emit("change",t)},formData(t,e){const r=this.cacheRule,n=this.sort;if(n.filter(i=>r[i]&&r[i].$f).length!==n.length)return;const o=n.map(i=>{const s=t===i?e:V({},this.cacheRule[i].$f.form),a=this.field?g.Undef(s[this.field])?null:s[this.field]:s;return this.cache(i,a),a});this.input(o)},setValue(t,e){const r=this.field;r&&(e={[r]:this._value(e)}),this.cacheValue[t]!==JSON.stringify(r?e[r]:e)&&(this.cacheRule[t].$f&&this.cacheRule[t].$f.coverValue(e),this.cache(t,e))},addRule(t,e){const r=this.formCreateInject.form.copyRules(this.rule||[]),n=this.options?V({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){n.formData||(n.formData={});const o=ye(this.defaultValue);R(n.formData,this.field?{[this.field]:o}:o)}this.parse&&this.parse({rule:r,options:n,index:this.sort.length}),this.cacheRule[++this.len]={rule:r,options:n},this.sort=Object.keys(this.cacheRule),e&&f.nextTick(()=>this.$emit("add",r,Object.keys(this.cacheRule).length-1))},add$f(t,e,r){this.cacheRule[e].$f=r,f.nextTick(()=>{this.$emit("itemMounted",r,Object.keys(this.cacheRule).indexOf(e))})},removeRule(t,e){const r=Object.keys(this.cacheRule).indexOf(t);delete this.cacheRule[t],delete this.cacheValue[t],this.sort=Object.keys(this.cacheRule),e&&f.nextTick(()=>this.$emit("remove",r))},add(t){if(this.disabled||this.onBeforeAdd(this.modelValue)===!1)return;const e=[...this.modelValue];e.push(this.defaultValue?ye(this.defaultValue):this.field?null:{}),this.input(e)},del(t,e){if(this.disabled)return;const r=()=>{this.removeRule(e,!0);const n=[...this.modelValue];n.splice(t,1),this.input(n)};qe(this.onBeforeRemove(this.modelValue,t)).then(n=>{n!==!1&&r()})},addIcon(t){return f.createVNode("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon(t,e){return f.createVNode("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:()=>this.del(t,e)},null)},moveSort(t,e){if(t===e||t<0||e<0||t>=this.sort.length||e>=this.sort.length)return;const r=this.sort.slice(),[n]=r.splice(t,1);r.splice(e,0,n),this.sort=r,this.formCreateInject.subForm(this.sort.map(o=>this.cacheRule[o].$f)),this.formData(0)},dragStart(t,e){if(this.dragFrom=e,this.dragOverIndex=null,!t.dataTransfer)return;t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(e));const r=t.currentTarget.closest("._fc-group-container");if(r){const n=r.getBoundingClientRect();t.dataTransfer.setDragImage(r,t.clientX-n.left,t.clientY-n.top)}},dragEnd(){this.dragFrom=null,this.dragOverIndex=null},itemBounds(t){const e=t.getBoundingClientRect();let r=e.top,n=e.right,o=e.bottom,i=e.left;return t.querySelectorAll(":scope > ._fc-group-handle, :scope > ._fc-group-idx").forEach(s=>{const a=s.getBoundingClientRect();r=Math.min(r,a.top),n=Math.max(n,a.right),o=Math.max(o,a.bottom),i=Math.min(i,a.left)}),{top:r-Ue,right:n+Ue,bottom:o+Ue,left:i-Ue}},locateDrag(t){const e=t.currentTarget.querySelectorAll(":scope > ._fc-group-container");return Kr(Array.from(e,r=>this.itemBounds(r)),t.clientX,t.clientY)},groupDragOver(t){if(this.dragFrom==null||this.disabled)return;const e=this.locateDrag(t);this.dragOverIndex!==e&&(this.dragOverIndex=e),t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=e==null||e===this.dragFrom?"none":"move")},groupDragLeave(t){if(this.dragFrom==null)return;const e=t.relatedTarget;if(e&&t.currentTarget.contains(e))return;const r=t.currentTarget.getBoundingClientRect();t.clientX>=r.left&&t.clientX<=r.right&&t.clientY>=r.top&&t.clientY<=r.bottom||(this.dragOverIndex=null)},groupDrop(t){if(this.dragFrom==null)return;t.preventDefault();const e=this.dragFrom,r=this.locateDrag(t);this.dragFrom=null,this.dragOverIndex=null,!(r==null||e===r)&&this.moveSort(e,r)},canDrag(t){return this.sortBtn&&!this.disabled&&t>1},indexIcon(t,e){const r=this.canDrag(e);return f.createVNode("div",{class:{"_fc-group-idx":!0,"_fc-group-drag":r},draggable:r,role:r?"button":void 0,"aria-label":r?"拖动排序":void 0,title:r?"拖动排序":void 0,onDragstart:r?n=>this.dragStart(n,t):void 0,onDragend:r?this.dragEnd:void 0},[r?f.createVNode("span",{class:"_fc-group-grip",lang:"en"},[f.createTextVNode("⋮⋮")]):null,f.createVNode("span",null,[t+1])])},dragHandle(t,e){return this.canDrag(e)?f.createVNode("div",{class:"_fc-group-drag-btn",lang:"en",draggable:!0,role:"button","aria-label":"拖动排序",title:"拖动排序",onDragstart:r=>this.dragStart(r,t),onDragend:this.dragEnd},[f.createTextVNode("⋮⋮")]):null},makeIcon(t,e,r){if(this.$slots.button)return this.$slots.button({total:t,index:e,vm:this,key:r,del:()=>this.del(e,r),add:this.add});const n=[];return(!this.max||t<this.max)&&t===e+1&&n.push(this.addIcon(r)),t>this.min&&n.push(this.delIcon(e,r)),n},expandRule(t){for(let e=0;e<t;e++)this.modelValue.push(this.field?null:{});this.input([...this.modelValue])},getTitle(t,e){return typeof this.title=="function"?this.title(t,this.modelValue[t],e):typeof this.title=="string"?this.title.replace("{index}",t+1):!1}},created(){const t=(this.expand||0)-this.modelValue.length;for(let e=0;e<this.modelValue.length;e++)this.addRule(e);t>0&&this.expandRule(t)},render(){const t=this.sort,e=this.button,r=this.form,n=this.disabled,o=this.type==="card",i=t.length===0?this.$slots.default?this.$slots.default({vm:this,add:this.add}):f.createVNode("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):t.map((s,a)=>{const{rule:l,options:u}=this.cacheRule[s],c=e&&!n?this.makeIcon(t.length,a,s):[],h=this.getTitle(a,s);return o?f.createVNode("div",{class:{"_fc-group-container":!0,"_fc-group-dragging":this.dragFrom===a,"_fc-group-drag-over":this.dragOverIndex===a&&this.dragFrom!==a},key:s},[f.createVNode("div",{class:"_fc-group-header"},[h===!1?this.indexIcon(a,t.length):this.dragHandle(a,t.length),h!==!1?f.createVNode("div",{class:"_fc-group-title"},[h]):null,f.createVNode("div",{class:"_fc-group-handle fc-clock"},[c.length?c:null])]),f.createVNode("div",{class:"_fc-group-content"},[f.createVNode(r,f.mergeProps({key:s},{disabled:n,"onUpdate:modelValue":m=>this.formData(s,m),"onUpdate:api":m=>this.add$f(a,s,m),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:u,extendOption:!0}),null)])]):f.createVNode("div",{class:{"_fc-group-container":!0,"_fc-group-dragging":this.dragFrom===a,"_fc-group-drag-over":this.dragOverIndex===a&&this.dragFrom!==a},key:s},[f.createVNode(r,f.mergeProps({key:s},{disabled:n,"onUpdate:modelValue":m=>this.formData(s,m),"onUpdate:api":m=>this.add$f(a,s,m),inFor:!0,modelValue:this.field?{[this.field]:this._value(this.modelValue[a])}:this.modelValue[a],rule:l,option:u,extendOption:!0}),null),this.indexIcon(a,t.length),c.length?f.createVNode("div",{class:"_fc-group-handle fc-clock"},[c]):null])});return f.createVNode("div",{key:"con",class:"_fc-group "+(n?"_fc-group-disabled":"")+(o?" _fc-group-card":""),onDragenter:this.groupDragOver,onDragover:this.groupDragOver,onDragleave:this.groupDragLeave,onDrop:this.groupDrop},[i])}}),Xr=f.defineComponent({name:"fcSubForm",props:{rule:Array,options:{type:Object,default:()=>f.reactive({submitBtn:!1,resetBtn:!1})},modelValue:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data(){return{cacheValue:{},subApi:{},form:f.markRaw(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue(t){this.setValue(t)}},methods:{formData(t){this.cacheValue=JSON.stringify(t),this.$emit("update:modelValue",t),this.$emit("change",t)},setValue(t){const e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.subApi.coverValue(t||{}))},add$f(t){this.subApi=t,f.nextTick(()=>{this.$emit("itemMounted",t)})}},render(){const t=this.form;return f.createVNode(t,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),en={name:"QuestionCircleOutlined"},tn={class:"anticon"};function rn(t,e,r,n,o,i){return f.openBlock(),f.createElementBlock("span",tn,[...e[0]||(e[0]=[f.createElementVNode("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[f.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"}),f.createElementVNode("path",{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0z",fill:"currentColor"})],-1)])])}const nn=[vr,Hr,Zr,Xr,Se(en,[["render",rn]])],st={name:"checkbox",modelField:"value",mergeProp(t){const e=t.prop.props;W(e,"options")||(e.options=t.prop.options||[])}},sn=oe(V({},st),{name:"radio"}),on=oe(V({},st),{name:"select"}),St=["props"],kt=["class","style","directives"],Vt=["on","hook"],Ce=(t,e={},r={})=>{const n=[...St,...r.normal||[]],o=[...kt,...r.array||[]],i=[...Vt,...r.functional||[]],s=r.props||[];return t.reduce((a,l)=>{for(const u in l)if(a[u])if(s.indexOf(u)>-1)a[u]=Ce([l[u]],a[u]);else if(n.indexOf(u)>-1)a[u]=V(V({},a[u]),l[u]);else if(o.indexOf(u)>-1){const c=a[u]instanceof Array?a[u]:[a[u]],h=l[u]instanceof Array?l[u]:[l[u]];a[u]=[...c,...h]}else if(i.indexOf(u)>-1)for(const c in l[u])if(a[u][c]){const h=a[u][c]instanceof Array?a[u][c]:[a[u][c]],m=l[u][c]instanceof Array?l[u][c]:[l[u][c]];a[u][c]=[...h,...m]}else a[u][c]=l[u][c];else if(u==="hook")for(let c in l[u])a[u][c]?a[u][c]=an(a[u][c],l[u][c]):a[u][c]=l[u][c];else a[u]=l[u];else n.indexOf(u)>-1||i.indexOf(u)>-1||s.indexOf(u)>-1?a[u]=V({},l[u]):o.indexOf(u)>-1?a[u]=l[u]instanceof Array?[...l[u]]:typeof l[u]=="object"?V({},l[u]):l[u]:a[u]=l[u];return a},e)},an=(t,e)=>function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)},Dt=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],ot=["validate","children","control"],at=["effect","deep","renderSlots"];function Ft(){return[...Dt,...St,...kt,...Vt,...ot,...at]}var He=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function We(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Et={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(He,function(){var r=1e3,n=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",u="day",c="week",h="month",m="quarter",p="year",b="date",S="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var v=["th","st","nd","rd"],w=D%100;return"["+D+(v[(w-20)%10]||v[w]||v[0])+"]"}},I=function(D,v,w){var k=String(D);return!k||k.length>=v?D:""+Array(v+1-k.length).join(w)+D},re={s:I,z:function(D){var v=-D.utcOffset(),w=Math.abs(v),k=Math.floor(w/60),O=w%60;return(v<=0?"+":"-")+I(k,2,"0")+":"+I(O,2,"0")},m:function D(v,w){if(v.date()<w.date())return-D(w,v);var k=12*(w.year()-v.year())+(w.month()-v.month()),O=v.clone().add(k,h),F=w-O<0,A=v.clone().add(k+(F?-1:1),h);return+(-(k+(w-O)/(F?O-A:A-O))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:h,y:p,w:c,d:u,D:b,h:l,m:a,s,ms:i,Q:m}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},ee="en",Z={};Z[ee]=M;var L="$isDayjsObject",B=function(D){return D instanceof J||!(!D||!D[L])},z=function D(v,w,k){var O;if(!v)return ee;if(typeof v=="string"){var F=v.toLowerCase();Z[F]&&(O=F),w&&(Z[F]=w,O=F);var A=v.split("-");if(!O&&A.length>1)return D(A[0])}else{var T=v.name;Z[T]=v,O=T}return!k&&O&&(ee=O),O||!k&&ee},x=function(D,v){if(B(D))return D.clone();var w=typeof v=="object"?v:{};return w.date=D,w.args=arguments,new J(w)},P=re;P.l=z,P.i=B,P.w=function(D,v){return x(D,{locale:v.$L,utc:v.$u,x:v.$x,$offset:v.$offset})};var J=function(){function D(w){this.$L=z(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[L]=!0}var v=D.prototype;return v.parse=function(w){this.$d=function(k){var O=k.date,F=k.utc;if(O===null)return new Date(NaN);if(P.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var A=O.match(C);if(A){var T=A[2]-1||0,H=(A[7]||"0").substring(0,3);return F?new Date(Date.UTC(A[1],T,A[3]||1,A[4]||0,A[5]||0,A[6]||0,H)):new Date(A[1],T,A[3]||1,A[4]||0,A[5]||0,A[6]||0,H)}}return new Date(O)}(w),this.init()},v.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},v.$utils=function(){return P},v.isValid=function(){return this.$d.toString()!==S},v.isSame=function(w,k){var O=x(w);return this.startOf(k)<=O&&O<=this.endOf(k)},v.isAfter=function(w,k){return x(w)<this.startOf(k)},v.isBefore=function(w,k){return this.endOf(k)<x(w)},v.$g=function(w,k,O){return P.u(w)?this[k]:this.set(O,w)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(w,k){var O=this,F=!!P.u(k)||k,A=P.p(w),T=function(y,$){var _=P.w(O.$u?Date.UTC(O.$y,$,y):new Date(O.$y,$,y),O);return F?_:_.endOf(u)},H=function(y,$){return P.w(O.toDate()[y].apply(O.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice($)),O)},G=this.$W,K=this.$M,ne=this.$D,Oe="set"+(this.$u?"UTC":"");switch(A){case p:return F?T(1,0):T(31,11);case h:return F?T(1,K):T(0,K+1);case c:var ue=this.$locale().weekStart||0,d=(G<ue?G+7:G)-ue;return T(F?ne-d:ne+(6-d),K);case u:case b:return H(Oe+"Hours",0);case l:return H(Oe+"Minutes",1);case a:return H(Oe+"Seconds",2);case s:return H(Oe+"Milliseconds",3);default:return this.clone()}},v.endOf=function(w){return this.startOf(w,!1)},v.$set=function(w,k){var O,F=P.p(w),A="set"+(this.$u?"UTC":""),T=(O={},O[u]=A+"Date",O[b]=A+"Date",O[h]=A+"Month",O[p]=A+"FullYear",O[l]=A+"Hours",O[a]=A+"Minutes",O[s]=A+"Seconds",O[i]=A+"Milliseconds",O)[F],H=F===u?this.$D+(k-this.$W):k;if(F===h||F===p){var G=this.clone().set(b,1);G.$d[T](H),G.init(),this.$d=G.set(b,Math.min(this.$D,G.daysInMonth())).$d}else T&&this.$d[T](H);return this.init(),this},v.set=function(w,k){return this.clone().$set(w,k)},v.get=function(w){return this[P.p(w)]()},v.add=function(w,k){var O,F=this;w=Number(w);var A=P.p(k),T=function(K){var ne=x(F);return P.w(ne.date(ne.date()+Math.round(K*w)),F)};if(A===h)return this.set(h,this.$M+w);if(A===p)return this.set(p,this.$y+w);if(A===u)return T(1);if(A===c)return T(7);var H=(O={},O[a]=n,O[l]=o,O[s]=r,O)[A]||1,G=this.$d.getTime()+w*H;return P.w(G,this)},v.subtract=function(w,k){return this.add(-1*w,k)},v.format=function(w){var k=this,O=this.$locale();if(!this.isValid())return O.invalidDate||S;var F=w||"YYYY-MM-DDTHH:mm:ssZ",A=P.z(this),T=this.$H,H=this.$m,G=this.$M,K=O.weekdays,ne=O.months,Oe=O.meridiem,ue=function($,_,E,q){return $&&($[_]||$(k,F))||E[_].slice(0,q)},d=function($){return P.s(T%12||12,$,"0")},y=Oe||function($,_,E){var q=$<12?"AM":"PM";return E?q.toLowerCase():q};return F.replace(j,function($,_){return _||function(E){switch(E){case"YY":return String(k.$y).slice(-2);case"YYYY":return P.s(k.$y,4,"0");case"M":return G+1;case"MM":return P.s(G+1,2,"0");case"MMM":return ue(O.monthsShort,G,ne,3);case"MMMM":return ue(ne,G);case"D":return k.$D;case"DD":return P.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return ue(O.weekdaysMin,k.$W,K,2);case"ddd":return ue(O.weekdaysShort,k.$W,K,3);case"dddd":return K[k.$W];case"H":return String(T);case"HH":return P.s(T,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return y(T,H,!0);case"A":return y(T,H,!1);case"m":return String(H);case"mm":return P.s(H,2,"0");case"s":return String(k.$s);case"ss":return P.s(k.$s,2,"0");case"SSS":return P.s(k.$ms,3,"0");case"Z":return A}return null}($)||A.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(w,k,O){var F,A=this,T=P.p(k),H=x(w),G=(H.utcOffset()-this.utcOffset())*n,K=this-H,ne=function(){return P.m(A,H)};switch(T){case p:F=ne()/12;break;case h:F=ne();break;case m:F=ne()/3;break;case c:F=(K-G)/6048e5;break;case u:F=(K-G)/864e5;break;case l:F=K/o;break;case a:F=K/n;break;case s:F=K/r;break;default:F=K}return O?F:P.a(F)},v.daysInMonth=function(){return this.endOf(h).$D},v.$locale=function(){return Z[this.$L]},v.locale=function(w,k){if(!w)return this.$L;var O=this.clone(),F=z(w,k,!0);return F&&(O.$L=F),O},v.clone=function(){return P.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},D}(),se=J.prototype;return x.prototype=se,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",u],["$M",h],["$y",p],["$D",b]].forEach(function(D){se[D[1]]=function(v){return this.$g(v,D[0],D[1])}}),x.extend=function(D,v){return D.$i||(D(v,J,x),D.$i=!0),x},x.locale=z,x.isDayjs=B,x.unix=function(D){return x(1e3*D)},x.en=Z[ee],x.Ls=Z,x.p={},x})})(Et);var ln=Et.exports;const De=We(ln);var Rt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(He,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(C){return(C=+C)+(C>68?1900:2e3)},c=function(C){return function(j){this[C]=+j}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(j){if(!j||j==="Z")return 0;var M=j.match(/([+-]|\d\d)/g),I=60*M[1]+(+M[2]||0);return I===0?0:M[0]==="+"?-I:I}(C)}],m=function(C){var j=l[C];return j&&(j.indexOf?j:j.s.concat(j.f))},p=function(C,j){var M,I=l.meridiem;if(I){for(var re=1;re<=24;re+=1)if(C.indexOf(I(re,0,j))>-1){M=re>12;break}}else M=C===(j?"pm":"PM");return M},b={A:[a,function(C){this.afternoon=p(C,!1)}],a:[a,function(C){this.afternoon=p(C,!0)}],Q:[o,function(C){this.month=3*(C-1)+1}],S:[o,function(C){this.milliseconds=100*+C}],SS:[i,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[s,c("seconds")],ss:[s,c("seconds")],m:[s,c("minutes")],mm:[s,c("minutes")],H:[s,c("hours")],h:[s,c("hours")],HH:[s,c("hours")],hh:[s,c("hours")],D:[s,c("day")],DD:[i,c("day")],Do:[a,function(C){var j=l.ordinal,M=C.match(/\d+/);if(this.day=M[0],j)for(var I=1;I<=31;I+=1)j(I).replace(/\[|\]/g,"")===C&&(this.day=I)}],w:[s,c("week")],ww:[i,c("week")],M:[s,c("month")],MM:[i,c("month")],MMM:[a,function(C){var j=m("months"),M=(m("monthsShort")||j.map(function(I){return I.slice(0,3)})).indexOf(C)+1;if(M<1)throw new Error;this.month=M%12||M}],MMMM:[a,function(C){var j=m("months").indexOf(C)+1;if(j<1)throw new Error;this.month=j%12||j}],Y:[/[+-]?\d+/,c("year")],YY:[i,function(C){this.year=u(C)}],YYYY:[/\d{4}/,c("year")],Z:h,ZZ:h};function S(C){var j,M;j=C,M=l&&l.formats;for(var I=(C=j.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(x,P,J){var se=J&&J.toUpperCase();return P||M[J]||r[J]||M[se].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(D,v,w){return v||w.slice(1)})})).match(n),re=I.length,ee=0;ee<re;ee+=1){var Z=I[ee],L=b[Z],B=L&&L[0],z=L&&L[1];I[ee]=z?{regex:B,parser:z}:Z.replace(/^\[|\]$/g,"")}return function(x){for(var P={},J=0,se=0;J<re;J+=1){var D=I[J];if(typeof D=="string")se+=D.length;else{var v=D.regex,w=D.parser,k=x.slice(se),O=v.exec(k)[0];w.call(P,O),x=x.replace(O,"")}}return function(F){var A=F.afternoon;if(A!==void 0){var T=F.hours;A?T<12&&(F.hours+=12):T===12&&(F.hours=0),delete F.afternoon}}(P),P}}return function(C,j,M){M.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(u=C.parseTwoDigitYear);var I=j.prototype,re=I.parse;I.parse=function(ee){var Z=ee.date,L=ee.utc,B=ee.args;this.$u=L;var z=B[1];if(typeof z=="string"){var x=B[2]===!0,P=B[3]===!0,J=x||P,se=B[2];P&&(se=B[2]),l=this.$locale(),!x&&se&&(l=M.Ls[se]),this.$d=function(k,O,F,A){try{if(["x","X"].indexOf(O)>-1)return new Date((O==="X"?1e3:1)*k);var T=S(O)(k),H=T.year,G=T.month,K=T.day,ne=T.hours,Oe=T.minutes,ue=T.seconds,d=T.milliseconds,y=T.zone,$=T.week,_=new Date,E=K||(H||G?1:_.getDate()),q=H||_.getFullYear(),Y=0;H&&!G||(Y=G>0?G-1:_.getMonth());var he,pe=ne||0,me=Oe||0,ce=ue||0,ge=d||0;return y?new Date(Date.UTC(q,Y,E,pe,me,ce,ge+60*y.offset*1e3)):F?new Date(Date.UTC(q,Y,E,pe,me,ce,ge)):(he=new Date(q,Y,E,pe,me,ce,ge),$&&(he=A(he).week($).toDate()),he)}catch(Ee){return new Date("")}}(Z,z,L,M),this.init(),se&&se!==!0&&(this.$L=this.locale(se).$L),J&&Z!=this.format(z)&&(this.$d=new Date("")),l={}}else if(z instanceof Array)for(var D=z.length,v=1;v<=D;v+=1){B[1]=z[v-1];var w=M.apply(this,B);if(w.isValid()){this.$d=w.$d,this.$L=w.$L,this.init();break}v===D&&(this.$d=new Date(""))}else re.call(this,ee)}}})})(Rt);var un=Rt.exports;const cn=We(un);var At={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(He,function(){var r="day";return function(n,o,i){var s=function(u){return u.add(4-u.isoWeekday(),r)},a=o.prototype;a.isoWeekYear=function(){return s(this).year()},a.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var c,h,m,p,b=s(this),S=(c=this.isoWeekYear(),h=this.$u,m=(h?i.utc:i)().year(c).startOf("year"),p=4-m.isoWeekday(),m.isoWeekday()>4&&(p+=7),m.add(p,r));return b.diff(S,"week")+1},a.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=a.startOf;a.startOf=function(u,c){var h=this.$utils(),m=!!h.u(c)||c;return h.p(u)==="isoweek"?m?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,c)}}})})(At);var fn=At.exports;const dn=We(fn);var Mt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(He,function(){var r="month",n="quarter";return function(o,i){var s=i.prototype;s.quarter=function(u){return this.$utils().u(u)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(u-1))};var a=s.add;s.add=function(u,c){return u=Number(u),this.$utils().p(c)===n?this.add(3*u,r):a.bind(this)(u,c)};var l=s.startOf;s.startOf=function(u,c){var h=this.$utils(),m=!!h.u(c)||c;if(h.p(u)===n){var p=this.quarter()-1;return m?this.month(3*p).startOf(r).startOf("day"):this.month(3*p+2).endOf(r).endOf("day")}return l.bind(this)(u,c)}}})})(Mt);var hn=Mt.exports;const pn=We(hn);function le(t){const e=t.replace(/(-[a-z])/g,function(r){return r.replace("-","").toLocaleUpperCase()});return jt(e)}function jt(t){return t.replace(t[0],t[0].toLowerCase())}De.extend(cn),De.extend(dn),De.extend(pn);function lt(t,e){return{value:t,enumerable:!1,configurable:!1,writable:!0}}function Nt(t,e){return Pt([t],e||!1)[0]}function Pt(t,e){return Pe([],[...t],e||!1)}const mn={array:ot,normal:at};function ve(t,e){return Ce(Array.isArray(e)?e:[e],t,mn),t}function Tt(t){const e=g.Function(t.getRule)?t.getRule():t;return e.type||(e.type="input"),e}function gn(t,e){return t?(Object.keys(e||{}).forEach(r=>{e[r]&&(t[r]=ve(t[r]||{},e[r]))}),t):e}function It(t,e){Object.defineProperties(t,Object.keys(e).reduce((r,n)=>(r[n]={get(){return e[n]()}},r),{}))}function be(t){return t.__fc__||(t.__origin__?t.__origin__.__fc__:null)}function N(t,e){try{e=t()}catch(r){Jr(r)}return e}function ze(){const t={},e=r=>r||"default";return{setSlot(r,n){r=e(r),!(!n||Array.isArray(n)&&n.length)&&(t[r]||(t[r]=[]),t[r].push(n))},getSlot(r,n){r=e(r);const o=[];return(t[r]||[]).forEach(i=>{if(Array.isArray(i))o.push(...i);else if(g.Function(i)){const s=i(...n||[]);Array.isArray(s)?o.push(...s):o.push(s)}else g.Undef(i)||o.push(i)}),o},getSlots(){const r={};return Object.keys(t).forEach(n=>{r[n]=(...o)=>this.getSlot(n,o)}),r},slotLen(r){return r=e(r),t[r]?t[r].length:0},mergeBag(r){if(!r)return this;const n=g.Function(r.getSlots)?r.getSlots():r;return Array.isArray(r)||f.isVNode(r)?this.setSlot(void 0,()=>r):Object.keys(n).forEach(o=>{this.setSlot(o,n[o])}),this}}}function Bt(t){const e=V({},t.props||{});return Object.keys(t.on||{}).forEach(r=>{r.indexOf("-")>0&&(r=le(r));const n=`on${Ot(r)}`;Array.isArray(e[n])?e[n]=[...e[n],t.on[r]]:e[n]?e[n]=[e[n],t.on[r]]:e[n]=t.on[r]}),e.key=t.key,e.ref=t.ref,e.class=t.class,e.id=t.id,e.style=t.style,e.slot&&delete e.slot,e}function Ge(t,e){return Object.setPrototypeOf(t,e),t}const Lt=(t,e)=>typeof t=="string"?String(e):typeof t=="number"?Number(e):e;function yn(t){if(g.Number(t))return!Number.isFinite(t)||t<1e9?NaN:t>=1e11?t:t*1e3;if(!g.String(t))return NaN;const e=t.trim();return/^\d{11,}$/.test(e)?Number(e):/^\d{10}$/.test(e)?Number(e)*1e3:NaN}function Je(t){let e;if(g.Date(t))e=De(t);else{const r=yn(t);Number.isNaN(r)?g.String(t)&&(e=De(t.trim().replace("T"," "),["YYYY-MM-DD HH:mm:ss","YYYY-MM-DD"],!0)):e=De(r)}return e&&e.isValid()?e:null}function $n(t){return typeof t!="number"||!Number.isInteger(t)||t<0?NaN:t}function Q(t,e){return[t.valueOf(),e.valueOf()]}function ut(t,e){return Array.isArray(t)?t.length>0&&t.every(r=>e(r)):e(t)}function Fe(t,e,r,n){const o=$n(e);if(Number.isNaN(o))return!1;const i=De().add(n*o,r).valueOf();return ut(t,s=>{const a=Je(s);if(!a)return!1;const l=a.valueOf();return n<0?l<i:l>i})}function xt(t,e,r){const n=Je(e);if(!n)return!1;const o=n.valueOf();return ut(t,i=>{const s=Je(i);return s?r<0?s.valueOf()<o:s.valueOf()>o:!1})}const bn={recent7Day(t){return Q(t.startOf("day").subtract(6,"day"),t.endOf("day"))},recent30Day(t){return Q(t.startOf("day").subtract(29,"day"),t.endOf("day"))},coming7Day(t){return Q(t.startOf("day"),t.add(6,"day").endOf("day"))},coming30Day(t){return Q(t.startOf("day"),t.add(29,"day").endOf("day"))},thisWeek(t){return Q(t.startOf("isoWeek"),t.endOf("isoWeek"))},lastWeek(t){const e=t.startOf("isoWeek").subtract(1,"week");return Q(e,e.endOf("isoWeek"))},nextWeek(t){const e=t.startOf("isoWeek").add(1,"week");return Q(e,e.endOf("isoWeek"))},thisMonth(t){return Q(t.startOf("month"),t.endOf("month"))},lastMonth(t){const e=t.startOf("month").subtract(1,"month");return Q(e,e.endOf("month"))},nextMonth(t){const e=t.startOf("month").add(1,"month");return Q(e,e.endOf("month"))},recentMonth(t){return Q(t.subtract(1,"month").startOf("day"),t.endOf("day"))},comingMonth(t){return Q(t.startOf("day"),t.add(1,"month").endOf("day"))},recent3Month(t){return Q(t.subtract(3,"month").startOf("day"),t.endOf("day"))},recent6Month(t){return Q(t.subtract(6,"month").startOf("day"),t.endOf("day"))},thisQuarter(t){return Q(t.startOf("quarter"),t.endOf("quarter"))},lastQuarter(t){const e=t.startOf("quarter").subtract(1,"quarter");return Q(e,e.endOf("quarter"))},nextQuarter(t){const e=t.startOf("quarter").add(1,"quarter");return Q(e,e.endOf("quarter"))},thisYear(t){return Q(t.startOf("year"),t.endOf("year"))},lastYear(t){const e=t.startOf("year").subtract(1,"year");return Q(e,e.endOf("year"))},nextYear(t){const e=t.startOf("year").add(1,"year");return Q(e,e.endOf("year"))},recentYear(t){return Q(t.subtract(1,"year").startOf("day"),t.endOf("day"))},comingYear(t){return Q(t.startOf("day"),t.add(1,"year").endOf("day"))}};function _n(t,e){const r=g.String(e)?bn[e]:null;if(!r)return!1;const[n,o]=r(De());return ut(t,i=>{const s=Je(i);return!!s&&s.valueOf()>=n&&s.valueOf()<=o})}const Me={"==":(t,e)=>JSON.stringify(t)===JSON.stringify(Lt(t,e)),"!=":(t,e)=>!Me["=="](t,e),">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,on(t,e){return t&&t.indexOf&&t.indexOf(Lt(t[0],e))>-1},notOn(t,e){return!Me.on(t,e)},in(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn(t,e){return!Me.in(t,e)},between(t,e){return t>e[0]&&t<e[1]},notBetween(t,e){return t<e[0]||t>e[1]},empty(t){return g.empty(t)},notEmpty(t){return!g.empty(t)},pattern(t,e){return new RegExp(e,"g").test(t)},beforeDay(t,e){return Fe(t,e,"day",-1)},afterDay(t,e){return Fe(t,e,"day",1)},beforeWeek(t,e){return Fe(t,e,"week",-1)},afterWeek(t,e){return Fe(t,e,"week",1)},beforeMonth(t,e){return Fe(t,e,"month",-1)},afterMonth(t,e){return Fe(t,e,"month",1)},beforeYear(t,e){return Fe(t,e,"year",-1)},afterYear(t,e){return Fe(t,e,"year",1)},beforeDate(t,e){return xt(t,e,-1)},afterDate(t,e){return xt(t,e,1)},period(t,e){return _n(t,e)}};function ae(t,e){return(Array.isArray(e)?e:(e||"").split(".")).forEach(r=>{t!=null&&(t=t[r])}),t}function wn(t){const e=/{{\s*(.*?)\s*}}/g;let r;const n={};for(;(r=e.exec(t))!==null;)r[1]&&(n[r[1]]=!0);return Object.keys(n)}function qt(t){let e=t.split("."),r=[],n="";return e.forEach((o,i)=>{i===0?n=o:n+="."+o,r.push(n)}),r.join(" && ")}function Yt(t){const e=[];let r="",n=0;for(let o=0;o<t.length;o++){const i=t[o];i==="["?(n===0&&r&&(e.push({type:"key",value:r}),r=""),n++,r+=i):i==="]"?(n--,r+=i,n===0&&(e.push({type:"bracket",value:Yt(r.slice(1,-1))}),r="")):i==="."&&n===0?r&&(e.push({type:"key",value:r}),r=""):r+=i}return r&&e.push({type:"key",value:r}),e.map(o=>o.type==="key"?{key:o.value}:{children:o.value})}const Qe=(t,e)=>{if(!(!t||t===e)){if(t.props.formCreateInject)return t.props.formCreateInject;if(t.parent)return Qe(t.parent,e)}};function On(){return typeof document!="undefined"&&typeof document.createElement=="function"&&document.head!=null}function Cn(t,e,r){return f.defineComponent({name:"FormCreate"+(t.isMobile?"Mobile":""),components:e,directives:r,props:{rule:{type:Array,required:!0,default:()=>[]},option:{type:Object,default:()=>({})},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","beforeUnmount","submit","reset","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail","created"],render(){return this.fc.render()},setup(n){const o=f.getCurrentInstance();f.provide("parentFC",o);const i=f.inject("parentFC",null);let s=i;if(i)for(;s.setupState.parent;)s=s.setupState.parent;else s=o;const{rule:a,modelValue:l,subForm:u,inFor:c}=f.toRefs(n),h=f.reactive({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:[...a.value||[]]});let m=JSON.stringify(l.value||{});const p=new t(o),b=p.api(),S=c.value,C=()=>{if(i){const L=Qe(o,i);if(L){let B;S?(B=X(L.getSubForm()),B.push(b)):B=b,L.subForm(B)}}},j=()=>{const L=Qe(o,i);if(L)if(S){const B=X(L.getSubForm()),z=B.indexOf(b);z>-1&&B.splice(z,1)}else L.subForm()};let M=null;f.onBeforeMount(()=>{On()&&f.watchEffect(()=>{let L="";const B=n.option&&n.option.globalClass||{};Object.keys(B).forEach(z=>{let x="";B[z].style&&Object.keys(B[z].style).forEach(P=>{x+=Te(P)+":"+B[z].style[P]+";"}),B[z].content&&(x+=B[z].content+";"),x&&(L+=`.${z}{${x}}`)}),n.option&&n.option.style&&(L+=n.option.style),M||(M=document.createElement("style"),M.type="text/css",document.head.appendChild(M)),M.innerHTML=L||""})});const I=ke(()=>{p.bus.$emit("$loadData.$topForm")},100),re=ke(function(){p.bus.$emit("$loadData.$scopeForm")},100),ee=ke(()=>{p.bus.$emit("$loadData.$form")},100),Z=L=>{p.bus.$emit("change-$form."+L)};return f.onMounted(()=>{i&&(b.top.bus.$on("$loadData.$form",I),b.top.bus.$on("change",Z)),b!==b.scope&&b.scope.bus.$on("$loadData.$scopeForm",re),p.mounted()}),f.onBeforeUnmount(()=>{i&&(b.top.bus.$off("$loadData.$form",I),b.top.bus.$off("change",Z)),b!==b.scope&&b.scope.bus.$off("$loadData.$scopeForm",re),j(),h.destroyed=!0,p.unmount(),M&&M.parentNode&&M.parentNode.removeChild(M)}),f.onUpdated(()=>{p.updated()}),C(),f.watch(()=>n.option,()=>{p.initOptions(),b.refresh()},{deep:!0,flush:"sync"}),f.watch(()=>[...a.value],L=>{p.$handle.isBreakWatch()||L.length===h.renderRule.length&&L.every(B=>h.renderRule.indexOf(B)>-1)||(p.$handle.updateAppendData(),p.$handle.reloadRule(a.value),o.setupState.renderRule())}),f.watch(()=>[n.disabled,n.preview],()=>{b.refresh()}),f.watch(l,L=>{Ie(L||{})!==m&&(b.config.forceCoverValue?b.coverValue(L||{}):b.setValue(L||{}))},{deep:!0,flush:"post"}),f.watch(()=>n.index,()=>{b.coverValue({}),p.$handle.updateAppendData(),f.nextTick(()=>{f.nextTick(()=>{b.clearValidateState()})})},{flush:"sync"}),oe(V({fc:f.markRaw(p),parent:i&&f.markRaw(i),top:f.markRaw(s),fapi:f.markRaw(b)},f.toRefs(h)),{getGroupInject:()=>Qe(o,i),refresh(){++h.unique},renderRule(){h.renderRule=[...a.value||[]]},updateValue(L){if(h.destroyed)return;const B=Ie(L);m!==B&&(m=B,o.emit("update:modelValue",L),f.nextTick(()=>{ee(),i?u.value||re():(I(),re())}))}})},created(){const n=f.getCurrentInstance();n.emit("update:api",n.setupState.fapi),n.setupState.fc.init()}})}function Ut(){return{props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0}}function ie(t,e){return(r,n,o,i={})=>{const s=new ct(t,r,n,o,i);return e&&(g.Function(e)?e(s):s.props(e)),s}}function ct(t,e,r,n,o){this._data=R(Ut(),{type:t,title:e,field:r,value:n,props:o||{}}),this.event=this.on}R(ct.prototype,{getRule(){return this._data},setProp(t,e){return fe(this._data,t,e),this},modelField(t){return this._data.modelField=t,this},_clone(){const t=new this.constructor;return t._data=Nt(this._data),t}});function Ht(t){t.forEach(e=>{ct.prototype[e]=function(r){return ve(this._data,{[e]:arguments.length<2?r:{[r]:arguments[1]}}),this}})}Ht(Ft());const vn=ie("");function Sn(t,e,r){let n=vn("",e);return n._data.type=t,n._data.title=r,n}function kn(){return{create:Sn,factory:ie}}function Vn(t,e,r){const n=`fail to ${t} ${r.status}'`,o=new Error(n);return o.status=r.status,o.url=t,o}function Wt(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(r){return e}}function zt(t){if(typeof XMLHttpRequest=="undefined")return;const e=new XMLHttpRequest;let r=t.action||"";if(e.upload&&t.onProgress&&e.upload.addEventListener("progress",i=>{i.percent=i.total>0?i.loaded/i.total*100:0,t.onProgress(i)}),t.query){const i=g.String(t.query)?t.query:Object.keys(t.query).reduce((a,l)=>(a[l]=t.query[l]===null||t.query[l]===void 0?"":t.query[l],a),{}),s=new URLSearchParams(i).toString();s&&(r.includes("?")?r+=`&${s}`:r+=`?${s}`)}e.onerror=function(s){t.onError(s)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(Vn(r,t,e),Wt(e));t.onSuccess(Wt(e))},e.open(t.method||"get",r,!0);let n;(t.data||t.file)&&(t.file||(t.dataType||"").toLowerCase()!=="json"?(n=new FormData,Object.keys(t.data||{}).map(i=>{n.append(i,t.data[i])})):(n=JSON.stringify(t.data||{}),e.setRequestHeader("content-type","application/json"))),t.file&&n.append(t.filename,t.file,t.file.name),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const o=t.headers||{};Object.keys(o).forEach(i=>{o[i]!=null&&e.setRequestHeader(i,o[i])}),e.send(n)}function Gt(t,e,r){return new Promise((n,o)=>{(e||zt)(oe(V({},t),{onSuccess(i){let s=l=>l;const a=$e(t.parse);g.Function(a)?s=a:a&&g.String(a)&&(s=l=>ae(l,a)),qe(s(i,t.targetRule,r)).then(l=>{n(l)})},onError(i){o(i)}}))})}function Be(t){return ye(t)}function Dn(t){function e(i){return g.Undef(i)?i=t.fields():Array.isArray(i)||(i=[i]),i}function r(i,s,a){g.Undef(i)?i=Object.keys(V(V({},t.fieldCtx),t.nameCtx)):Array.isArray(i)||(i=[i]),i.forEach(l=>{const u=t.fieldCtx[l]||t.nameCtx[l];u&&u.forEach(c=>{fe(c.rule,s,a),t.$render.clearCache(c)})})}function n(){const i=t.subForm;return Object.keys(i).reduce((s,a)=>{const l=i[a];return l&&(Array.isArray(l)?s.push(...l):s.push(l)),s},[])}const o={get isScope(){return t.vm.props.subForm===!1},get isPreview(){return t.preview},get config(){return t.options},set config(i){t.fc.options.value=i},get options(){return t.options},set options(i){t.fc.options.value=i},get form(){return t.form},get rule(){return t.rules},get parent(){return t.vm.setupState.parent&&t.vm.setupState.parent.setupState.fapi},get top(){return o.parent?o.parent.top:o},get scope(){let i=t.vm;for(;i&&i.setupState.fapi;)if(i.props.subForm)i=i.setupState.parent;else return i.setupState.fapi;return o.top},get children(){return n()},get siblings(){const i=t.vm.setupState.getGroupInject();if(i){const s=i.getSubForm();if(Array.isArray(s))return[...s]}},get index(){const i=o.siblings;if(i){const s=i.indexOf(o);return s>-1?s:void 0}},get formulas(){return V({},t.fc.formulas)},formData(i){if(i==null||typeof i=="boolean"){const s={};return Object.keys(t.form).forEach(a=>{(i===!0||t.ignoreFields.indexOf(a)===-1)&&(s[a]=Be(t.form[a]))}),s}else return e(i).reduce((s,a)=>(s[a]=o.getValue(a),s),{})},getValue(i){const s=t.getFieldCtx(i);return s?Be(s.rule.value):t.options.appendValue!==!1&&W(t.appendData,i)?Be(t.appendData[i]):void 0},coverValue(i){const s=V({},i||{});t.deferSyncValue(()=>{t.appendData={},o.fields().forEach(a=>{const l=t.fieldCtx[a];if(l){const u=W(i,a);l.forEach(c=>{c.rule.value=u?i[a]:void 0}),delete s[a]}}),R(t.appendData,s)},!0)},setValue(i){let s=i;arguments.length>=2&&(s={[i]:arguments[1]}),t.deferSyncValue(()=>{Object.keys(s).forEach(a=>{const l=t.fieldCtx[a];if(!l)return t.appendData[a]=s[a];l.forEach(u=>{u.rule.value=s[a]})})},!0)},removeField(i){const s=t.getCtx(i);return t.deferSyncValue(()=>{t.getCtxs(i).forEach(a=>{a.rm()})},!0),s?s.origin:void 0},removeRule(i){const s=i&&be(i);if(s)return s.rm(),s.origin},fields:()=>t.fields(),append:(i,s,a)=>{let l=t.sort.length-1,u;const c=t.getCtx(s);if(c)if(a){if(u=c.getPending("children",c.rule.children),!Array.isArray(u))return;l=c.rule.children.length-1}else l=c.root.indexOf(c.origin),u=c.root;else u=t.rules;u.splice(l+1,0,i)},prepend:(i,s,a)=>{let l=0,u;const c=t.getCtx(s);if(c)if(a){if(u=c.getPending("children",c.rule.children),!Array.isArray(u))return}else l=c.root.indexOf(c.origin),u=c.root;else u=t.rules;u.splice(l,0,i)},hidden(i,s){r(s,"hidden",!!i),t.refresh()},hiddenStatus(i){const s=t.getCtx(i);if(s)return!!s.rule.hidden},display(i,s){r(s,"display",!!i),t.refresh()},displayStatus(i){const s=t.getCtx(i);if(s)return!!s.rule.display},disabled(i,s){e(s).forEach(a=>{t.getCtxs(a).forEach(l=>{fe(l.rule.props,"disabled",!!i)})}),t.refresh()},required(i,s){const a=!!i;e(s).forEach(l=>{t.getCtxs(l).forEach(u=>{const c=W(u.rule,"$required")?u.rule.$required:u.rule.effect&&u.rule.effect.required;g.Object(c)?fe(c,"required",a):o.setEffect(u.id,"required",a)})}),t.refresh()},all(i){return Object.keys(t.ctxs).map(s=>{const a=t.ctxs[s];return i?a.origin:a.rule})},model(i){return t.fields().reduce((s,a)=>{const l=t.fieldCtx[a][0];return s[a]=i?l.origin:l.rule,s},{})},component(i){return Object.keys(t.nameCtx).reduce((s,a)=>{const l=t.nameCtx[a].map(u=>i?u.origin:u.rule);return s[a]=l.length===1?l[0]:l,s},{})},bind(){return o.form},reload:i=>{t.reloadRule(i)},updateOptions(i){t.fc.updateOptions(i),o.refresh()},onSubmit(i){o.updateOptions({onSubmit:i})},sync:i=>{if(Array.isArray(i)){i.forEach(a=>o.sync(a));return}let s=g.Object(i)?be(i):t.getCtxs(i);s&&(s=Array.isArray(s)?s:[s],s.forEach(a=>{if(!a.deleted){const l=t.subForm[a.id];l&&(Array.isArray(l)?l.forEach(u=>{u.refresh()}):l&&l.refresh()),t.$render.clearCache(a)}}),t.refresh())},refresh:()=>{n().forEach(i=>{i.refresh()}),t.$render.clearCacheAll(),t.refresh()},refreshOptions(){t.$manager.updateOptions(t.options),o.refresh()},hideForm:i=>{t.vm.setupState.isShow=!i},changeStatus:()=>t.changeStatus,clearChangeStatus:()=>{t.changeStatus=!1},updateRule(i,s){t.getCtxs(i).forEach(a=>{R(a.rule,s)})},updateRules(i){Object.keys(i).forEach(s=>{o.updateRule(s,i[s])})},mergeRule:(i,s)=>{t.getCtxs(i).forEach(a=>{ve(a.rule,s)})},mergeRules(i){Object.keys(i).forEach(s=>{o.mergeRule(s,i[s])})},getRule:(i,s)=>{const a=t.getCtx(i);if(a)return s?a.origin:a.rule},findType(i,s){let a;return Object.keys(t.ctxs).forEach(l=>{const u=t.ctxs[l];u.rule.type===i&&(a=s?u.origin:u.rule)}),a},findTypes(i,s){let a=[];return Object.keys(t.ctxs).forEach(l=>{const u=t.ctxs[l];u.rule.type===i&&a.push(s?u.origin:u.rule)}),a},getRenderRule:i=>{const s=t.getCtx(i);if(s)return s.prop},getRefRule:i=>{const s=t.getCtxs(i);if(s){const a=s.map(l=>l.rule);return a.length===1?a[0]:a}},setEffect(i,s,a){const l=t.getCtx(i);l&&s&&(s[0]==="$"&&(s=s.substr(1)),W(l.rule,"$"+s)&&fe(l.rule,"$"+s,a),W(l.rule,"effect")||(l.rule.effect={}),fe(l.rule.effect,s,a))},clearEffectData(i,s){const a=t.getCtx(i);a&&(s&&s[0]==="$"&&(s=s.substr(1)),a.clearEffectData(s),o.sync(i))},updateValidate(i,s,a){a?o.mergeRule(i,{validate:s}):r(i,"validate",s)},updateValidates(i,s){Object.keys(i).forEach(a=>{o.updateValidate(a,i[a],s)})},refreshValidate(){o.refresh()},resetFields(i){e(i).forEach(s=>{t.getCtxs(s).forEach(a=>{t.$render.clearCache(a),a.rule.value=Be(a.defaultValue)})}),f.nextTick(()=>{f.nextTick(()=>{f.nextTick(()=>{o.clearValidateState(i)})})}),i==null&&(g.Function(t.options.onReset)&&N(()=>t.options.onReset(o)),t.vm.emit("reset",o))},method(i,s){const a=o.el(i);if(!a||!a[s])throw new Error(Ct("err",`${s} 方法不存在`));return(...l)=>a[s](...l)},exec(i,s,...a){return N(()=>o.method(i,s)(...a))},toJson(i){return Ie(o.rule,i)},trigger(i,s,...a){const l=o.el(i);l&&l.$emit(s,...a)},el(i){const s=t.getCtx(i);if(s)return s.el||t.vm.refs[s.ref]},scrollTo(i,s={block:"center",inline:"nearest",behavior:"smooth"}){const a=o.el(i);if(!a)return;const l=a.$el!==void 0?a.$el:a;if(!l)return;const u=l.nodeType===1?l:l.firstElementChild;u&&typeof u.scrollIntoView=="function"&&u.scrollIntoView(s)},focus(i){const s=o.el(i);if(!s)return;const a=h=>!h||typeof h.focus!="function"?!1:(N(()=>h.focus()),!0);if(a(s))return;const l=s.$el!==void 0?s.$el:s;if(a(l))return;const u=l&&(l.nodeType===1?l:l.firstElementChild);if(a(u)||!u||!u.querySelector)return;const c=u.querySelector('input:not([type=hidden]):not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])');a(c)},closeModal:i=>{t.bus.$emit("fc:closeModal:"+i)},getSubForm(i){const s=t.getCtx(i);return s?t.subForm[s.id]:void 0},getChildrenRuleList(i){const s=typeof i=="object",a=s?be(i):t.getCtx(i),l=a?a.rule:s?i:o.getRule(i);if(!l)return[];const u=[];return(h=>{h&&h.forEach(m=>{typeof m=="object"&&(m.field&&u.push(m),u.push(...o.getChildrenRuleList(m)))})})(a?a.loadChildrenPending():l.children),u},getParentRule(i){return(typeof i=="object"?be(i):t.getCtx(i)).parent.rule},getParentSubRule(i){const a=typeof i=="object"?be(i):t.getCtx(i);if(a){const l=a.getParentGroup();if(l)return l.rule}},getChildrenFormData(i,s){return o.getChildrenRuleList(i).reduce((l,u)=>((u.ignore!==!0||s===!0)&&(l[u.field]=Be(u.value)),l),{})},setChildrenFormData(i,s,a){const l=o.getChildrenRuleList(i);t.deferSyncValue(()=>{l.forEach(u=>{W(s,u.field)?u.value=s[u.field]:a&&(u.value=void 0)})})},getGlobalEvent(i){let s=o.options.globalEvent[i];if(s)return typeof s=="object"&&(s=s.handle),$e(s)},getGlobalData(i){return new Promise((s,a)=>{let l=o.options.globalData[i];l?l.type==="fetch"?o.fetch(l).then(u=>{s(u)}).catch(a):s(l.data):s(t.fc.loadData[i])})},emitGlobalEvent(i,...s){const a=o.getGlobalEvent(i);if(a){const l=t.getInjectData({},void 0);return l.args=[...s],s.unshift(l),a.apply(null,s)}},setGlobalData(i,s){o.setData("$globalData."+i,s)},setGlobalVar(i,s){o.setData("$var."+i,s)},renderRule(i,s,a){const u=typeof i=="object"?be(i):t.getCtx(i);return u?t.$render.createRuleVnode(u,s,a):void 0},renderChildren(i,s,a){const u=typeof i=="object"?be(i):t.getCtx(i);return u?t.$render.createChildrenVnodes(u,s,a):void 0},nextTick(i){t.bus.$once("next-tick",i),t.refresh()},nextRefresh(i){t.nextRefresh(),i&&N(i)},deferSyncValue(i,s){t.deferSyncValue(i,s)},emit(i,...s){t.vm.emitsOptions&&!t.vm.emitsOptions[i]&&(t.vm.emitsOptions[i]=null),t.vm.emit(i,...s)},bus:t.bus,getCurrentFormRule(){var i;return(i=t.vm.setupState.getGroupInject())==null?void 0:i.rule},fetch(i){return new Promise((s,a)=>{let l=V({},i);l=t.loadFetchVar(l);const u=c=>{N(()=>l.onError&&l.onError(c)),a(c)};t.beforeFetch(l).then(()=>Gt(l,t.fc.create.fetch,o).then(c=>{N(()=>l.onSuccess&&l.onSuccess(c)),s(c)}).catch(c=>{u(c)})).catch(c=>{u(c)})})},watchFetch(i,s,a,l){return t.fc.watchLoadData((u,c)=>{let h=V({},i);if(h=t.loadFetchVar(h,u),l&&l(h,c)===!1)return;const m=p=>{N(()=>h.onError&&h.onError(p)),a&&a(p)};t.beforeFetch(h).then(()=>Gt(h,t.fc.create.fetch,o).then(p=>{N(()=>h.onSuccess&&h.onSuccess(p)),s&&s(p,c)}).catch(p=>{m(p)})).catch(p=>{m(p)})},i.wait==null?1e3:i.wait)},getData(i,s){return t.fc.get?t.fc.get(i,s):t.fc.getLoadData(i,s)},watchData(i){return t.fc.watchLoadData((s,a)=>{N(()=>i(s,a))})},setData(i,s,a){return t.fc.setData(i,s,a)},refreshData(i){return t.fc.refreshData(i)},t(i,s){return t.fc.t(i,s)},getLocale(){return t.fc.getLocale()},helper:{tidyFields:e,props:r}};return["on","once","off"].forEach(i=>{o[i]=function(...s){t.bus[`$${i}`](...s)}}),o.changeValue=o.changeField=o.setValue,o}function Fn(t){R(t.prototype,{initCache(){this.clearCacheAll()},clearCache(e){if(!e.rule.cache){if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id].parent&&this.clearCache(this.cache[e.id].parent),this.cache[e.id]=null}},clearCacheAll(){this.cache={}},setCache(e,r,n){this.cache[e.id]={vnode:r,use:!1,parent:n,slot:e.rule.slot}},getCache(e){const r=this.cache[e.id];if(r)return r.use=!0,r.vnode}})}function En(t){R(t.prototype,{initRender(){this.cacheConfig={}},getTypeSlot(e){const r=n=>{if(n){let o;return e.rule.field&&(o=n.slots["field-"+Te(e.rule.field)]||n.slots["field-"+e.rule.field]),o||(o=n.slots["type-"+Te(e.type)]||n.slots["type-"+e.type]),o||r(n.setupState.parent)}};return r(this.vm)},render(){if(!this.vm.setupState.isShow)return;this.$manager.beforeRender(),this.applyShowNumber(this.$manager.rule);const e=ze();return this.sort.forEach(r=>{this.renderSlot(e,this.$handle.ctxs[r])}),this.$manager.render(e)},applyShowNumber(e){const r=this.$handle.options||{};if(!r.showNumber||!e)return;e.class=this.mergeClass(e.class,"is-numbered"),r.showNumber==="chinese"&&(e.class=this.mergeClass(e.class,"is-number-chinese"));const n=r.numberColor,o=(r.form||{}).style;if(!n){e.style=o;return}g.String(o)?e.style=`${o};--fc-number-color:${n}`:Array.isArray(o)?e.style=o.concat({"--fc-number-color":n}):e.style=oe(V({},o||{}),{"--fc-number-color":n})},renderSlot(e,r,n){if(this.isFragment(r)){r.initProp(),this.mergeGlobal(r),r.initNone();const o=this.renderChildren(r.loadChildrenPending(),r),i=o.default;i&&e.setSlot(r.rule.slot,()=>i()),delete o.default,e.mergeBag(o)}else e.setSlot(r.rule.slot,this.renderCtx(r,n))},mergeGlobal(e){if(!this.$handle.options.global)return;const{trueType:n,originType:o,type:i}=e;this.cacheConfig[n]||(this.cacheConfig[n]=f.computed(()=>{const s=this.$handle.options.global;return ve({},[s["*"]||s.default||{},s[o]||s[i]||{}])})),e.prop=ve({},[this.cacheConfig[e.trueType].value,e.prop])},setOptions(e){const r=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=r,e.prop.optionsTo&&r&&Ve(e.prop,e.prop.optionsTo,r)},deepSet(e){const r=e.prop.deep;r&&Object.keys(r).sort((n,o)=>n.length<o.length?-1:1).forEach(n=>{Ve(e.prop,n,r[n])})},parseSide(e,r){return g.Object(e)?ve({props:{formCreateInject:r.prop.props.formCreateInject}},e):e},renderSides(e,r,n){const o=r[n?"rule":"prop"];return[this.renderRule(this.parseSide(o.prefix,r)),e,this.renderRule(this.parseSide(o.suffix,r))]},renderId(e,r){const n=this.$handle[r==="field"?"fieldCtx":"nameCtx"][e];return n?n.map(o=>this.renderCtx(o,o.parent)):void 0},renderCtx(e,r){try{if(e.type==="hidden")return;const n=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==n.slot){let o;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);let i=e.prop;i.preview=!!(i.preview!=null?i.preview:this.$handle.preview),i.props.formCreateInject=this.injectProp(e);let s=i.cache!==!1;const a=i.preview;if(i.hidden){this.setCache(e,void 0,r);return}o=(...l)=>{var b,S;const u={rule:n,prop:i,preview:a,api:this.$handle.api,model:i.model||{},slotValue:l};l.length&&n.slotUpdate&&N(()=>n.slotUpdate(u));let c={};const h=e.loadChildrenPending();e.parser.renderChildren?c=e.parser.renderChildren(h,e):e.parser.loadChildren!==!1&&(c=this.renderChildren(h,e)),Object.keys(i.renderSlots||{}).forEach(C=>{c[C]=(...j)=>{if(g.Function(i.renderSlots[C]))return N(()=>i.renderSlots[C](...j));const M=this.parseSide(i.renderSlots[C],e);return this.renderRule(M)}});const m=this.getTypeSlot(e);let p;return m?(u.children=c,p=m(u)):p=a?e.parser.preview(et(c),e):e.parser.render(et(c),e),p=this.renderSides(p,e),(b=i.title)!=null&&b.show&&(i.wrap=V({show:!0},i.wrap||{}),i.native||(i.native=!1)),(!(!e.input&&g.Undef(i.native))||((S=i.col)==null?void 0:S.show)===!0)&&i.native!==!0&&(this.fc.targetFormDriver("updateWrap",e),p=this.$manager.makeWrap(e,p)),e.none&&(Array.isArray(p)?p=p.map(C=>!C||!C.__v_isVNode?C:this.none(C)):p=this.none(p)),s&&this.setCache(e,()=>this.stable(p),r),p},this.setCache(e,o,r)}return(...o)=>{const i=this.getCache(e);if(i)return i(...o);if(this.cache[e.id])return;const s=this.renderCtx(e,e.parent);if(s)return s()}}catch(n){console.error(n);return}},none(e){if(e)return e.props.class=this.mergeClass(e.props.class,"fc-none"),e},mergeClass(e,r){if(Array.isArray(e))e.push(r);else return e?[e,r]:r;return e},stable(e){return(Array.isArray(e)?e:[e]).forEach(n=>{n&&n.__v_isVNode&&n.children&&typeof n.children=="object"&&(n.children.$stable=!0,this.stable(n.children))}),e},getModelField(e){return e.prop.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},isFragment(e){return e.type==="fragment"||e.type==="template"},injectProp(e){const r=this.vm.setupState;r.ctxInject[e.id]||(r.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:o=>{this.$handle.addSubForm(e,o)},getSubForm:()=>this.$handle.subForm[e.id],slots:()=>this.vm.setupState.top.slots,getWrap:()=>this.vm.refs[e.wrapRef],options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,t:(...o)=>this.$handle.api.t(...o),updateValue:o=>{this.$handle.onUpdateValue(e,o)}});const n=r.ctxInject[e.id];return R(n,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),n},ensureCtxHandlers(e){if(e.handlers)return e.handlers;const r=this;return e.handlers={vnodeMounted(n){n.el.__rule__=e.rule,r.onMounted(e,n.el)},vnodeBeforeUnmount(){r.$handle.effect(e,"beforeUnmount"),r.$handle.targetHook(e,"beforeUnmount")},fcUpdateValue(n){r.$handle.onUpdateValue(e,n)},fcEl(n){e.exportEl=n,n&&((n.$el||n).__rule__=e.rule)},modelCallback(n){r.tmpInput&&r.tmpInput(e.field,n,e.rule),r.onInput(e,n)},modelEmit(){r.onEmitInput(e)}},e.handlers},ctxProp(e){const{ref:r,key:n,rule:o}=e;this.$manager.mergeProp(e),e.parser.mergeProp(e);const i=this.ensureCtxHandlers(e),s=[{ref:r,key:o.key||`${n}fc`,slot:void 0,on:{vnodeMounted:i.vnodeMounted,vnodeBeforeUnmount:i.vnodeBeforeUnmount,"fc.updateValue":i.fcUpdateValue,"fc.el":i.fcEl}}];if(e.input){this.vm.props.disabled===!0&&(e.prop.props.disabled=!0);const a=this.getModelField(e),l={callback:i.modelCallback,modelField:a,value:this.$handle.getFormData(e)};s.push({on:V({[`update:${a}`]:l.callback},e.prop.modelEmit?{[e.prop.modelEmit]:i.modelEmit}:{}),props:{[a]:l.value}}),e.prop.model=l}return Ce(s,e.prop),e.prop},onMounted(e,r){e.el=this.vm.refs[e.ref]||r,e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput(e,r){if(e.prop.modelEmit){this.$handle.onBaseInput(e,r);return}this.$handle.onInput(e,r)},onEmitInput(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren(e,r){if(!g.trueArray(e))return{};const n=ze();return e.map(o=>{if(o){if(g.String(o)||g.Number(o))return n.setSlot(null,`${o}`);if(o.__fc__)return this.renderSlot(n,o.__fc__,r);o.type&&f.nextTick(()=>{this.$handle.loadChildren(e,r),this.$handle.refresh()})}}),n.getSlots()},defaultRender(e,r){const n=e.prop;return n.component?typeof n.component=="string"?this.vNode.make(n.component,n,r):this.vNode.makeComponent(n.component,n,r):this.vNode[e.type]?this.vNode[e.type](n,r):this.vNode[e.originType]?this.vNode[e.originType](n,r):this.vNode.make(jt(n.type),n,r)},createChildrenVnodes(e,r,n){this.force=n!==!1,this.tmpInput=r;const o=this.renderChildren(e.rule.children,e);return this.force=!1,this.tmpInput=null,o},createRuleVnode(e,r,n){this.force=n!==!1,this.tmpInput=r;const o=ze();return this.renderSlot(o,e,e.parent),this.force=!1,this.tmpInput=null,o.getSlots()},renderRule(e,r,n){if(!e)return;if(g.String(e)||g.Number(e))return`${e}`;let o;if(n)o=e.type;else if(o=e.is,e.type){o=le(e.type);const a=this.vNode.aliasMap[o];a&&(o=le(a))}if(!o)return;const i=ze();g.trueArray(e.children)&&e.children.forEach(a=>{a&&i.setSlot(a==null?void 0:a.slot,()=>this.renderRule(a))});const s=V({},e);return delete s.type,delete s.is,this.vNode.make(o,s,i.mergeBag(r).getSlots())}})}let Rn=1;function ft(t){R(this,{$handle:t,fc:t.fc,vm:t.vm,$manager:t.$manager,vNode:new t.fc.CreateNode(t),force:!1,tmpInput:null,id:Rn++}),It(this,{options(){return t.options},sort(){return t.sort}}),this.initCache(),this.initRender()}Fn(ft),En(ft);function An(t){R(t.prototype,{parseInjectEvent(e,r){const n=e.inject||this.options.injectEvent;return this.parseEventLst(e,r,n)},parseEventLst(e,r,n,o){return Object.keys(r).forEach(i=>{const s=this.parseEvent(e,r[i],n,o);s&&(r[i]=s)}),r},parseEvent(e,r,n,o){if(g.Function(r)&&(n!==!1&&!g.Undef(n)||r.__inject))return this.inject(e,r,n);if(!o&&Array.isArray(r)&&r[0]&&(g.String(r[0])||g.Function(r[0])))return this.parseEventLst(e,r,n,!0);if(g.String(r)){const i=$e(r);if(i&&r!==i)return i.__inject?this.parseEvent(e,i,n,!0):i}},parseEmit(e){let r={},n=e.rule,{emitPrefix:o,field:i,name:s,inject:a}=n,l=n.emit||[];return g.trueArray(l)&&l.forEach(u=>{if(!u)return;let c,h=o||i||s;if(g.Object(u)&&(c=u.inject,u=u.name,h=u.prefix||h),h){const m=Te(`${h}-${u}`),p=(...b)=>{this.vm.emitsOptions&&!this.vm.emitsOptions[m]&&(this.vm.emitsOptions[m]=null),this.vm.emit(m,...b),this.vm.emit("emit-event",m,...b),this.bus.$emit(m,...b)};if(p.__emit=!0,!c&&a===!1)r[le(u)]=p;else{let b=c||a||this.options.injectEvent;r[le(u)]=g.Undef(b)?p:this.inject(n,p,b)}}}),e.computed.on=r,r},getInjectData(e,r){const n=e.__fc__&&e.__fc__.$api,o=e.__fc__&&e.__fc__.$handle.vm||this.vm,{option:i,rule:s}=o.props;return{$f:n||this.api,api:n||this.api,rule:s,self:e.__origin__,option:i,inject:r}},inject(e,r,n){if(r.__origin){if(this.watching&&!this.loading)return r;r=r.__origin}const o=this,i=function(...s){const a=o.getInjectData(e,n);return a.args=[...s],s.unshift(a),r.apply(this,s)};return i.__origin=r,i.__json=r.__json,i},loadStrVar(e,r,n){if(e&&typeof e=="string"&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){const o=e,i=wn(e),s=u=>{let c=!1,h;if(n&&u.indexOf("$form.")===0){const m=u.split(".");m.shift(),W(n.value,m[0])&&(c=!0,h=r?r({id:"$form."+m[0]+"_"+n.rule.__fc__.id,getValue:()=>ae(n.value,m)}):ae(n.value,m))}return c||(h=r?r(u):this.fc.getLoadData(u)),h},a=u=>{const c=[];u.forEach(m=>{m.key?c.push(m.key):m.children&&c.push(a(m.children))});let h=!1;return c.forEach((m,p)=>{m!=null&&(m.indexOf("'")===0||m.indexOf('"')===0)&&(c[p]=m.slice(1,-1),h=!0)}),c.length===1&&(h||!isNaN(Number(c[0])))?c[0]:s(c.join("."))};let l;if(i.forEach(u=>{const c=u.split("||"),h=c[0].trim();if(h){const m=(c[1]||"").trim(),p=Yt(h);let b=N(()=>a(p));(b==null||b==="")&&c.length>1&&(b=m),l=b,e=e.replaceAll(`{{${u}}}`,b==null?"":b)}}),i.length===1&&o===`{{${i[0]}}}`)return l}return e},loadFetchVar(e,r,n){let o;n&&n.__fc__&&(o=n.__fc__.getParentGroup()),!o&&e.targetRule&&e.targetRule.__fc__&&(o=e.targetRule.__fc__.getParentGroup());const i=s=>this.loadStrVar(s,r,o?{rule:n,value:this.subRuleData[o.id]||{}}:null);return e.action=i(e.action||""),["headers","data","query"].forEach(s=>{if(e[s]){const a=Array.isArray(e[s])?[]:{};Object.keys(e[s]).forEach(l=>{a[i(l)]=i(e[s][l])}),e[s]=a}}),e}})}const Jt=["hook:updated","hook:mounted"];function Mn(t){R(t.prototype,{usePage(){const e=this.options.page;if(!e)return;let r=25,n=jn(this.rules);g.Object(e)&&(e.first&&(r=parseInt(e.first,10)||r),e.limit&&(n=parseInt(e.limit,10)||n)),R(this,{first:r,limit:n,pageEnd:this.rules.length<=r}),this.bus.$on("page-end",()=>this.vm.emit("page-end",this.api)),this.pageLoad()},pageLoad(){const e=()=>{this.pageEnd?(this.bus.$off(Jt,e),this.bus.$emit("page-end")):(this.first+=this.limit,this.pageEnd=this.rules.length<=this.first,this.loadRule(),this.refresh())};this.bus.$on(Jt,e)}})}function jn(t){return t.length<31?31:Math.ceil(t.length/3)}function Nn(t){R(t.prototype,{clearNextTick(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick(e){this.clearNextTick(),this.nextTick=setTimeout(()=>{e(),this.nextTick=null},10)},render(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}function Pn(t){Object.defineProperties(t.origin,{__fc__:lt(f.markRaw(t))}),t.rule!==t.origin&&Object.defineProperties(t.rule,{__fc__:lt(f.markRaw(t))})}function Qt(t,e,r){const n=Ye(),o=!!e.field;R(this,{id:n,ref:n,wrapRef:n+"fi",rule:e,origin:e.__origin__||e,name:e.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:e.subRule?this:null,cacheConfig:null,prop:V({},e),computed:{},payload:{},refRule:{},handlers:null,input:o,el:void 0,exportEl:void 0,defaultValue:o?ye(r):void 0,field:e.field||void 0}),this.updateKey(),Pn(this),this.update(t,!0)}R(Qt.prototype,{getParentGroup(){let t=this.parent;for(;t;){if(t.group)return t;t=t.parent}},loadChildrenPending(){const t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:e=>{this.$handle&&this.$handle.loadChildren(e,this)},onUpdate:(e,r)=>{this.$handle&&(e===r?this.$handle.loadChildren(e,this):this.$handle.updateChildren(this,e,r))},onReload:e=>{this.$handle?this.$handle.updateChildren(this,[],e):delete this.pending.children}})},loadPending(t){const{key:e,origin:r,def:n,onLoad:o,onReload:i,onUpdate:s}=t;if(this.pending[e]&&this.pending[e].origin===r)return this.getPending(e,n);delete this.pending[e];let a=r;if(g.Function(r)){let l=N(()=>r({rule:this.rule,api:this.$api,update:u=>{const c=u||n,h=this.getPending(e,n);this.setPending(e,r,c),s&&s(c,h)},reload:()=>{const u=this.getPending(e,n);delete this.pending[e],i&&i(u),this.$api&&this.$api.sync(this.rule)}}));l&&g.Function(l.then)?(l.then(u=>{const c=u||n;this.setPending(e,r,c),o&&o(c),this.$api&&this.$api.sync(this.rule)}).catch(u=>{console.error(u)}),a=n,this.setPending(e,r,a)):(a=l||n,this.setPending(e,r,a),o&&o(a))}return a},getPending(t,e){return this.pending[t]&&this.pending[t].value||e},setPending(t,e,r){this.pending[t]={origin:e,value:f.reactive(r)}},effectData(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey(t){this.key=Ye(),t&&this.parent&&this.parent.updateKey(t)},updateType(){this.originType=this.rule.type,this.type=le(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser(t){this.parser=t,t.init(this)},initProp(){var e,r,n;const t=V({},this.rule);delete t.children,delete t.validate,this.prop=ve({},[t,...Object.keys(this.payload).map(o=>this.payload[o]),this.computed]),t.col&&((e=t.col)==null?void 0:e.show)!==!1&&(this.prop.col.show=!0),this.prop.validate=[...((n=(r=this.refRule)==null?void 0:r.__$validate)==null?void 0:n.value)||[],...this.prop.validate||[]]},initNone(){this.none=!(g.Undef(this.prop.display)||this.prop.display)},hasHidden(){return!!this.rule.hidden||(this.parent?this.parent.hasHidden():!1)},injectValidate(){return this.prop.validate},check(t){return this.vm===t.vm},unwatch(){this.watch.forEach(t=>t()),this.watch=[],Object.keys(this.refRule).forEach(t=>{t.indexOf("__$")!==0&&delete this.refRule[t]})},unlink(){this.linkOn.forEach(t=>t()),this.linkOn=[]},link(){this.unlink(),this.$handle.appendLink(this)},watchTo(){this.$handle.watchCtx(this)},delete(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),R(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1,handlers:null,el:void 0,exportEl:void 0})},rmCtrl(){this.ctrlRule.forEach(t=>t.__fc__&&t.__fc__.rm()),this.ctrlRule=[]},rm(){const t=()=>{let e=this.root.indexOf(this.origin);e>-1&&(this.root.splice(e,1),this.$handle&&this.$handle.refresh())};if(this.deleted){t();return}this.$handle.noWatch(()=>{this.$handle.deferSyncValue(()=>{this.rmCtrl(),t(),this.$handle.rmCtx(this),R(this,{root:[]})},this.input)})},update(t,e){R(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});function Tn(t){R(t.prototype,{nextRefresh(e){const r=this.loadedId;f.nextTick(()=>{r===this.loadedId&&(e?e():this.refresh())})},parseRule(e){const r=Tt(e);return Object.defineProperties(r,{__origin__:lt(e)}),In(r),this.appendValue(r),[r,r.prefix,r.suffix].forEach(n=>{n&&this.loadFn(n,r)}),this.loadCtrl(r),r.update&&(r.update=$e(r.update)),r},loadFn(e,r){["on","props","deep"].forEach(n=>{e[n]&&this.parseInjectEvent(r,e[n])})},loadCtrl(e){e.control&&e.control.forEach(r=>{r.handle&&(r.handle=$e(r.handle))})},syncProp(e){const r=e.rule;g.trueArray(r.sync)&&Ce([{on:r.sync.reduce((n,o)=>(n[typeof o=="object"&&o.event||`update:${o}`]=i=>{r.props[typeof o=="object"&&o.prop||o]=i,this.vm.emit("sync",o,i,r,this.fapi)},n),{})}],e.computed)},loadRule(){this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(()=>{if(this._loadRule(this.rules),this.loading=!1,this.cycleLoad&&this.pageEnd)return this.loadRule();this.syncForm(),this.pageEnd&&this.bus.$emit("load-end"),this.vm.setupState.renderRule()})},loadChildren(e,r){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,r),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(r)},_loadRule(e,r){const n=s=>{let a=e[s-1];if(!a||!a.__fc__)return s>0?n(s-1):-1;let l=this.sort.indexOf(a.__fc__.id);return l>-1?l:n(s-1)},o=(s,a)=>{g.trueArray(s)&&this._loadRule(s,a)},i=e.map((s,a)=>{if(r&&!g.Object(s)||!this.pageEnd&&!r&&a>=this.first)return;if(s.__fc__&&s.__fc__.root===e&&this.ctxs[s.__fc__.id])return o(s.__fc__.loadChildrenPending(),s.__fc__),s.__fc__;let l=Tt(s);const u=()=>!!(l.field&&this.fieldCtx[l.field]&&this.fieldCtx[l.field][0]!==s.__fc__);this.fc.targetFormDriver("loadRule",{rule:l,api:this.api},this.fc),this.ruleEffect(l,"init",{repeat:u()}),u()&&this.vm.emit("repeat-field",s,this.api);let c,h=!1,m=!!s.__fc__,p=l.value;if(m){if(c=s.__fc__,p=c.defaultValue,c.deleted){if(Kt(c))return;c.update(this)}else if(!c.check(this)){if(Kt(c))return;e[a]=s=s._clone?s._clone():vt(Ie(s)),c=null,h=!0}}if(c)c.originType!==c.rule.type&&c.updateType(),this.bindParser(c),this.appendValue(c.rule),c.parent&&c.parent!==r&&this.rmSubRuleData(c);else{const C=this.parseRule(s);c=new Qt(this,C,p),this.bindParser(c)}this.parseEmit(c),this.syncProp(c),c.parent=r||null,c.root=e,this.setCtx(c),!h&&!m&&(this.effect(c,"load"),this.targetHook(c,"load")),this.effect(c,"created");const b=c.loadChildrenPending();if(c.parser.loadChildren===!1||o(b,c),!r){const C=n(a);C>-1||!a?this.sort.splice(C+1,0,c.id):this.sort.push(c.id)}const S=c.rule;return c.updated||(c.updated=!0,g.Function(S.update)&&this.bus.$once("load-end",()=>{this.refreshUpdate(c,S.value,"init")}),this.effect(c,"loaded")),this.refreshControl(c)&&(this.cycleLoad=!0),c}).filter(s=>!!s);r&&(r.children=i)},refreshControl(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl(e){const r=Bn(e),n=[],o=this.api;if(!r.length)return!1;for(let a=0;a<r.length;a++){const l=r[a],u=l.handle||function(h){return(Me[l.condition||"=="]||Me["=="])(h,l.value)};if(!g.trueArray(l.rule))continue;const c=oe(V({},l),{valid:N(()=>u(e.rule.value,o)),ctrl:Ln(e,l.rule),isHidden:g.String(l.rule[0])});c.valid&&c.ctrl||!c.valid&&!c.ctrl&&!c.isHidden||n.push(c)}if(!n.length)return!1;const i=[];let s=!1;return this.deferSyncValue(()=>{n.reverse().forEach(({isHidden:a,valid:l,rule:u,prepend:c,append:h,child:m,ctrl:p,method:b})=>{if(a){l?e.ctrlRule.push({__ctrl:!0,children:u,valid:l}):p&&e.ctrlRule.splice(e.ctrlRule.indexOf(p)>>>0,1),i[l?"push":"unshift"](()=>{b==="disabled"||b==="enabled"?this.api.disabled(!l,u):b==="display"||b==="show"?this.api.display(l,u):b==="required"?(u.forEach(S=>{this.api.setEffect(S,"required",l)}),l||this.api.clearValidateState(u)):b==="if"?this.api.hidden(!l,u):this.api.hidden(!l,u)});return}if(l){s=!0;const S={type:"fragment",native:!0,__ctrl:!0,children:u};e.ctrlRule.push(S),this.bus.$once("load-start",()=>{c?o.prepend(S,c,m):h||m?o.append(S,h||e.id,m):e.root.splice(e.root.indexOf(e.origin)+1,0,S)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(p),1);const S=be(p);S&&S.rm()}})}),i.length&&(this.loading?i.length&&this.bus.$once("load-end",()=>{i.forEach(a=>a())}):i.length&&f.nextTick(()=>{i.forEach(a=>a())})),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),s},reloadRule(e){return this._reloadRule(e)},_reloadRule(e){e||(e=this.rules);const r=V({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue(()=>{this.bus.$once("load-end",()=>{Object.keys(r).filter(n=>this.ctxs[n]===void 0).forEach(n=>this.rmCtx(r[n])),this.$render.clearCacheAll()}),this.reloading=!0,this.loadRule(),this.reloading=!1,this.refresh(),this.bus.$emit("reloading",this.api)}),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh(){this.vm.setupState.refresh()}})}function In(t){const e=Ut();return Object.keys(e).forEach(r=>{W(t,r)||(t[r]=e[r])}),t}function Bn(t){const e=t.rule.control||[];return g.Object(e)?[e]:e}function Ln(t,e){for(let r=0;r<t.ctrlRule.length;r++){const n=t.ctrlRule[r];if(n.children===e)return n}}function Kt(t){return!!t.rule.__ctrl}function xn(t){R(t.prototype,{setValue(e,r,n,o){e.deleted||this.options.trim&&(g.String(r)&&(r=r.trim()),g.String(n)&&(n=n.trim()),r===e.rule.value)||(e.rule.value=r,this.changeStatus=!0,this.setFormData(e,n),this.$render.clearCache(e),this.nextRefresh(),this.syncValue(),this.valueChange(e,r),this.vm.emit("change",e.field,r,e.origin,this.api,o||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:r}),this.emitEvent("change",e.field,r,{rule:e.origin,api:this.api,setFlag:o||!1}),o&&f.nextTick(()=>{f.nextTick(()=>{f.nextTick(()=>{this.api.clearValidateState(e.id)})})}),this.$manager.fieldChange(e,r,n,o))},onInput(e,r){let n;e.input&&(this.isQuote(e,n=e.parser.toValue(r,e))||this.isChange(e,r))&&this.setValue(e,n,r)},onUpdateValue(e,r){this.deferSyncValue(()=>{const n=e.getParentGroup(),o=n?this.subRuleData[n.id]:null,i={};Object.keys(r||{}).forEach(s=>{o&&W(o,s)?i[s]=r[s]:W(this.api.form,s)?this.api.form[s]=r[s]:this.api.top!==this.api&&W(this.api.top.form,s)&&(this.api.top.form[s]=r[s])}),Object.keys(i).length&&this.api.setChildrenFormData(n.rule,i)})},onBaseInput(e,r){this.setFormData(e,r),this.$render.clearCache(e),this.nextRefresh()},setFormData(e,r){e.modelValue=r;const n=e.getParentGroup();n&&(this.subRuleData[n.id]||(this.subRuleData[n.id]={}),this.subRuleData[n.id][e.field]=e.rule.value),fe(this.formData,e.id,r)},rmSubRuleData(e){const r=e.getParentGroup();r&&this.subRuleData[r.id]&&delete this.subRuleData[r.id][e.field]},getFormData(e){return this.formData[e.id]},syncForm(){const e=f.reactive({}),r=this.fields(),n=[];this.options.appendValue!==!1&&Object.keys(this.appendData).reduce((o,i)=>(r.indexOf(i)===-1&&(o[i]=f.toRef(this.appendData,i)),o),e),r.reduce((o,i)=>{let s=(this.fieldCtx[i]||[]).filter(a=>!this.isIgnore(a))[0];return s||(s=this.fieldCtx[i][0],n.push(i)),o[i]=f.toRef(s.rule,"value"),o},e),this.form=e,this.ignoreFields=n,this.syncValue()},isIgnore(e){return e.rule.ignore===!0||(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields)&&e.hasHidden()},appendValue(e){(!e.field||!W(this.appendData,e.field))&&(!g.Undef(e.value)||!this.options.forceCoverValue)||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm(e,r){this.subForm[e.id]=r},deferSyncValue(e,r){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=r),N(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;const e={};Object.keys(this.form).forEach(r=>{this.ignoreFields.indexOf(r)===-1&&(e[r]=this.form[r])}),this.vm.setupState.updateValue(e)},isChange(e,r){const n=this.getFormData(e);if(n===r)return!1;const o=typeof n;return o===typeof r&&(o==="string"||o==="boolean"||o==="number"&&Number.isFinite(n)&&Number.isFinite(r))?!0:JSON.stringify(n,Zt)!==JSON.stringify(r,Zt)},isQuote(e,r){return(r instanceof Function||g.Object(r)||Array.isArray(r))&&r===e.rule.value},refreshUpdate(e,r,n,o){if(g.Function(e.rule.update)){const i=N(()=>e.rule.update(r,e.origin,this.api,{origin:n||"change",linkField:o}));if(i===void 0)return;e.rule.hidden=i===!0}},valueChange(e,r){this.refreshRule(e,r),this.bus.$emit("change-"+e.field,r)},refreshRule(e,r,n,o){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,r,n,o)},appendLink(e){const r=e.rule.link;g.trueArray(r)&&r.forEach(n=>{const o=()=>this.refreshRule(e,e.rule.value,"link",n);this.bus.$on("change-"+n,o),e.linkOn.push(()=>this.bus.$off("change-"+n,o))})},fields(){return Object.keys(this.fieldCtx)}})}function Zt(t,e){return typeof e=="function"?""+e:e}const Le={init(t){},toFormValue(t,e){return t},toValue(t,e){return t},mounted(t){},render(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultRender?e.$handle.fc.renderDriver.defaultRender(e,t):e.$render.defaultRender(e,t)},preview(t,e){return e.$handle.fc.renderDriver&&e.$handle.fc.renderDriver.defaultPreview?e.$handle.fc.renderDriver.defaultPreview(e,t):this.render(t,e)},mergeProp(t){}},qn=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"],xe=Symbol("oldValue"),Yn=["$condition","$variableVal","$val","$form","$scope","$group","$rule"],Un=["$formulas","$form","$scope","$group","$rule","$api"],Ke=new Map,Hn=1e3;function Xt(t,e){const r=t.join(",")+"|"+e;let n=Ke.get(r);return n||(Ke.size>=Hn&&Ke.clear(),n=new Function(...t,e),Ke.set(r,n)),n}function Wn(t){R(t.prototype,{scheduleComputedUpdate(e){(this._computedQueue||(this._computedQueue=[])).push(e),!(this._computedFlushing||this._computedScheduled)&&(this._computedScheduled=!0,setTimeout(()=>{this._computedScheduled=!1,this._computedFlushing=!0;try{const r=this._computedQueue||[];this._computedQueue=[];for(let n=0;n<r.length;n++)N(r[n]),this._computedQueue&&this._computedQueue.length&&(r.push(...this._computedQueue),this._computedQueue=[])}finally{this._computedFlushing=!1}}))},getCtx(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx(e,r,n){const o=`${n}Ctx`;this[o][r]?this[o][r].push(e):this[o][r]=[e]},rmIdCtx(e,r,n){const o=`${n}Ctx`,i=this[o][r];if(!i)return!1;const s=i.splice(i.indexOf(e)>>>0,1).length>0;return i.length||delete this[o][r],s},getFieldCtx(e){return(this.fieldCtx[e]||[])[0]},getNameCtx(e){return this.nameCtx[e]||[]},setCtx(e){let{id:r,field:n,name:o,rule:i}=e;this.ctxs[r]=e,o&&this.setIdCtx(e,o,"name"),e.input&&(this.setIdCtx(e,n,"field"),this.setFormData(e,e.parser.toFormValue(i.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,i.value,e.origin,this.api,!1,!0))},getParser(e){const r=this.fc.parsers,n=this.fc.renderDriver;if(n){const o=n.parsers||{},i=o[e.originType]||o[le(e.type)]||o[e.trueType];if(i)return i}return r[e.originType]||r[le(e.type)]||r[e.trueType]||Le},bindParser(e){e.setParser(this.getParser(e))},getType(e){const r=this.fc.CreateNode.aliasMap,n=r[e]||r[le(e)]||e;return le(n)},noWatch(e){this.noWatchFn||(this.noWatchFn=e),N(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx(e){const r=Ft().filter(s=>s[0]!=="_"&&s[0]!=="$"&&qn.indexOf(s)===-1),n={},o=(s,a,l)=>(u,c)=>{let h=a.value;if(!this.isBreakWatch()){if(l&&e.parser.loadChildren===!1){this.$render.clearCache(e),this.nextRefresh();return}if(this.watching=!0,f.nextTick(()=>{this.targetHook(e,"watch",{key:s,oldValue:c,newValue:h})}),s==="hidden"&&!!h!=!!c&&f.nextTick(()=>{this.targetHook(e,"hidden",{value:h})}),s==="ignore"&&e.input||s==="hidden"&&(e.rule.ignore==="hidden"||this.options.ignoreHiddenFields))this.syncForm();else if(s==="link"){e.link();return}else["props","on","deep"].indexOf(s)>-1?(this.parseInjectEvent(e.rule,h||{}),s==="props"&&e.input&&this.setFormData(e,e.parser.toFormValue(e.rule.value,e))):s==="emit"?this.parseEmit(e):["prefix","suffix"].indexOf(s)>-1?h&&this.loadFn(h,e.rule):s==="type"?(e.updateType(),this.bindParser(e)):l&&(g.Function(c)&&(c=e.getPending("children",[])),g.Function(h)&&(h=e.loadChildrenPending()),this.updateChildren(e,h,c));this.$render.clearCache(e),this.refresh(),this.watching=!1}},i=(s,a)=>{if(n[s])return;n[s]=!0;const l=e.refRule[s],u=s==="children",c=o(s,l,u);e.watch.push(f.watch(u?()=>g.Function(l.value)?l.value:[...l.value||[]]:()=>l.value,c,{deep:!u,sync:u})),a&&c(l.value,void 0)};if(r.forEach(s=>{e.refRule[s]=f.toRef(e.rule,s),W(e.rule,s)&&i(s)}),e.watch.push(f.watch(()=>Object.keys(e.rule).join("|"),()=>{r.forEach(s=>{!n[s]&&W(e.rule,s)&&i(s,!0)})})),e.refRule.__$title=f.computed(()=>{let s=(typeof e.rule.title=="object"?e.rule.title.title:e.rule.title)||"";if(s){const a=s.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);a&&(s=this.api.t(a[1]))}return s}),e.refRule.__$info=f.computed(()=>{let s=(typeof e.rule.info=="object"?e.rule.info.info:e.rule.info)||"";if(s){const a=s.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);a&&(s=this.api.t(a[1]))}return s}),e.refRule.__$validate=f.computed(()=>{const s=a=>{var u,c;const l=a.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);return l?this.api.t(l[1],{title:(c=(u=e.refRule)==null?void 0:u.__$title)==null?void 0:c.value}):a};return X(e.rule.validate).map(a=>{const l=V({},a);if(l.message&&(l.message=s(l.message)),g.Function(l.validator)){const u=e;l.validator=function(...c){return a.validator.call({that:this,id:u.id,field:u.field,rule:u.rule,api:u.$handle.api},...c)}}if(l.adapter){if(typeof l.error=="object"){const u=V({},l.error);Object.keys(u).forEach(c=>{u[c]=s(u[c])}),l.error=u}return this.adapterValidate(l,e)}return l})}),e.input){const s=f.toRef(e.rule,"value");e.watch.push(f.watch(()=>s.value,()=>{let a=e.parser.toFormValue(s.value,e);this.isChange(e,a)&&this.setValue(e,s.value,a,!0)}))}this.bus.$once("load-end",()=>{let s=e.rule.computed;s&&(typeof s!="object"&&(s={value:s}),Object.keys(s).forEach(a=>{const l=f.computed(()=>{const c=s[a];if(!c)return;const h=this.compute(e,c);return(c.linkage||c.linkageVariable)&&h===xe?xe:h}),u=c=>{a==="value"?this.onInput(e,c):a[0]==="$"?this.api.setEffect(e.id,a,c):Ve(e.rule,a,c)};(a==="value"?[void 0,null,""].indexOf(e.rule.value)>-1:l.value!==ae(e.rule,a))&&u(l.value),e.watch.push(f.watch(l,c=>{c!==xe&&this.scheduleComputedUpdate(()=>u(c))},{deep:!0}))}))}),this.watchEffect(e)},adapterValidate(e,r){const n=(o,i)=>{if((e.beforeValidate&&N(()=>e.beforeValidate({value:o,api:this.api,validate:e,rule:r.rule})))===!1)i();else{const a=this.validator(r,o,e);if(a){let l="";typeof e.error=="object"&&(l=e.error[a]||e.error.default),!l&&typeof e.message=="string"&&(l=e.message),l||(l=this.getValidateMessage(r,{key:a,rule:e[a]})),i(l)}else if(e.validator){const l=e.validator&&N(()=>e.validator(o,i));l&&g.Function(l.then)&&l.then(()=>i()).catch(u=>i(u))}else i()}};return this.$manager.adapterValidate({required:e.required,message:e.message,trigger:e.trigger},n)},getValidateMessage(e,r){var o,i;const n=Array.isArray(r.rule)?r.rule.join(","):""+r.rule;return this.api.t(r.key==="required"?r.key:"validate."+r.key,{[r.key]:n,title:(i=(o=e.refRule)==null?void 0:o.__$title)==null?void 0:i.value})},validator(e,r,n){if(g.empty(r))return n.required?"required":void 0;for(const[i,s]of Object.entries(n))switch(i){case"len":case"maxLen":case"minLen":const a=b=>i==="len"?b===s:i==="maxLen"?b<=s:b>=s;if(Array.isArray(r)){if(!a(r.length))return i}else{if(typeof r=="object")return i;if(!a((""+r).length))return i}break;case"pattern":if(!(typeof s=="string"?new RegExp(s):s).test(""+r))return i;break;case"uppercase":if(s&&(typeof r!="string"||!/^[A-Z]*$/.test(r)))return i;break;case"lowercase":if(s&&(typeof r!="string"||!/^[a-z]*$/.test(r)))return i;break;case"min":case"max":case"positive":case"negative":case"integer":case"number":const u=Number(r);if(Number.isNaN(u)||i==="min"&&u<s||i==="max"&&u>s||i==="positive"&&u<=0||i==="negative"&&u>=0||i==="integer"&&!Number.isInteger(u))return i;break;case"equal":if(r!==s)return i;break;case"enum":if(Array.isArray(s)&&!s.includes(r))return i;break;case"hasKeys":if(typeof r!="object"||Array.isArray(s)&&s.some(b=>!(b in r)))return i;break;case"email":if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(""+r))return i;break;case"url":if(!new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i").test(""+r))return i;break;case"ip":if(!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test(""+r))return i;break;case"phone":if(!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(""+r))return i;break;case"computed":if(!this.compute(e,s))return i;break}},compute(e,r){let n;if(typeof r=="object"){const o=e.getParentGroup(),i=a=>{if(a=Array.isArray(a)?{mode:"AND",group:a}:a,!g.trueArray(a.group))return!0;const l=a.mode==="OR";let u=!0;for(let c=0;c<a.group.length;c++){const h=a.group[c];let m,p=null,b=null;if(h.variable)b=this.fc.getLoadData(h.variable);else if(h.field)p=qt(h.field||"");else if(!h.mode)return!0;let S=h.compare;if(S&&(S=qt(S||"")),h.mode?m=i(h):Me[h.condition]?g.Function(h.handler)?m=N(()=>h.handler(this.api,e.rule)):m=N(()=>Xt(Yn,`with($form){with($scope){with(this){with($group){ return $condition['${h.condition}'](${h.variable?"$variableVal":p}, ${S||"$val"}); }}}}`).call(this.api.form,Me,b,h.value,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,o?this.subRuleData[o.id]||{}:{},e.rule)):m=!1,l&&m)return!0;l||(u=u&&m)}return l?!1:u};let s=i(r);return s=r.invert===!0?!s:s,r.linkage?s?N(()=>this.computeValue(r.linkage,e,o),void 0):xe:r.linkageVariable?s?N(()=>this.fc.getLoadData(r.linkageVariable),void 0):xe:s}else if(g.Function(r))n=()=>r(this.api.form,this.api,e.rule);else{const o=e.getParentGroup();n=()=>this.computeValue(r,e,o)}return N(n,void 0)},computeValue(e,r,n){const o=this,i=Object.keys(this.fc.formulas).reduce((s,a)=>(s[a]=function(...l){return o.fc.formulas[a].call({that:this,rule:r.rule,api:o.api,fc:o.fc},...l)},s),{});return N(()=>Xt(Un,`with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form,i,this.api.top.form,this.api.top===this.api.scope?{}:this.api.scope.form,n?this.subRuleData[n.id]||{}:{},r.rule,this.api),void 0)},updateChildren(e,r,n){this.deferSyncValue(()=>{n&&n.forEach(o=>{(r||[]).indexOf(o)===-1&&o&&!g.String(o)&&o.__fc__&&o.__fc__.parent===e&&this.rmCtx(o.__fc__)}),g.trueArray(r)&&(this.loadChildren(r,e),this.bus.$emit("update",this.api))})},rmSub(e){g.trueArray(e)&&e.forEach(r=>{r&&r.__fc__&&this.rmCtx(r.__fc__)})},rmCtx(e){if(e.deleted)return;const{id:r,field:n,input:o,name:i}=e;Ae(this.ctxs,r),Ae(this.formData,r),Ae(this.subForm,r),Ae(this.vm.setupState.ctxInject,r);const s=e.getParentGroup();s&&this.subRuleData[s.id]&&Ae(this.subRuleData[s.id],n),e.group&&Ae(this.subRuleData,r),o&&this.rmIdCtx(e,n,"field"),i&&this.rmIdCtx(e,i,"name"),o&&!W(this.fieldCtx,n)&&Ae(this.form,n),this.deferSyncValue(()=>{if(!this.reloading){if(e.parser.loadChildren!==!1){const l=e.getPending("children",e.rule.children);g.trueArray(l)&&l.forEach(u=>u&&u.__fc__&&this.rmCtx(u.__fc__))}e.root===this.rules&&this.vm.setupState.renderRule()}},o);const a=this.sort.indexOf(r);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),o&&!this.fieldCtx[n]&&this.vm.emit("remove-field",n,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}})}function zn(t){R(t.prototype,{mounted(){const e=()=>{this.isMounted=!0,this.lifecycle("mounted")};this.pageEnd?e():this.bus.$once("page-end",e)},lifecycle(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent(e,...r){const n=this.options[e]||this.options[le("on-"+e)];if(n){const o=$e(n);g.Function(o)&&N(()=>o(...r))}this.bus.$emit(e,...r)},targetHook(e,r,n){var l,u,c,h;let o=(u=(l=e.prop)==null?void 0:l.hook)==null?void 0:u[r],i=(m,p)=>{m&&(m=Array.isArray(m)?m:[m],m.forEach(b=>{N(()=>b(oe(V({args:Object.values(n||{})},n||{}),{self:e.rule,rule:e.rule,parent:p==null?void 0:p.rule,$f:this.api,api:this.api,option:this.vm.props.option})))}))};i(o);let s="deep"+Ot(r),a=e.parent;for(;a;){let m=(h=(c=a.prop)==null?void 0:c.hook)==null?void 0:h[s];i(m,a),a=a.parent}}})}function Gn(t){R(t.prototype,{useProvider(){const e=this.fc.providers;Object.keys(e).forEach(r=>{let n=e[r];g.Function(n)&&(n=n(this.fc)),n._c=Qn(n),this.onEffect(n,r),this.providers[r]=n})},onEffect(e,r){const n=[];(e._c||["*"]).forEach(o=>{const i=o==="*"?"*":this.getType(o);n.indexOf(i)>-1||(n.push(i),this.bus.$on(`p:${r||e.name}:${i}:${e.input?1:0}`,(s,a)=>{e[s]&&e[s](...a)}))}),e._used=n},watchEffect(e){let r={required:()=>{var n,o;return(W(e.rule,"$required")?e.rule.$required:(o=(n=e.rule)==null?void 0:n.effect)==null?void 0:o.required)||!1}};Object.keys(e.rule.effect||{}).forEach(n=>{r[n]=()=>e.rule.effect[n]}),Object.keys(e.rule).forEach(n=>{n[0]==="$"&&(r[n.substr(1)]=()=>e.rule[n])}),Object.keys(r).forEach(n=>{e.watch.push(f.watch(r[n],o=>{this.effect(e,"watch",{[n]:o})},{deep:!0}))})},ruleEffect(e,r,n){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},r,n)},effect(e,r,n){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:n},r)},getEffect(e,r){if(W(e,"$"+r))return e["$"+r];if(W(e,"effect")&&W(e.effect,r))return e.effect[r]},emitEffect({ctx:e,rule:r,input:n,type:o,custom:i},s,a){if(!o||["fcFragment","fragment"].indexOf(o)>-1)return;const l=i||Object.keys(r).reduce((u,c)=>(c[0]==="$"&&(u[c.substr(1)]=r[c]),u),V({},r.effect||{}));Object.keys(l).forEach(u=>{const c=this.providers[u];if(!c||c.input&&!n)return;let h;if(!c._c)h="*";else if(c._used.indexOf(o)>-1)h=o;else return;const m=V({value:l[u],getValue:()=>this.getEffect(r,u)},a||{});e&&(m.getProp=()=>e.effectData(u),m.clearProp=()=>e.clearEffectData(u),m.mergeProp=p=>ve(m.getProp(),[p]),m.id=e.id),this.bus.$emit(`p:${u}:${h}:${c.input?1:0}`,s,[m,r,this.api])})}})}function Jn(t){return t.filter(function(e,r,n){return n.indexOf(e,0)===r})}function Qn(t){const e=t.components;if(Array.isArray(e)){const r=Jn(e.filter(n=>n!=="*"));return r.length?r:!1}else return g.String(e)?[e]:!1}function _e(t){It(this,{options(){return t.options.value||{}},bus(){return t.bus},preview(){return t.vm.props.preview!=null?t.vm.props.preview:t.vm.setupState.parent&&t.vm.setupState.parent.props.preview!=null?t.vm.setupState.parent.props.preview:t.options.value.preview||!1}}),R(this,{fc:t,vm:t.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:f.reactive({}),subRuleData:f.reactive({}),subForm:{},form:f.reactive({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:()=>{this.lifecycle("reload")}}),this.initData(t.rules),this.$manager=new t.manager(this),this.$render=new ft(this),this.api=t.extendApiFn.reduce((e,r)=>{const n=N(()=>r(e,this));return n&&n!==e&&R(e,n),e},Dn(this))}R(_e.prototype,{initData(t){R(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData(){this.appendData=V(V(V({},ye(this.options.formData||{})),this.fc.vm.props.modelValue||{}),this.appendData)},isBreakWatch(){return this.loading||this.noWatchFn||this.reloading},globalBeforeFetch(t){return new Promise((e,r)=>{const n=this.options.beforeFetch&&N(()=>this.options.beforeFetch(t,{api:this.api}));n&&g.Function(n.then)?n.then(e).catch(r):e()})},beforeFetch(t){return new Promise((e,r)=>{const n=t&&t.beforeFetch&&N(()=>t.beforeFetch(t,{api:this.api}));n&&g.Function(n.then)?n.then(e).catch(r):n===!1?r():e()}).then(()=>this.globalBeforeFetch(t))},beforeSubmit(t){return new Promise((e,r)=>{const n=this.options.beforeSubmit&&N(()=>this.options.beforeSubmit(t,{api:this.api}));n&&g.Function(n.then)?n.then(e).catch(r):n===!1?r():e()})}}),An(_e),Mn(_e),Nn(_e),Tn(_e),xn(_e),Wn(_e),zn(_e),Gn(_e);const dt=f.defineComponent({name:"fcFragment",inheritAttrs:!1,props:["vnode"],render(){return this.vnode}});function Kn(t){return Object.keys(t).map(e=>{const r=t[e],n=f.resolveDirective(e);if(n)return[n,r.value,r.arg,r.modifiers]}).filter(e=>!!e)}function er(t,e){let r=t.directives;return r?(Array.isArray(r)||(r=[r]),f.withDirectives(e,r.reduce((n,o)=>n.concat(Kn(o)),[]))):e}function Zn(){const t={};function e(r){this.vm=r.vm,this.handle=r}return R(e.prototype,{make(r,n,o){return er(n,this.h(r,Bt(n),o))},makeComponent(r,n,o){try{return er(n,f.createVNode(r,Bt(n),o))}catch(i){return console.error(i),f.createVNode("")}},h(r,n,o){const s=(this.vm||f.getCurrentInstance()).appContext.config.isNativeTag(r),a=this.handle.fc.prop.components[r];!a&&s&&delete n.formCreateInject;try{return f.createVNode(a||(s?r:f.resolveComponent(r)),n,o)}catch(l){return console.error(l),f.createVNode("")}},aliasMap:t}),R(e,{aliasMap:t,alias(r,n){t[r]=n},use(r){Object.keys(r).forEach(n=>{const o=Te(n),i=zr(n).toLocaleLowerCase(),s=r[n];e.alias(n,s),[n,o,i].forEach(a=>{e.prototype[a]=function(l,u){return this.make(t[n]||a,l,u)}})})}}),e}function Xn(t){class e extends tr{}return Object.assign(e.prototype,t),e}function tr(t){R(this,{$handle:t,vm:t.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}R(tr.prototype,{__init(){this.$render=this.$handle.$render,this.$r=(...t)=>this.$render.renderRule(...t)},updateKey(){this.key=Ye()},init(){},update(){},beforeRender(){},form(){return this.vm.refs[this.ref]},adapterValidate(t,e){return t.validator=(r,n,o)=>e(n,o),t},getSlot(t){const e=r=>{if(r){let n=r.slots[t];return n||e(r.setupState.parent)}};return e(this.vm)},mergeOptions(t,e){return Ce(t.map(r=>this.tidyOptions(r)),e,this.mergeOptionsRule)},updateOptions(t){this.$handle.fc.targetFormDriver("updateOptions",t,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions(t){return t},tidyRule(t){},mergeProp(t){},getDefaultOptions(){return{}},fieldChange(t,e,r,n){},render(t){}});const ei=function(t){const e={name:"loadData",_fn:[],loaded(r,n,o){this.deleted(r),f.nextTick(()=>{let i=X(r.getValue());const s=[];i.forEach(a=>{if(a&&(a.attr||a.template||a.handler)){let l=h=>{let m;n&&n.__fc__&&(m=n.__fc__.getParentGroup());let p;a.template?p=t.$handle.loadStrVar(a.template,h,m?{rule:n,value:t.$handle.subRuleData[m.id]||{}}:null):a.handler&&g.Function(a.handler)?p=a.handler(h,n,o):p=t.$handle.loadStrVar(`{{${a.attr}}}`,h,m?{rule:n,value:t.$handle.subRuleData[m.id]||{}}:null),(p==null||p==="")&&a.default!=null&&(p=a.default),a.copy!==!1&&(p=ye(p));const b=a.modify?n:r.getProp();a.to==="child"?b.children?b.children[0]=p:b.children=[p]:Ve(b,a.to||"options",p),o.sync(n)},u=h=>l(h);const c=t.watchLoadData(u);l=ke(l,a.wait||300),a.watch!==!1?s.push(c):c()}}),this._fn[r.id]=s})},deleted(r){this._fn[r.id]&&(this._fn[r.id].forEach(n=>{n()}),delete this._fn[r.id]),r.clearProp()}};return e.watch=e.loaded,e},ti=function(t){const e={name:"t",_fn:[],loaded(r,n,o){this.deleted(r);let i=r.getValue()||{};const s=[];Object.keys(i).forEach(a=>{const l=i[a];if(l){const u=typeof l=="object";let c=p=>{let b=t.t(u?l.attr:l,u?l.params:null,p);const S=u&&l.modify?n:r.getProp();a==="child"?S.children?S.children[0]=b:S.children=[b]:Ve(S,a,b),o.sync(n)},h=p=>c(p);const m=t.watchLoadData(h);c=ke(c,l.wait||300),l.watch!==!1?s.push(m):m()}}),this._fn[r.id]=s},deleted(r){this._fn[r.id]&&(this._fn[r.id].forEach(n=>{n()}),delete this._fn[r.id]),r.clearProp()}};return e.watch=e.loaded,e},rr={name:"componentValidate",load(t,e,r){let n=t.getValue();if(!n||n.method===!1)t.clearProp(),r.clearValidateState([e.field]);else{g.Object(n)||(n={method:n});const o=n.method,i=oe(V({},n),{validator(...s){const a=be(e);if(a)return r.exec(a.id,g.String(o)?o:"formCreateValidate",...s,{attr:t,rule:e,api:r})}});delete i.method,t.getProp().validate=[i]}},watch(...t){rr.load(...t)}},ri={fetch:function(t){function e(o){return g.String(o)&&(o={action:o,to:"options"}),o}function r(o,i,s){let a=o.value;n.deleted(o),g.Function(a)&&(a=a(i,s)),a=e(a);const l=h=>{h===void 0?o.clearProp():Ve(o.getProp(),a.to||"options",h),h!=null&&a&&a.key&&t.$handle.options.globalData[a.key]&&t.fetchCache.set(t.$handle.options.globalData[a.key],{status:!0,data:h}),s.sync(i)};if(!a||!a.action&&!a.key){l(void 0);return}a=ye(a),a.to||(a.to="options");const u=a.onError,c=()=>{if(!o.getValue())return o.clearProp(),s.sync(i),!0};n._fn[o.id]=t.watchLoadData(ke((h,m)=>{if(m&&a.watch===!1)return n._fn[o.id]();if(a.key){t.targetRule=i;const S=h("$globalData."+a.key);if(delete t.targetRule,S){if(c())return;l(S)}return}const p=t.$handle.loadFetchVar(ye(a),h,i),b=oe(V({headers:{}},p),{onSuccess(S,C){if(c())return;let j=I=>C?I:W(I,"data")?I.data:I;const M=$e(p.parse);g.Function(M)?j=M:M&&g.String(M)&&(j=I=>ae(I,M)),qe(j(S,i,s)).then(I=>{l(I)})},onError(S){l(void 0),!c()&&(u||(C=>tt(C.message||"fetch fail "+p.action)))(S,i,s)}});t.$handle.beforeFetch(b,{rule:i,api:s}).then(()=>{if(g.Function(p.action)){qe(p.action(i,s)).then(S=>{b.onSuccess(S,!0)}).catch(S=>{b.onError(S)});return}N(()=>t.create.fetch(b,{inject:o,rule:i,api:s}))}).catch(S=>{})},a.wait||600))}const n={name:"fetch",_fn:[],loaded(...o){r(...o)},watch(...o){r(...o)},deleted(o){this._fn[o.id]&&(this._fn[o.id](),delete this._fn[o.id]),o.clearProp()}};return n},loadData:ei,t:ti,componentValidate:rr},ni={name:"html",loadChildren:!1,render(t,e){return e.prop.props.innerHTML=t.default(),e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren(t){return{default:()=>t.filter(e=>g.String(e)).join("")}}};function ii(t){t=t+"=";const r=decodeURIComponent(document.cookie).split(";");for(let n=0;n<r.length;n++){let o=r[n];for(;o.charAt(0)===" ";)o=o.substring(1);if(o.indexOf(t)===0){o=o.substring(t.length,o.length);try{return JSON.parse(o)}catch(i){return o}}}return null}function si(t){const e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(r){return e}return null}function oi(t){const e=sessionStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(r){return e}return null}function ht(t,e){if(!e)return null;const r=e.split(".");let n=t(r.shift());return r.length?n==null?null:ae(n,r):n}function ai(t){return ht(ii,t)}function li(t){return ht(si,t)}function ui(t){return ht(oi,t)}const ci={en:{required:"{title} is required",validate:{url:"{title} is not a valid url",email:"{title} is not a valid email",ip:"{title} {title} is not a valid ip",phone:"{title} {title} is not a valid phone",pattern:"{title} does not match pattern {pattern}",uppercase:"{title} must be all uppercase",lowercase:"{title} must be all lowercased",positive:"{title} is not a positive number",negative:"{title} is not a negative number",equal:"{title} is not equal to {equal}",min:"{title} cannot be less than {min}",max:"{title} cannot be greater than {max}",enum:"{title} must be one of {enum}",hasKeys:"{title} does not contain required fields {hasKeys}",minLen:"{title} must be at least {minLen}",maxLen:"{title} cannot be longer than {maxLen}",len:"{title} must be exactly {len}",integer:"{title} is not an integer",number:"{title} is not an number"}},"zh-cn":{required:"{title}不能为空",validate:{url:"{title}不是有效的 url 地址",email:"{title}不是有效的邮箱地址",ip:"{title}不是有效的 IP 地址",phone:"{title}不是正确的手机号",pattern:"{title}必须匹配 {pattern}",uppercase:"{title}必须全大写",lowercase:"{title}必须全小写",positive:"{title}不是正数",negative:"{title}不是负数",equal:"{title}必须等于 {equal}",min:"{title}必须大于等于 {min}",max:"{title}必须小于等于 {max}",enum:"{title}必须是 {enum} 之一",hasKeys:"{title}必须包含 {hasKeys} 字段",minLen:"{title}长度必须大于 {minLen}",maxLen:"{title}长度必须小于 {maxLen}",len:"{title}长度必须为 {len}",integer:"{title}必须为整数",number:"{title}必须为数字"}}};function fi(t,e){let r;return arguments.length===2?(r=arguments[1],e=r[t]):r=arguments[2],{id:e,prop:r}}function pt(){return fi("name",...arguments)}function di(t){const e=t.key||[],r=t.array||[],n=t.normal||[];Dt.push(...e),ot.push(...r),at.push(...n),Ht([...e,...r,...n])}let hi=1;const de={},nr=Symbol("defValue");function ir(t){const e={[dt.name]:dt},r={},n={},o={},i={},s=[],a=[],l=[t.extendApi],u=V({},ri),c=kn();let h={global:{}};const m=t.isMobile===!0,p=f.reactive({$mobile:m}),b=Zn(),S={},C={};di(t.attrs||{});function j(d){const y=de[d];if(Array.isArray(y))return y.map($=>$.api());if(y)return y.api()}function M(d){s.push(d)}function I(){const d=pt(...arguments);d.id&&d.prop&&(n[d.id]=d.prop)}function re(){const d=pt(...arguments);d.id&&d.prop&&(u[d.id]=g.Function(d.prop)?d.prop:oe(V({},d.prop),{name:d.id}))}function ee(d){b.use(d)}function Z(d){if(arguments.length===0)return Le;if(typeof d=="string"&&arguments.length===1)return r[le(d)];const y=pt(...arguments);if(!y.id||!y.prop)return Le;const $=le(y.id),_=y.prop,E=_.merge===!0?r[$]:void 0;r[$]=Ge(_,E||Le),c[$]=ie($),_.maker&&R(c,_.maker)}function L(d,y){let $;if(g.String(d)){if($=d,y===void 0)return e[$]}else $=d.displayName||d.name,y=d;if(!$||!y)return;const _=le($);e[$]=y,e[_]=y,delete b.aliasMap[$],delete b.aliasMap[_],delete r[$],delete r[_],y.formCreateParser&&Z($,y.formCreateParser)}function B(){return Cn(K,e,n)}function z(d,y){const $=B();return f.createApp({data(){return f.reactive({rule:d,option:y})},render(){return f.h($,V({ref:"fc"},this.$data))}})}function x(){return dt}function P(d,y){return g.Function(d.install)?d.install(J,y):g.Function(d)&&d(J,y),this}function J(d,y){let $=z(d,y||{});s.forEach(q=>{N(()=>q(J,$))});const _=document.createElement("div");return((y==null?void 0:y.el)||document.body).appendChild(_),$.mount(_).$refs.fc.fapi}Ge(J,C);function se(d){let y=V({},t);return d?y.inherit={components:e,parsers:r,directives:n,modelFields:o,providers:u,useApps:s,maker:c,formulas:S,loadData:p}:delete y.inherit,ir(y)}function D(d,y){o[d]=y}function v(d,y){S[d]=y}function w(d,y){const $=i[d]||{},_=$.parsers||{};y.parsers&&Object.keys(y.parsers).forEach(E=>{_[E]=Ge(y.parsers[E],Le)}),y.name=d,i[d]=oe(V(V({},$),y),{parsers:_})}function k(d){d&&Object.keys(de).forEach(y=>{(Array.isArray(de[y])?de[y]:[de[y]]).forEach(_=>{_.bus.$emit("$loadData."+d)})})}function O(d,y){Ve(p,d,y),k(d)}function F(d,y){const $=(..._)=>N(()=>y(..._));$._driver=!0,O(d,$)}function A(d,y){const $=(d||"").split(".");d=$.shift();const _=$.join(".");if(W(p,d)||(p[d]=nr),p[d]!==nr){let E=p[d];return E&&E._driver?E=E(_):$.length&&(E=ae(E,$)),E==null||E===""?y:E}else return y}function T(d){l.push(d)}function H(d){delete p[d],k(d)}function G(d,y){a.push({name:d,callback:y})}function K(d){R(this,{id:hi++,create:J,vm:d,manager:Xn(t.manager),parsers:r,providers:u,modelFields:o,formulas:S,isMobile:m,rules:d.props.rule,name:d.props.name||Ye(),inFor:d.props.inFor,prop:{components:e,directives:n},get:null,drivers:i,renderDriver:null,refreshData:k,loadData:p,CreateNode:b,bus:new wt,unwatch:new Set,options:f.ref({}),extendApiFn:l,fetchCache:new WeakMap,tmpData:f.reactive({})}),this.unwatch.push=this.unwatch.add,a.forEach(y=>{this.bus.$on(y.name,y.callback)}),f.nextTick(()=>{f.watch(this.options,()=>{this.$handle.$manager.updateOptions(this.options.value),this.api().refresh()},{deep:!0})}),R(d.appContext.components,e),R(d.appContext.directives,n),this.$handle=new _e(this),this.name&&(this.inFor?(de[this.name]||(de[this.name]=[]),de[this.name].push(this)):de[this.name]=this)}K.isMobile=m,R(K.prototype,{init(){this.isSub()&&this.unwatch.add(f.watch(()=>this.vm.setupState.parent.setupState.fc.options.value,()=>{this.initOptions(),this.$handle.api.refresh()},{deep:!0,flush:"sync"})),this.vm.props.driver&&(this.renderDriver=typeof this.vm.props.driver=="object"?this.vm.props.driver:this.drivers[this.vm.props.driver]),!this.renderDriver&&this.vm.setupState.parent&&(this.renderDriver=this.vm.setupState.parent.setupState.fc.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver(d,...y){if(this.bus.$emit(d,...y),this.renderDriver&&this.renderDriver[d])return N(()=>this.renderDriver[d](...y))},t(d,y,$){let _=$?$("$t."+d):this.globalLanguageDriver(d);return _==null&&(_=""),_&&y&&Object.keys(y).forEach(E=>{const q=new RegExp(`{${E}}`,"g");_=_.replace(q,y[E])}),_},globalDataDriver(d){let y=d.split(".");const $=y.shift(),_=this.options.value.globalData&&this.options.value.globalData[$];if(_){if(_.type==="static")return ae(_.data,y);{let E;const q=this.fetchCache.get(_);if(q){if(q.status&&(E=ae(q.data,y)),!q.loading)return E;q.loading=!1,this.fetchCache.set(_,q)}else this.fetchCache.set(_,{status:!1});const Y=ke(()=>{me();const ce=this.fetchCache.get(_);this.options.value.globalData&&Object.values(this.options.value.globalData).indexOf(_)!==-1?(ce&&(ce.loading=!0,this.fetchCache.set(_,ce)),this.bus.$emit("$loadData.$globalData."+$)):this.fetchCache.delete(_)},_.wait||600),he=ce=>{this.fetchCache.set(_,{status:!0,data:ce}),this.bus.$emit("$loadData.$globalData."+$)},pe=(ce,ge)=>{if(ge&&_.watch===!1)return me();if(ge){Y();return}const Ee=this.$handle.loadFetchVar(et(_),ce);Ee.targetRule=this.targetRule,this.$handle.api.fetch(Ee).then(Re=>{he(Re)}).catch(Re=>{he(null)})},me=this.watchLoadData(pe);return _.watch===!1&&me(),E}}},getLocale(){let d=this.vm.setupState.top.props.locale;return d&&typeof d=="object"?d.name:typeof d=="string"?d:"zh-cn"},globalLanguageDriver(d){let y=this.vm.setupState.top.props.t,$=this.vm.setupState.top.props.locale,_;if(y&&(_=N(()=>y(d))),_==null&&$&&typeof $=="object"&&(_=ae($,d)),_==null){const E=this.options.value.language||{},q=this.getLocale();_=ae(E[q]||{},d),_==null&&(_=ae(ci[q]||{},d))}return _},globalVarDriver(d){let y=d.split(".");const $=y.shift(),_=this.options.value.globalVariable&&this.options.value.globalVariable[$];if(_){const E=g.Function(_)?_:$e(_.handle);if(E){let q=E((...Y)=>this.$handle.api.getData(...Y),this.$handle.api);return ae(q,y)}}},setData(d,y,$){$?O(d,y):(Ve(this.vm.setupState.top.setupState.fc.tmpData,d,y),this.bus.$emit("$loadData."+d))},getLoadData(d,y){let $=null;if(d!=null){let _=d.split(".");const E=_.shift();if($=ae(this.vm.setupState.top.setupState.fc.tmpData,d),$!=null)return $;if(E==="$topForm")$=this.$handle.api.top.formData(!0);else if(E==="$scopeForm")$=this.$handle.api.scope.formData(!0);else if(E==="$form")$=this.$handle.api.formData(!0);else if(E==="$options")$=this.options.value;else if(E==="$globalData")$=this.globalDataDriver(_.join(".")),_=[];else if(E==="$var")$=this.globalVarDriver(_.join(".")),_=[];else if(E==="$locale")$=this.getLocale(),_=[];else if(E==="$t")$=this.globalLanguageDriver(_.join(".")),_=[];else{if(E==="$preview")return this.$handle.preview;$=A(d),_=[]}$&&_.length&&($=ae($,_))}return $==null||$===""?y:$},watchLoadData(d,y){let $={};const _=Y=>{this.get||(this.get=E),N(()=>{d(E,Y)}),this.get===E&&(this.get=void 0)},E=(Y,he)=>{let pe;if(typeof Y=="object"&&(pe=Y.getValue,Y=Y.id),$[Y])return $[Y].val;const me=f.computed(()=>pe?pe():this.getLoadData(Y,he)),ce=Y.split("."),ge=ce.shift(),Ee=ce.shift()||"",Re=ke(()=>{const Ne=pe?pe():this.getLoadData(Y,he);if($[Y])((Ne instanceof Function||g.Object(Ne)||Array.isArray(Ne))&&Ne===$[Y].val||JSON.stringify(Ne)!==JSON.stringify($[Y].val))&&($[Y].val=Ne,_(!0));else return},y||0),Ii=f.watch(me,Ne=>{Re()});return this.bus.$on("$loadData."+ge,Re),Ee&&this.bus.$on("$loadData."+ge+"."+Ee,Re),$[Y]={fn:()=>{this.bus.$off("$loadData."+ge,Re),Ee&&this.bus.$off("$loadData."+ge+"."+Ee,Re),Ii()},val:me.value},me.value};_(!1);const q=()=>{Object.keys($).forEach(Y=>$[Y].fn()),$={},this.unwatch.delete(q)};return this.unwatch.add(q),q},isSub(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions(){this.options.value={};let d=V({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},ye(h));const y=this.isSub();y&&(d=this.mergeOptions(d,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),d=this.mergeOptions(d,this.vm.props.option);const $=this.api();this.targetFormDriver("initOptions",d,{api:$,isSubForm:y}),this.updateOptions(d)},mergeOptions(d,y,$){return y=V({},y||{}),$&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","beforeUnmount","beforeSubmit","onBeforeUnmount","onReload","reload","formData","el","globalClass","style"].forEach(_=>{delete y[_]}),y.global&&(d.global=gn(d.global,y.global),delete y.global),this.$handle.$manager.mergeOptions([y],d),d},updateOptions(d){this.options.value=this.mergeOptions(this.options.value,d),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api(){return this.$handle.api},render(){return this.$handle.render()},mounted(){this.$handle.mounted()},unmount(){if(N(()=>this.$handle.lifecycle("beforeUnmount")),this.name)if(this.inFor){const d=de[this.name].indexOf(this);de[this.name].splice(d,1)}else delete de[this.name];a.forEach(d=>{this.bus.$off(d.name,d.callback)}),this.tmpData={},[...this.unwatch].forEach(d=>d()),this.unwatch.clear(),this.$handle.reloadRule([])},updated(){this.$handle.bindNextTick(()=>this.bus.$emit("next-tick",this.$handle.api))}});function ne(d){R(d,{version:t.version,ui:t.ui,isMobile:m,extendApi:T,getData:A,setDataDriver:F,setData:O,removeData:H,refreshData:k,maker:c,component:L,directive:I,setModelField:D,setFormula:v,setDriver:w,register:re,$vnode:x,parser:Z,use:P,factory:se,componentAlias:ee,copyRule:Nt,copyRules:Pt,mergeRule:ve,fetch:zt,$form:B,parseFn:$e,parseJson:vt,toJson:Ie,useApp:M,getApi:j,on:G})}function Oe(d){R(d,{create:J,install(y,$){h=V(V({},h),$||{});const _=`_installedFormCreate${m?"Mobile":""}_${t.ui}`;if(y[_]===!0)return;y[_]=!0;const E=function(Y,he={}){return J(Y,he)};ne(E),y.config.globalProperties.$formCreate=E;const q=B();y.component(q.name,q),s.forEach(Y=>{N(()=>Y(d,y))})}})}if(ne(C),Oe(C),F("$cookie",ai),F("$localStorage",li),F("$sessionStorage",ui),b.use({fragment:"fcFragment"}),t.install&&J.use(t),M((d,y)=>{y.mixin({props:["formCreateInject"],emits:["fc.updateValue","fc.el"]})}),Z(ni),t.inherit){const d=t.inherit;d.components&&R(e,d.components),d.parsers&&R(r,d.parsers),d.directives&&R(n,d.directives),d.modelFields&&R(o,d.modelFields),d.providers&&R(u,d.providers),d.useApps&&R(s,d.useApps),d.maker&&R(c,d.maker),d.loadData&&R(p,d.loadData),d.formulas&&R(S,d.formulas)}const ue=B();return Ge(ue,C),Object.defineProperties(ue,{fetch:{get(){return C.fetch},set(d){C.fetch=d}}}),ue.util=C,ue}const sr={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",quarter:"YYYY-qQ",year:"YYYY"},Ze="datePicker",or={name:Ze,maker:function(){return["date","month","week"].reduce((t,e)=>(t[e]=ie(Ze,{type:e}),t),{dateRange:ie(Ze,{type:"range"}),datetimeRange:ie(Ze,t=>t.props({type:"range",showTime:!0}))})}(),modelField:"value",mergeProp(t){const e=t.prop.props,r=e.type||e.picker;e.valueFormat||(e.valueFormat=(sr[r]||sr.date)+(e.showTime&&(!r||r==="date")?" HH:mm:ss":""))},render(t,e){return e.$render.vNode[(e.prop.props.range===!0?"range":"date")+"Picker"](e.prop,t)}},mt="hidden",pi={name:mt,maker:{[mt]:(t,e)=>ie(mt)("",t,e)},render(){return[]}},gt="input",mi={name:gt,maker:function(){return["password","url","email","text","textarea","search"].reduce((t,e)=>(t[e]=ie(gt,{type:e}),t),{idate:ie(gt,{type:"date"})})}(),modelField:"value",render(t,e){let r=e.prop.props.type;return["textarea","search","password"].indexOf(r)===-1&&(r="input"),r={textarea:"aTextarea",search:"aInputSearch",password:"aInputPassword"}[r]||"aInput",e.$render.vNode.make(r,e.prop,t)}},ar={name:"timePicker",modelField:"value",mergeProp(t){const e=t.prop.props;e.valueFormat||(e.valueFormat="HH:mm:ss")},render(t,e){return e.$render.vNode["time"+(e.prop.props.range===!0?"Range":"")+"Picker"](e.prop,t)}},gi={name:"tree",modelField:"checkedKeys",mergeProp(t){const e=t.prop.props;e.fieldNames?e.fieldNames.key||(e.fieldNames.key="id"):e.fieldNames={key:"id"},e.checkedKeys=t.rule.value,e.checkable=!0}},yi={name:"FcRow",render(t,e){return e.vNode.col({props:{span:24}},{default:()=>[e.vNode.row(e.prop,t)]})}},$i=oe(V({},or),{name:"rangePicker",maker:{},render(t,e){return e.$render.vNode.rangePicker(e.prop,t)}}),bi=oe(V({},ar),{name:"timeRangePicker",render(t,e){return e.$render.vNode.timeRangePicker(e.prop,t)}}),_i=[st,or,$i,pi,mi,ar,bi,{name:"transfer",mergeProp(t){t.prop.props.render||(t.prop.props.render=e=>e.title)}},gi,sn,on,yi],U="a",wi={tooltip:U+"Tooltip",popover:U+"Popover",button:U+"Button",icon:U+"Icon",slider:U+"Slider",rate:U+"Rate",upload:"fcUpload",cascader:U+"Cascader",timePicker:U+"TimePicker",timeRangePicker:U+"TimeRangePicker",datePicker:U+"DatePicker",rangePicker:U+"RangePicker",switch:U+"Switch",select:U+"Select",checkbox:U+"CheckboxGroup",radio:U+"RadioGroup",input:U+"Input",inputNumber:U+"InputNumber",treeSelect:U+"TreeSelect",transfer:U+"Transfer",mentions:U+"Mentions",search:U+"InputSearch",inputPassword:U+"InputPassword",textarea:U+"Textarea",formItem:U+"FormItem",form:U+"Form",frame:"fcFrame",col:U+"Col",row:U+"Row",tree:U+"Tree",autoComplete:U+"AutoComplete",group:"fcGroup",array:"fcGroup",subForm:"fcSubForm",object:"fcSubForm"},Xe=void 0;function Oi(){return{form:{hideRequiredMark:!1,layout:"horizontal",labelAlign:"right",labelCol:{span:3},wrapperCol:{span:21},validateOnRuleChange:!0},row:{gutter:0},submitBtn:{disabled:!1,loading:!1,type:"primary",innerText:"",show:!0,col:Xe,click:Xe},resetBtn:{disabled:!1,loading:!1,type:"default",innerText:"",show:!1,col:Xe,click:Xe},info:{type:"popover",render:"html"}}}function Ci(t){return t.type==="tooltip"}function vi(t){return t.render==="text"||t.render==="innerText"}function Si(t){return{type:"div",props:{innerHTML:t==null?"":String(t)}}}function lr(t,e){W(t,e)&&g.String(t[e])&&(t[e]={[e]:t[e],show:!0})}function we(t){return t===!1}function ki(t,e){W(t,e)&&!g.Object(t[e])&&(t[e]={show:!!t[e]})}function yt(t){const e=V({},t);return delete e.children,e}const Vi={validate(){const t=this.form();return t?t.validate():new Promise(e=>e())},validateField(t){const e=this.form();return e?e.validateFields(t):new Promise(r=>r())},clearValidateState(t){const e=this.vm.refs[t.wrapRef];e&&e.clearValidate()},tidyOptions(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(e=>{ki(t,e)}),t},tidyRule({prop:t}){return lr(t,"title"),lr(t,"info"),t},mergeProp(t){const e={info:{type:"popover",render:"html",placement:"topLeft",icon:"QuestionCircleOutlined"},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(r=>{t.prop[r]=Ce([this.options[r]||{},t.prop[r]||{}],e[r])})},getDefaultOptions(){return Oi()},adapterValidate(t,e){return t.validator=(r,n)=>new Promise((o,i)=>e(n,a=>{a?i(a):o()})),t},update(){const t=this.options.form;this.rule={props:V({},t),on:{submit:e=>{e.preventDefault()}},style:t.style,type:"form"}},beforeRender(){const{key:t,ref:e,$handle:r}=this,n=this.options.form;R(this.rule,{key:t,ref:e,class:[n.className,n.class,"form-create",this.$handle.preview?"is-preview":""]}),R(this.rule.props,{model:r.formData})},render(t){return t.slotLen()&&!this.$handle.preview&&t.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,we(this.options.row.show)?t.getSlots():[this.makeRow(t)])},makeWrap(t,e){const r=t.prop,n=`${this.key}${t.key}`,o=r.col,i=this.isTitle(r)&&r.wrap.title!==!1,{layout:s,col:a}=this.rule.props,l=r.wrap.class;delete r.wrap.class,delete r.wrap.title;const u=(g.Undef(r.wrap.show)?!t.input:we(r.wrap.show))?e:this.$r(Ce([r.wrap,{props:V(oe(V({},yt(r.wrap||{})),{name:t.id,rules:t.injectValidate()}),s!=="horizontal"?{labelCol:{},wrapperCol:{}}:{}),class:this.$render.mergeClass(l||r.className,"fc-form-item"),key:`${n}fi`,ref:t.wrapRef,type:"formItem"}]),V({default:()=>e},i?{label:()=>this.makeInfo(r,n,t)}:{}));return s==="inline"||we(a)||we(o.show)?u:this.makeCol(r,n,[u])},isTitle(t){if(this.options.form.title===!1)return!1;const e=t.title;return!(!e.title&&!e.native||we(e.show))},makeInfo(t,e,r){var u,c,h,m,p,b;const n=V({},t.title),o=V({},t.info);if(this.options.form.title===!1)return!1;if(!n.title&&!n.native||we(n.show))return;const i=Ci(o),s=this.getSlot("title"),a=[s?s({title:(c=(u=r.refRule)==null?void 0:u.__$title)==null?void 0:c.value,rule:r.rule,options:this.options}):(m=(h=r.refRule)==null?void 0:h.__$title)==null?void 0:m.value];if(!we(o.show)&&(o.info||o.native)&&!we(o.icon)){const S={type:o.type||"popover",props:yt(o),key:`${e}pop`};delete S.props.icon,delete S.props.show,delete S.props.info,delete S.props.align,delete S.props.native,delete S.props.render;const C=i?"title":"content",j=(b=(p=r.refRule)==null?void 0:p.__$info)==null?void 0:b.value,M={[n.slot||"default"]:()=>this.$r({type:o.icon===!0?"QuestionCircleOutlined":o.icon||"",props:{type:o.icon===!0?"QuestionCircleOutlined":o.icon},key:`${e}i`})};o.info&&!W(S.props,C)&&(vi(o)?S.props[C]=j==null?"":String(j):M[C]=()=>this.$r(Si(j))),a[o.align!=="left"?"unshift":"push"](this.$r(Ce([o,S]),M))}const l=Ce([n,{props:yt(n),key:`${e}tit`,class:"fc-form-title",type:n.type||"span",on:{click:(...S)=>{this.$handle.targetHook(r,"titleClick",{args:S})}}}]);return delete l.props.show,delete l.props.title,delete l.props.native,this.$r(l,a)},makeCol(t,e,r){const n=V({},t.col);return delete n.show,this.$r({class:this.$render.mergeClass(n.class,"fc-form-col"),type:"col",props:n||{span:24},key:`${e}col`},r)},makeRow(t){const e=this.options.row||{};return this.$r({type:"row",props:e,class:this.$render.mergeClass(e.class,"fc-form-row"),key:`${this.key}row`},t)},makeFormBtn(){let t=[];if(we(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),we(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!t.length)return;let{labelCol:e,wrapperCol:r,layout:n}=this.rule.props;n!=="horizontal"&&(e=r={});const o=this.$r({type:"formItem",class:"fc-form-item fc-form-footer",key:`${this.key}fb`,props:{labelCol:e,wrapperCol:r,label:" ",colon:!1}},t);return n==="inline"?o:this.$r({type:"col",class:"fc-form-col",props:{span:24},key:`${this.key}fc`},[o])},makeResetBtn(){const t=V({},this.options.resetBtn),e=t.innerText||this.$handle.api.t("reset")||"重置";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width,marginLeft:"10px"},on:{click:()=>{const r=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(r):r.resetFields()}},key:`${this.key}b2`},[e])},makeSubmitBtn(){const t=V({},this.options.submitBtn),e=t.innerText||this.$handle.api.t("submit")||"提交";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:()=>{const r=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(r):r.submit().catch(()=>{})}},key:`${this.key}b1`},[e])}},je={};function Di(t){["treeSelect","transfer","mentions","upload","frame","autoComplete","cascader","datePicker","frame","inputNumber","inputPassword","radio","rate","switch","rate","slider","timePicker"].reduce((e,r)=>(e[r]=ie(r),e),t),t.auto=t.autoComplete,t.number=t.inputNumber,t.time=t.timePicker,t.password=t.inputPassword}function Fi(t){const e={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(e).reduce((r,n)=>(r[n]=ie("frame",o=>o.props({type:e[n][0],maxLength:e[n][1]})),r),t),t.frameInput=t.frameInputs,t.frameFile=t.frameFiles,t.frameImage=t.frameImages}function Ei(t){t.sliderRange=ie("slider",{range:!0})}function Ri(t){const e="select";t.selectMultiple=ie(e,{mode:"multiple"}),t.selectTags=ie(e,{mode:"tags"}),t.selectCombobox=ie(e,{mode:"combobox"})}function Ai(t){const e={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(e).reduce((r,n)=>(r[n]=ie("upload",o=>o.props({uploadType:e[n][0],maxLength:e[n][1]})),r),t),t.uploadImage=t.image,t.uploadFile=t.file}Di(je),Ei(je),Fi(je),Ai(je),Ri(je);function ur(t,e){return g.Boolean(t)?t={show:t}:!g.Undef(t)&&!g.Object(t)&&(t={show:e}),t}function Mi(t,e){return{formEl(){return e.$manager.form()},wrapEl(r){const n=e.getFieldCtx(r);if(n)return e.vm.refs[n.wrapRef]},validate(r){return new Promise((n,o)=>{const i=t.children,s=[e.$manager.validate()];i.filter(a=>!a.isScope).forEach(a=>{s.push(a.validate())}),Promise.all(s).then(()=>{n(!0),r&&r(!0)}).catch(a=>{o(a),r&&r(a),e.vm.emit("validate-fail",a,{api:t}),e.emitEvent("validate-fail",a,{api:t})})})},validateField(r,n){return new Promise((o,i)=>{const a=typeof r=="object"?be(r):e.getCtx(r);if(!a){o(null),n&&n(null);return}const l=e.subForm[a.id],u=[e.$manager.validateField(a.id)];X(l).filter(c=>!c.isScope).forEach(c=>{u.push(c.validate())}),Promise.all(u).then(()=>{o(null),n&&n(null)}).catch(c=>{i(c),n&&n(c),e.vm.emit("validate-field-fail",c,{field:r,api:t})})})},validateFields(r,n){return new Promise((o,i)=>{Array.isArray(r)||(r=[r]);const s=r.map(a=>t.validateField(a));Promise.all(s).then(()=>{o(null),n&&n(null)}).catch(a=>{i(a),n&&n(a)})})},clearValidateState(r,n=!0){t.helper.tidyFields(r).forEach(o=>{n&&this.clearSubValidateState(o),e.getCtxs(o).forEach(i=>{e.$manager.clearValidateState(i)})})},clearSubValidateState(r){t.helper.tidyFields(r).forEach(n=>{e.getCtxs(n).forEach(o=>{const i=e.subForm[o.id];i&&(Array.isArray(i)?i.forEach(s=>{s.clearValidateState()}):i&&i.clearValidateState())})})},btn:{loading:(r=!0)=>{t.submitBtnProps({loading:!!r})},disabled:(r=!0)=>{t.submitBtnProps({disabled:!!r})},show:(r=!0)=>{t.submitBtnProps({show:!!r})}},resetBtn:{loading:(r=!0)=>{t.resetBtnProps({loading:!!r})},disabled:(r=!0)=>{t.resetBtnProps({disabled:!!r})},show:(r=!0)=>{t.resetBtnProps({show:!!r})}},submitBtnProps:(r={})=>{let n=ur(e.options.submitBtn,!0);R(n,r),e.options.submitBtn=n,t.refreshOptions()},resetBtnProps:(r={})=>{let n=ur(e.options.resetBtn,!1);R(n,r),e.options.resetBtn=n,t.refreshOptions()},submit(r,n){return new Promise((o,i)=>{(e.options.validateOnSubmit===!1?Promise.resolve():t.validate()).then(()=>{let a=t.formData();e.beforeSubmit(a).then(()=>{g.Function(r)&&N(()=>r(a,t)),g.Function(e.options.onSubmit)&&N(()=>e.options.onSubmit(a,t)),e.vm.emit("submit",a,t),o(a)}).catch(l=>{})}).catch((...a)=>{g.Function(n)&&N(()=>n(t,...a)),i(...a)})})}}}const cr={autoComplete:"value",cascader:"value",inputNumber:"value",inputPassword:"value",textarea:"value",rate:"value",slider:"value",treeSelect:"value",transfer:"targetKeys",mentions:"value",switch:"checked"},fr={name:"required",load(t,e,r){const n=ji(t.getValue());let o;if(n.required===!1)t.clearProp(),r.clearValidateState([e.field]);else{const i=V({required:!0,validator(a,l){return s(),new Promise((u,c)=>{g.empty(l)?c(i.message):u()})}},n),s=()=>{var l;const a=(l=e.__fc__.refRule.__$title)==null?void 0:l.value;if(o!==a)if(o=a,!n.message)i.message=r.t("required",{title:a})||a+(r.getLocale()==="en"?" is required":"不能为空");else{const u=n.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);u&&(i.message=r.t(u[1],{title:a}))}};s(),t.getProp().validate=[i]}r.sync(e)},watch(...t){fr.load(...t)}};function ji(t){return g.Boolean(t)?{required:t}:g.String(t)?{message:t}:g.Undef(t)?{required:!1}:g.Function(t)?{validator:t}:g.Object(t)?t:{}}function Ni(t){t.componentAlias(wi),Object.keys(cr).forEach(e=>{t.setModelField(e,cr[e])}),nn.forEach(e=>{t.component(e.name,e)}),t.register(fr),_i.forEach(e=>{t.parser(e)}),Object.keys(je).forEach(e=>{t.maker[e]=je[e]}),typeof window!="undefined"&&window.antd&&t.useApp((e,r)=>{r.use(window.antd)})}function Pi(){return ir({ui:"ant-design-vue",version:"3.3.6",manager:Vi,install:Ni,extendApi:Mi,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}const $t=Pi();typeof window!="undefined"&&(window.formCreate=$t);const Ti=$t.maker;te.default=$t,te.maker=Ti,Object.defineProperties(te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});