unione-form-vue 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(ie,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("unione-base-vue"),require("vue"),require("ant-design-vue"),require("lodash-es"),require("vue-codemirror"),require("@codemirror/lang-javascript"),require("vuedraggable"),require("@hufe921/canvas-editor"),require("dayjs"),require("prismjs"),require("@codemirror/lang-json"),require("@codemirror/lang-html"),require("@codemirror/lang-css"),require("@codemirror/lang-sql"),require("@ant-design/icons-vue"),require("uuid"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","unione-base-vue","vue","ant-design-vue","lodash-es","vue-codemirror","@codemirror/lang-javascript","vuedraggable","@hufe921/canvas-editor","dayjs","prismjs","@codemirror/lang-json","@codemirror/lang-html","@codemirror/lang-css","@codemirror/lang-sql","@ant-design/icons-vue","uuid","vue-router"],P):(ie=typeof globalThis<"u"?globalThis:ie||self,P(ie.index={},ie.UnioneBaseVue,ie.Vue,ie.antDesignVue,ie.lodashEs,ie.vueCodemirror,ie.langJavascript,ie.draggable,ie.canvasEditor,ie.dayjs,ie.prism,ie.langJson,ie.langHtml,ie.langCss,ie.langSql,ie.iconsVue,ie.uuid,ie.vueRouter))})(this,function(ie,P,e,te,en,tn,Da,On,pe,od,Ua,La,ad,id,rd,gt,sd,dd){"use strict";const cd={isDebug:!1,axios:{form:"/portal",flow:"/flow"},listPageUrl:"/data/page/list",addPageUrl:"/data/page/add",editPageUrl:"/data/page/edit",viewPageUrl:"/data/page/view",formRules:[]},to=e.ref(cd);function Le(t){return t&&(to.value=P.utils.obj.set(to.value,t)),to.value}const ud={...{...{submit:"提交","submit.ok":"已提交","submit.error":"提交失败","confirm.ok":"确定","confirm.cancel":"取消","global.setting.title":"设置"},...{"pages.home":"首页"},...{"pages.layouts.userLayout.title":"user layout"}}},pd={...{submit:"Submit","submit.ok":"Submitted","submit.error":"Submit Failed","confirm.ok":"Yes","confirm.cancel":"No","global.setting.title":"Settings"},...{"pages.home":"Home"},...{"pages.layouts.userLayout.title":"user layout"}},fd=e.ref([ud,pd]);function md(t,n){return P.locales.loadLanguage(t,()=>new Promise((l,o)=>{const a=fd.value.filter(i=>i.localeName==t);if(n)if(typeof n=="function")n().then(i=>{if(a.length==0){const s={...i,localeName:t};l(s)}else{const s={...a[0],...i};l(s)}});else if(a.length==0){const i={...n,localeName:t};l(i)}else{const i={...a[0],...n};l(i)}else a.length>0?l(a[0]):o("local language not defined ,lang:"+t)}))}const no={...P.locales};no.loadLanguage=md;class gd{$psn;$pid;$store;$forms;$model;$params;$refObj;$refData;constructor(n,l){this.$psn=n,this.$pid="",this.$store={},this.$forms={},this.$params={},this.$refObj={},this.$refData={},this.$model=l}params(n){if(n){this.$params=n,n.id&&(this.$pid=n.id,this.$psn&&this.use(this.$psn,"form").detail(this.$pid));for(const l in this.$store)this.$store[l].$params=n}return this.$params}psn(n){return n&&(this.$psn=n),this.$psn}regRef(n,l){}setRefData(n,l,o){}use(n,l,o){let a=this.$store[n];return a||(a=new lo(n,l,this.$model),this.$store[n]=a,a.$params=this.$params),o&&(a.$form=o,this.$forms[n]=o),a}useForm(n,l,o){const a=this.use(n,"form",l);return this.$psn==n&&this.$pid&&a.detail(this.$pid).then(i=>{o&&o(i)}),a}data(n){return this.$store[n]}form(n){return n?this.$forms[n]:this.$forms}primary(){return this.data(this.$psn)}dsnList(){return Object.keys(this.$store)}}class lo{$sid;$dsn;$type;$data;$dialog;$model;$form;$params;$store;constructor(n,l,o){typeof n=="string"?(this.$dsn=n,this.$store={controller:"/api/data/storage/v1"}):(this.$store=n,this.$dsn=""),this.$type=l,this.$data=e.ref(l=="form"?{}:{body:[],total:0}),this.$dialog=P.useDialog(),this.$model=e.ref(o||"run")}$isStorage(){return this.$store.controller.indexOf("/api/data/storage")>=0}store(n){return n&&(this.$store=n),this.$store}data(){return this.$type=="form"?this.$data.value||{}:this.$data.value||[]}setValue(n){this.$data.value=n,this.$form?.setValue(n)}reset(n){this.$data.value=n||{},this.$form?.setValue(n||{}),this.$form?.reset(),this.$sid=""}$processParams(n,l,o){if(o)o.forEach(a=>{if(a.name.startsWith("$")){const i=a.name.substring(1);l[i]==null&&l[i]==null&&(this.$params[i]!=null&&this.$params[i]!=null?(l[a.alias||i]=this.$params[i],P.utils.obj.setValue(l,a.alias||i,P.utils.obj.getValue(this.$params,i))):a.value!=null&&a.value!=null&&P.utils.obj.setValue(l,a.alias||i,a.value))}else l[n][a.name]==null&&l[n][a.name]==null&&(this.$params[a.name]!=null&&this.$params[a.name]!=null?P.utils.obj.setValue(l[n],a.alias||a.name,P.utils.obj.getValue(this.$params,a.name)):a.value!=null&&a.value!=null&&P.utils.obj.setValue(l[n],a.alias||a.name,a.value))});else if(this.$params)for(const a in this.$params)l[n][a]==null&&l[n][a]==null&&this.$params[a]!=null&&this.$params[a]!=null&&(l[n][a]=this.$params[a]);return l}request(n){return new Promise((l,o)=>{const a=te.message.loading("数据请求中..."),i=this.$store.controller+n.url;P.axios[this.$store.ctx||"form"]({method:"post",...n,url:i}).then(s=>{s.success?l(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"数据请求失败,model sn:"+this.$dsn+",url:"+i,options:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"数据请求失败,model sn:"+this.$dsn+",url:"+i,options:n,err:s})}).finally(()=>{a()})})}find(n){const l=this.$store.controller+(this.$store.findUrl||"/find");return!n&&this.$store.findParams&&(n={dsn:this.$dsn}),this.$isStorage()&&(n.dsn=this.$dsn+(this.$model!="run"?"@dev":"")),n&&(n=this.$processParams("body",n,this.$store.findParams)),new Promise((o,a)=>{const i=te.message.loading("数据加载中...");P.axios[this.$store.ctx||"form"]({url:l,method:"post",data:n}).then(s=>{s.success?(this.$data.value=s,o(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),a({info:"数据加载失败,model sn:"+this.$dsn,url:l,params:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),a({info:"数据加载失败,model sn:"+this.$dsn,url:l,params:n,err:s})}).finally(()=>{i()})})}save(n){const l=this.$store.controller+(this.$store.saveUrl||"/save");return this.$isStorage()?(n.dsn=this.$dsn+(this.$model!="run"?"@dev":""),n=this.$processParams("params",n,this.$store.saveParams),this.$params?.id&&(n.id=this.$params.id),this.$sid&&(n.id=this.$sid)):(n=this.$processParams("data",n,this.$store.saveParams),this.$params?.id&&(n.data.id=this.$params.id)),new Promise((o,a)=>{const i=te.message.loading("数据提交中...");P.axios[this.$store.ctx||"form"]({url:l,method:"post",data:this.$isStorage()?n:n.data}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body||{},this.$sid=s.id),s.silence||te.message.success(s.message),o(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),a({info:"数据保存失败,model sn:"+this.$dsn,url:l,data:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),a({info:"数据保存失败,model sn:"+this.$dsn,url:l,data:n,err:s})}).finally(()=>{i()})})}loadByIds(n){return new Promise((l,o)=>{const a=te.message.loading("数据加载中..."),i=this.$store.controller+"/loadByIds";P.axios[this.$store.ctx||"form"]({url:i,method:"post",data:this.$isStorage()?{ids:n,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:n}).then(s=>{s.success?l(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"数据加载失败,model sn:"+this.$dsn,ids:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"数据加载失败,model sn:"+this.$dsn,ids:n,err:s})}).finally(()=>{a()})})}detail(n){return new Promise((l,o)=>{const a=te.message.loading("数据加载中..."),i=this.$store.controller+"/detail";P.axios[this.$store.ctx||"form"]({url:i,method:"post",headers:{"Content-Type":"application/json"},data:this.$isStorage()?{id:n,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:n}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body||{},this.$sid=s.id),l(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"加载数据详情失败,model sn:"+this.$dsn,url:i,id:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"加载数据详情失败,model sn:"+this.$dsn,url:i,id:n,err:s})}).finally(()=>{a()})})}deleteByIds(n){return new Promise((l,o)=>{this.$dialog.confirm({content:"确定要删除选中记录么?共"+n.length+"条。",onOk:()=>{const a=te.message.loading("数据处理中..."),i=this.$store.controller+"/delete";P.axios[this.$store.ctx||"form"]({url:i,method:"post",data:this.$isStorage()?{ids:n,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:n}).then(s=>{s.success?l(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"数据删除失败,model sn:"+this.$dsn,url:i,ids:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"数据删除失败,model sn:"+this.$dsn,url:i,ids:n,err:s})}).finally(()=>{a()})}})})}}class hd{$event;$onces;$delayEmit;constructor(){this.$event={},this.$onces={},this.$delayEmit={}}$on(n,l){if(this.$event[n]=l,this.$delayEmit[n]){const o=this.$delayEmit[n];l(o)}}$emit(n,l){if(this.$onces[n]){const o=this.$onces[n];delete this.$onces[n],o(l)}this.$event[n]?this.$event[n](l):(this.$delayEmit[n]=l,setTimeout(()=>{delete this.$delayEmit[n]},1e3*10))}$once(n,l){this.$onces[n]=l}$off(n){delete this.$event[n]}}function oo(t){const n=t.toLowerCase().split("_"),l=[];l.push(n[0]);for(let o=1;o<n.length;o++){const a=n[o];a&&(l.push(a.charAt(0).toUpperCase()),a.length>1&&l.push(a.substring(1)))}return l.join("")}const ja="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Pa(t=10){const n=Date.now().toString(),l=new Uint32Array(t);crypto.getRandomValues(l);let o="";for(let a=0;a<t;a++){const i=(parseInt(n[a%n.length],10)+l[a])%ja.length;o+=ja[i]}return o}function qa(t,n){const l={data:{},error:[]};return t.filter(o=>o.visible!=!1).forEach(o=>{const a=P.utils.obj.getValue(n,o.name);if(!(o.event?.visible&&typeof o.event.visible=="function"&&!o.event.visible(a,n))){if(P.utils.obj.setValue(l.data,o.name,a),o.event?.validate&&typeof o.event.validate=="function"){const i=o.event.validate(a,n);i&&l.error.push({name:o.name,title:o.title,message:i})}else o.props?.required&&!a&&a!==0&&l.error.push({name:o.name,title:o.title,message:o.title+"不能为空"});if(o.widgets?.length){const i=qa(o.widgets,n);l.data={...l.data,...i.data},l.error.push(...i.error)}}}),l}const je={...P.utils,toHump:oo,randomStr:Pa,form:{validate:qa}},ao=[{name:"undo",title:"撤销",exec:t=>{t.undo()}},{name:"redo",title:"重做",exec:t=>{t.redo()}},{name:"add",title:"新增组件",exec:(t,n)=>{if(!n){te.message.error("添加组件失败,组件定义不能为空");return}if(!n.widget){te.message.error("添加组件失败,组件widget不能为空");return}if(n.wid||(n.wid=je.randomStr(32)),n.pid){const o=t.$widgetMap.value[n.pid];o&&(o.widgets||(o.widgets=[]),o.widgets.splice(n.index,0,n))}else t.$widgetList.value.splice(n.index,0,n);const l=o=>{o.widgets?.forEach(a=>{a.pid=o.wid,a.wid||(a.wid=je.randomStr(32)),t.$widgetMap.value[a.wid]=a,l(a)})};return l(n),t.widgetActive.value=n,t.$widgetMap.value[n.wid]=n,t.$status.value.size=Object.keys(t.$widgetMap.value).length,{name:"del",params:{wid:n.wid}}}},{name:"copy",title:"复制组件",exec:(t,n)=>{if(!n){te.message.error("复制组件失败,组件wid不能为空");return}let l=t.$widgetMap.value[n];if(!l){te.message.error("复制组件失败,组件定义不能为空");return}if(l=JSON.parse(JSON.stringify(l)),l.wid=je.randomStr(32),l.pid){const a=t.$widgetMap.value[l.pid];a&&(a.widgets||(a.widgets=[]),a.widgets.push(l))}else t.$widgetList.value.push(l);const o=a=>{a.widgets?.forEach(i=>{i.pid=a.wid,i.wid||(i.wid=je.randomStr(32)),t.$widgetMap.value[i.wid]=i,o(i)})};return o(l),t.widgetActive.value=l,t.$widgetMap.value[l.wid]=l,t.$status.value.size=Object.keys(t.$widgetMap.value).length,{name:"del",params:{wid:l.wid}}}},{name:"del",title:"删除组件",exec:(t,n)=>{if(!n){te.message.error("删除组件失败,组件wid不能为空");return}const l=t.$widgetMap.value[n];if(l){if(!l.pid||!t.$widgetMap.value[l.pid])t.$widgetList.value=t.$widgetList.value.filter(a=>a.wid!==l.wid);else if(l.pid){const a=t.$widgetMap.value[l.pid];a&&(a.widgets=a.widgets.filter(i=>i.wid!==l.wid))}const o=a=>{a.widgets?.forEach(i=>{o(i),delete t.$widgetMap.value[i.wid]})};return o(l),t.widgetActive.value={},delete t.$widgetMap.value[l.wid],t.$status.value.size=Object.keys(t.$widgetMap.value).length,{name:"add",params:l}}}},{name:"clear",title:"清空组件",exec:t=>{t.widgetActive.value={},t.$widgetMap.value={},t.$widgetList.value=[],t.$cmdUndo.value=[],t.$cmdRedo.value=[],t.$cmdExes.value=[],t.$cmdUndo.value=[],t.$cmdRedo.value=[],t.$cmdExes.value=[],t.$cmdMap.value=[],t.$status.value={cmdCount:0,undoCount:0,redoCount:0,exeCount:0,size:0},t.$axiosProccess.value={},t.$status.value.size=Object.keys(t.$widgetMap.value).length}},{name:"update",title:"更新组件",exec:(t,n)=>{if(!n){te.message.error("更新组件失败,组件定义不能为空");return}if(!n.wid){te.message.error("更新组件失败,组件wid不能为空");return}const l=t.$widgetMap.value[n.wid];if(l){const o=P.utils.obj.ext({},l);return P.utils.obj.set(l,n),{name:"update",params:o}}}},{name:"setActive",title:"设置组件激活",exec:(t,n)=>{if(!n){te.message.error("设置组件激活失败,组件wid不能为空");return}const l=t.$widgetMap.value[n];if(l)return t.widgetActive.value=l,{name:"disActive",params:n}}},{name:"disActive",title:"取消组件激活",exec:(t,n)=>{if(!n){te.message.error("取消组件激活失败,组件wid不能为空");return}if(t.$widgetMap.value[n])return t.widgetActive.value=null,{name:"setActive",params:n}}},{name:"move",title:"移动组件",exec:(t,{wid:n,pid:l,oldIndex:o,newIndex:a})=>{if(!n){te.message.error("移动组件失败,组件wid不能为空");return}const i=t.$widgetMap.value[n];if(i){const s=i.pid;if(l&&l!==s){const r=t.$widgetMap.value[s];r&&(r.widgets=r.widgets.filter(d=>d.wid!==i.wid))}if(l){const r=t.$widgetMap.value[l];r&&(l===s&&(r.widgets=r.widgets.filter(d=>d.wid!==i.wid)),r.widgets.splice(a,0,i),i.pid=l)}else t.$widgetList.value.splice(a,0,i);return{name:"move",params:{wid:n,pid:s,oldIndex:a,newIndex:o}}}}}];class Se{define;ebus;model;widgetActive;type;$widgetList;$widgetMap;$dataManager;dataModels;$axiosProccess;$dialog;$cmdMap;$cmdUndo;$cmdRedo;$cmdExes;$undoSize;$status;static conponents=e.ref({});static regComponent=(n,l)=>{};static buildComponent=n=>{Array.isArray(n)||(n=[n]),n.forEach(l=>{const o={...l};o.configs&&(o.configs=JSON.parse(o.configs)),o.props?o.props=JSON.parse(o.props):o.props={},Se.conponents.value[o.control||o.widget||o.name]=o}),n.filter(l=>l.isCustom==1).forEach(l=>{if(!l.configs){console.error("widget config is empty, widget id:"+l.id);return}try{const o=JSON.parse(l.configs),a=new Function("return"+o.script)();a.template=o.template,a.style=o.style,a.widget=l.widget||l.name,Se.regComponent(a.widget,e.defineAsyncComponent(()=>Promise.resolve(a)));const i=document.querySelector('style[data-widget="'+a.widget+'"]');if(o.style)if(o.style=o.style.replace(/\.([a-zA-Z0-9_-]+)/g,"."+a.widget+" .$1"),o.style=o.style.replace("."+a.widget+" ."+a.widget,"."+a.widget),i)i.innerHTML=o.style;else{const s=document.createElement("style");s.setAttribute("data-widget",a.widget+""),s.innerHTML=o.style,document.head.appendChild(s)}else i&&i.remove()}catch(o){console.error("widget script error,widget id:"+l.id,o)}})};constructor(n={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgets:[],dsnList:[]}},l){const o=n.configs||{};this.dataModels=e.ref(o.dataModels||[]),this.widgetActive=e.ref({}),this.model=e.ref(l?.model||"run"),this.type=e.ref(n.types||"setting"),this.define=n,this.ebus=new hd,this.$widgetList=e.ref([]),this.$widgetMap=e.ref({}),this.$dataManager=new gd(o.dsnList?o.dsnList[0]:"",this.model.value),this.$undoSize=e.ref(l?.undoSize||1e3),this.$cmdUndo=e.ref([]),this.$cmdRedo=e.ref([]),this.$cmdExes=e.ref([]),this.$cmdMap=e.ref({}),this.$status=e.ref({cmdCount:0,undoCount:0,redoCount:0,exeCount:0,size:0}),this.$axiosProccess=e.ref({}),this.$dialog=P.useDialog(),this.regCmd(ao),this.loadConfig(o),this.ebus.$on("cmd:exec",({name:a,params:i})=>{if(a=="undo"){this.undo();return}if(a=="redo"){this.redo();return}this.exeCmd(a,i)}),e.nextTick(()=>{this.ebus.$emit("engine:inited")})}sn(){return this.define.sn}load(n,l){if(!n)return Promise.reject("sn is empty");if(this.define.sn=n,n.endsWith(":view")&&(this.model.value="view"),n=="new_")return console.log("新建/本地页面sn:"+n+",define:",l),l&&l.configs&&(this.define=l,this.type.value=this.define.types||"setting",this.loadConfig(l.configs)),Promise.resolve();const o=sessionStorage.getItem("PAGE_DEFINE:"+n);return o&&this.model.value=="run"?(this.define=JSON.parse(o),this.type.value=this.define.types||"setting",this.loadConfig(this.define.configs),console.log("从会话缓存中加载页面sn:"+n+",define:",this.define),Promise.resolve()):new Promise((a,i)=>{P.axios.form({url:"/api/page/define/load/"+n,method:"post"}).then(s=>{s.success?(this.define=s.body,this.type.value=this.define.types||"setting",s.body.configs?this.define.configs=s.body.configs:this.define.configs={widgets:[],dsnList:[]},this.loadConfig(this.define.configs),sessionStorage.setItem("PAGE_DEFINE:"+n,JSON.stringify(this.define)),console.log("从远程服务加载页面sn:"+n+",define:",this.define),a(this.define)):l&&l.configs&&(this.define=l,this.loadConfig(l.configs),a(this.define))}).catch(s=>{i(s)})})}save(){return new Promise((n,l)=>{if(this.$axiosProccess.value.save){console.warn("unione form editor save process runing,sn:"+this.define.sn),l();return}this.$axiosProccess.value.save=!0;const o={...this.define.configs||{},widgets:this.$widgetList.value,dsnList:this.$dataManager.dsnList()},a={...this.define};a.configs=JSON.stringify(o),P.axios.form({url:"/api/page/define/save",method:"post",data:a}).then(i=>{this.$axiosProccess.value.save=!1,i.success?(te.message.success(i.message),this.define=i.body,sessionStorage.setItem("PAGE_DEFINE:"+this.define.sn,JSON.stringify(this.define)),this.load(this.define.sn,this.define),n(i.body)):(this.$dialog.error({content:i.message}),l())}).catch(i=>{console.error("页面配置保存失败",i),this.$dialog.error({content:"页面配置保存失败"})}).finally(()=>{this.$axiosProccess.value.save=!1})})}loadConfig(n){n.dsnList?.length&&this.$dataManager.psn(n.dsnList[0]),this.$widgetList.value=n.widgets||[],this.$widgetMap.value={},this.$processWidget(this.$widgetList.value),this.$status.value||(this.$status.value={}),this.$status.value.size=Object.keys(this.$widgetMap.value).length}setModel(n){this.model.value=n}widget(n){return this.$widgetMap.value?this.$widgetMap.value[n]:null}widgets(n){if(n)this.$widgetList.value=n,this.$widgetMap.value={},this.$processWidget(n);else return this.$widgetList.value}$processWidget(n,l){n.forEach(o=>{o.wid||(o.wid="w:"+en.uniqueId()),l&&(o.pid=l.wid),this.$widgetMap.value[o.wid]=o,o?.widgets&&this.$processWidget(o.widgets,o)})}dataManager(){return this.$dataManager}regCmd(n){Array.isArray(n)?n.forEach(l=>{this.$cmdMap.value[l.name]=l}):this.$cmdMap.value[n.name]=n,this.$status.value.cmdCount=Object.keys(this.$cmdMap.value).length}offCmd(n){Array.isArray(n)?n.forEach(l=>{delete this.$cmdMap.value[l]}):delete this.$cmdMap.value[n],this.$status.value.cmdCount=Object.keys(this.$cmdMap.value).length}exeCmd(n,l){const o=this.$cmdMap.value[n];if(console.log("UFEngine exe cmd,name:"+n+",cmd:",o,l),o&&o.exec){const a=o.exec(this,l);a&&(this.$cmdUndo.value.push({name:a.name,params:a.params}),this.$cmdExes.value.push({name:n,params:l}),this.$cmdUndo.value.length>this.$undoSize.value&&(this.$cmdUndo.value.shift(),this.$cmdExes.value.shift())),this.$status.value.exeCount=this.$status.value.exeCount+1,this.$status.value.undoCount=this.$cmdUndo.value.length}}undo(){if(this.$cmdUndo.value.length){const n=this.$cmdUndo.value.pop(),l=this.$cmdExes.value.pop();if(!n||!l)return;const o=this.$cmdMap.value[n.name];o&&o.exec&&(o.exec(this,n.params),this.$cmdRedo.value.push({name:l.name,params:l.params}),this.$cmdRedo.value.length>this.$undoSize.value&&this.$cmdRedo.value.shift()),this.$status.value.undoCount=this.$cmdUndo.value.length,this.$status.value.redoCount=this.$cmdRedo.value.length}}redo(){if(this.$cmdRedo.value.length){const n=this.$cmdRedo.value.pop();if(this.$status.value.redoCount=this.$cmdRedo.value.length,!n)return;this.exeCmd(n.name,n.params)}}status(){return this.$status}}const bd={key:0,class:"widget-opts"},yd={class:"widget-setting-dialog"},vd=e.defineComponent({name:"UnioneWidget",__name:"widget",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},settingTitle:{type:String,default:"组件设置"},custome:{type:Boolean,default:!1},model:{type:String}},emits:["setting","saving"],setup(t,{expose:n,emit:l}){const o=t,a=l,i=e.ref(),s=e.ref(),r=e.ref(!1);function d(){s.value&&(r.value=!0),a("setting")}function f(){a("saving"),r.value=!1}function c(){return i.value?.clientHeight}function h(){return i.value?.clientWidth}const p=e.computed(()=>o.model||o.engine?.model||"run"),m=e.computed(()=>{const u=o.engine?.widgetActive||{};return u.wid?u.wid==o.wid:!1});function x(){o.engine&&o.wid&&p.value=="edit"&&(console.log("widget click,wid:"+o.wid+",widget",o.engine.$widgetMap[o.wid]),o.engine.ebus.$emit("cmd:exec",{name:"setActive",params:o.wid}))}function b(){o.engine&&o.wid&&o.engine.ebus.$emit("cmd:exec",{name:"del",params:o.wid})}function g(){o.engine&&o.wid&&o.engine.ebus.$emit("cmd:exec",{name:"copy",params:o.wid})}return n({getHeight:c,getWidth:h}),(u,y)=>{const N=e.resolveComponent("CopyOutlined"),k=e.resolveComponent("DeleteOutlined"),w=e.resolveComponent("SettingOutlined"),V=e.resolveComponent("a-tooltip"),_=e.resolveComponent("a-modal");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["unione-widget",p.value,m.value&&"active"]),ref_key:"widgetDom",ref:i,onClick:e.withModifiers(x,["stop"])},[p.value=="edit"?(e.openBlock(),e.createElementBlock("div",bd,[e.createVNode(N,{class:"opt",onClick:e.withModifiers(g,["stop"])}),e.createVNode(k,{class:"opt",onClick:e.withModifiers(b,["stop"])}),e.createVNode(V,{title:t.settingTitle},{default:e.withCtx(()=>[u.$slots["widget-setting"]||t.custome?(e.openBlock(),e.createBlock(w,{key:0,class:"widget-setting opt",onClick:d})):e.createCommentVNode("",!0)]),_:1},8,["title"])])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},void 0,!0),p.value=="edit"&&u.$slots["widget-setting"]?(e.openBlock(),e.createBlock(_,{key:1,title:t.settingTitle,ref_key:"settingModal",ref:s,open:r.value,"onUpdate:open":y[0]||(y[0]=v=>r.value=v),centered:"",width:"80%",onOk:f},{default:e.withCtx(()=>[e.createElementVNode("div",yd,[e.renderSlot(u.$slots,"widget-setting",{},void 0,!0)])]),_:3},8,["title","open"])):e.createCommentVNode("",!0)],2)}}}),Z=(t,n)=>{const l=t.__vccOpts||t;for(const[o,a]of n)l[o]=a;return l},ht=Z(vd,[["__scopeId","data-v-5ce8d58a"]]),kd={key:0},wd=["onClick"],dl=Z(e.defineComponent({__name:"btnSetting",props:{preset:{type:Array,default(){return[]}}},setup(t,{expose:n}){const l=t,o=e.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:k})=>k+1},{title:"参数名称",dataIndex:"name",key:"name",width:"60px",align:"center"},{title:"参数标题",dataIndex:"title",key:"title",width:"80px",align:"center"},{title:"参数value",dataIndex:"value",key:"value",width:"100px",align:"center"}]),a=e.ref({selectedRowKeys:[],columnWidth:"25px",onChange:k=>{a.value.selectedRowKeys=k}}),i={mounted:k=>k.focus()},s=e.ref({});function r(){const k=Object.keys(s.value);if(k.length)for(let w in k){const V=b.value.form.action.params[w];V&&s.value[w]&&Object.keys(s.value[w]).forEach(_=>{V[_]=s.value[w][_]})}s.value={}}function d(k,w,V){r();const _={};_[V]=w[V]||"",V=="showIndex"&&(_[V]=w.show?.query?.index),s.value[k]=_}function f(k,w,V){if(!w||!V){s.value={};return}const _=s.value[k][V];w[V]=_,s.value={}}function c(){b.value.form.action.params.push({title:"新建",name:"",value:""})}function h(){}const p=e.ref(""),m=e.ref({title:[{required:!0,message:"按钮标题不能为空"}],name:[{required:!0,message:"按钮名称不能为空"},{validator:(k,w)=>p.value!=w&&l.preset.includes(w)?Promise.reject("预设按钮名称,请使用其他名称,["+l.preset.join(",")+"]"):Promise.resolve(),trigger:"change"}]}),x=e.ref([Da.javascript()]),b=e.ref({title:"按钮设置",visible:!1,form:{},helps:{}}),g=e.ref();function u(k,w,V={}){k=JSON.parse(JSON.stringify(k)),k.event||(k.event={}),k.props||(k.props={}),k.action||(k.action={}),Object.keys(k.action).includes("maskClosable")||(k.action.maskClosable=!0),k.action.params||(k.action.params=[]),p.value=k.name,b.value.form=k,b.value.helps=V,b.value.visible=!0,g.value=w}const y=e.ref(null);function N(){y.value&&y.value.validate().then(()=>{b.value.visible=!1,g.value(b.value.form)})}return n({open:u,close}),(k,w)=>{const V=e.resolveComponent("a-input"),_=e.resolveComponent("a-form-item"),v=e.resolveComponent("a-select"),C=e.resolveComponent("a-input-number"),E=e.resolveComponent("a-checkbox"),S=e.resolveComponent("a-tab-pane"),A=e.resolveComponent("a-switch"),O=e.resolveComponent("a-button"),T=e.resolveComponent("a-divider"),B=e.resolveComponent("ToolOutlined"),$=e.resolveComponent("a-tooltip"),I=e.resolveComponent("a-table"),F=e.resolveComponent("a-tabs"),j=e.resolveComponent("a-form"),U=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(U,{visible:b.value.visible,"onUpdate:visible":w[23]||(w[23]=M=>b.value.visible=M),title:b.value.title,centered:"",width:"50%",onOk:N},{default:e.withCtx(()=>[e.createVNode(j,{name:"basic",ref_key:"form",ref:y,rules:m.value,model:b.value.form,"label-col":{span:5},"wrapper-col":{span:19},autocomplete:"off",class:"form-mix btn-setting-form"},{default:e.withCtx(()=>[e.createVNode(F,null,{default:e.withCtx(()=>[e.createVNode(S,{key:"base",tab:"基本设置"},{default:e.withCtx(()=>[e.createVNode(_,{label:"操作标题",required:"",name:"title"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.title,"onUpdate:value":w[0]||(w[0]=M=>b.value.form.title=M)},null,8,["value"])]),_:1}),e.createVNode(_,{label:"操作名称",name:"name",required:""},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.name,"onUpdate:value":w[1]||(w[1]=M=>b.value.form.name=M),disabled:l.preset.includes(b.value.form.name)},null,8,["value","disabled"])]),_:1}),e.createVNode(_,{label:"操作图标"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.icon,"onUpdate:value":w[2]||(w[2]=M=>b.value.form.icon=M)},null,8,["value"])]),_:1}),e.createVNode(_,{label:"按钮类型"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.type,"onUpdate:value":w[3]||(w[3]=M=>b.value.form.type=M),allowClear:"",options:[{value:"primary",label:"主要按钮"},{value:"ghost",label:"幽灵按钮"},{value:"dashed",label:"虚线按钮"},{value:"link",label:"连接按钮"},{value:"text",label:"文本按钮"},{value:"default",label:"默认按钮"}]},null,8,["value"])]),_:1}),e.createVNode(_,{label:"显示顺序"},{default:e.withCtx(()=>[e.createVNode(C,{value:b.value.form.index,"onUpdate:value":w[4]||(w[4]=M=>b.value.form.index=M)},null,8,["value"])]),_:1}),e.createVNode(_,{label:"按钮大小"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.size,"onUpdate:value":w[5]||(w[5]=M=>b.value.form.size=M),options:[{value:"small",label:"小"},{value:"middle",label:"中"},{value:"large",label:"大"}]},null,8,["value"])]),_:1}),e.createVNode(_,{label:"按钮特性"},{default:e.withCtx(()=>[e.createVNode(E,{checked:b.value.form.props.block,"onUpdate:checked":w[6]||(w[6]=M=>b.value.form.props.block=M)},{default:e.withCtx(()=>w[24]||(w[24]=[e.createTextVNode("自适应 ")])),_:1},8,["checked"]),e.createVNode(E,{checked:b.value.form.props.danger,"onUpdate:checked":w[7]||(w[7]=M=>b.value.form.props.danger=M)},{default:e.withCtx(()=>w[25]||(w[25]=[e.createTextVNode("危险 ")])),_:1},8,["checked"]),e.createVNode(E,{checked:b.value.form.props.ghost,"onUpdate:checked":w[8]||(w[8]=M=>b.value.form.props.ghost=M)},{default:e.withCtx(()=>w[26]||(w[26]=[e.createTextVNode("幽灵 ")])),_:1},8,["checked"])]),_:1})]),_:1}),e.createVNode(S,{key:"action",tab:"响应设置"},{default:e.withCtx(()=>[e.createVNode(_,{label:"响应方式",required:""},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.action.type,"onUpdate:value":w[9]||(w[9]=M=>b.value.form.action.type=M),options:[{value:"link",label:"连接"},{value:"route",label:"路由"},{value:"drawer",label:"抽屉"},{value:"dialog",label:"对话框"}]},null,8,["value"])]),_:1}),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:0,label:"页面编码",help:"根据该页面编码渲染页面内容"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.psn,"onUpdate:value":w[10]||(w[10]=M=>b.value.form.action.psn=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:1,label:"组件名称",help:"组件方式渲染,Vue全局注册的组件名称,且监听params参数,psn参数"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.component,"onUpdate:value":w[11]||(w[11]=M=>b.value.form.action.component=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(_,{label:"连接地址"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.href,"onUpdate:value":w[12]||(w[12]=M=>b.value.form.action.href=M)},null,8,["value"])]),_:1}),["link","route"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:2,label:"连接方式"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.action.target,"onUpdate:value":w[13]||(w[13]=M=>b.value.form.action.target=M),options:[{value:"_blank",label:"新卡片页"},{value:"_self",label:"当前页面"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:3,label:"抽屉位置"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.action.position,"onUpdate:value":w[14]||(w[14]=M=>b.value.form.action.position=M),options:[{value:"left",label:"左侧"},{value:"right",label:"右侧"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:4,label:"显示标题",required:""},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.title,"onUpdate:value":w[15]||(w[15]=M=>b.value.form.action.title=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:5,label:"蒙层关闭"},{default:e.withCtx(()=>[e.createVNode(A,{checked:b.value.form.action.maskClosable,"onUpdate:checked":w[16]||(w[16]=M=>b.value.form.action.maskClosable=M),"checked-children":"开","un-checked-children":"关"},null,8,["checked"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:6,label:"显示宽度"},{default:e.withCtx(()=>[e.createVNode(C,{value:b.value.form.action.width,"onUpdate:value":w[17]||(w[17]=M=>b.value.form.action.width=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:7,label:"显示高度"},{default:e.withCtx(()=>[e.createVNode(C,{value:b.value.form.action.height,"onUpdate:value":w[18]||(w[18]=M=>b.value.form.action.height=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(T,{orientation:"left"},{default:e.withCtx(()=>[w[29]||(w[29]=e.createTextVNode("参数列表 ")),e.createVNode(O,{size:"small",class:"param-btn",onClick:c},{default:e.withCtx(()=>w[27]||(w[27]=[e.createTextVNode("添加")])),_:1}),e.createVNode(O,{size:"small",class:"param-btn",danger:"",onClick:h},{default:e.withCtx(()=>w[28]||(w[28]=[e.createTextVNode("删除")])),_:1})]),_:1}),e.createVNode(I,{columns:o.value,"data-source":b.value.form.action.params,bordered:"",pagination:!1,"row-selection":a.value,"row-key":"name",size:"small"},{headerCell:e.withCtx(({column:M})=>[["name","title"].includes(M.key)?(e.openBlock(),e.createElementBlock("span",kd,[e.createVNode(B),e.createTextVNode(" "+e.toDisplayString(M.title),1)])):e.createCommentVNode("",!0),["value"].includes(M.key)?(e.openBlock(),e.createBlock($,{key:1,title:"支持常量和变量,变量使用{row.属性}方式获取"},{default:e.withCtx(()=>[e.createElementVNode("span",null,[e.createVNode(B),e.createTextVNode(" "+e.toDisplayString(M.title),1)])]),_:2},1024)):e.createCommentVNode("",!0)]),bodyCell:e.withCtx(({column:M,text:Q,record:D,index:R})=>[["name","title","value"].includes(M.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["edit-field",(!s.value[R]||!Object.keys(s.value[R]).includes(M.dataIndex))&&!Q&&"empty"]),onClick:J=>d(R,D,M.dataIndex)},[s.value[R]&&Object.keys(s.value[R]).includes(M.dataIndex)?e.withDirectives((e.openBlock(),e.createBlock(V,{key:0,value:s.value[R][M.dataIndex],"onUpdate:value":J=>s.value[R][M.dataIndex]=J,onBlur:J=>f(R,D,M.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[i]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(Q),1)],64))],10,wd)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])]),_:1}),e.createVNode(S,{key:"event",tab:"事件设置"},{default:e.withCtx(()=>[e.createVNode(_,{label:"点击事件",help:b.value.helps.clickScript||"点击事件处理脚本,上下文参数:ctx,当前按钮对象:btn,当前事件对象:event,返回false则不触发默认逻辑"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.clickScript,"onUpdate:modelValue":w[19]||(w[19]=M=>b.value.form.event.clickScript=M),placeholder:"请输入点击事件处理脚本",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),e.createVNode(_,{label:"禁用逻辑",help:b.value.helps.disableScript||"按钮禁用逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回true禁用,否则可用"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.disableScript,"onUpdate:modelValue":w[20]||(w[20]=M=>b.value.form.event.disableScript=M),placeholder:"请输入按钮禁用逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),e.createVNode(_,{label:"显示逻辑",help:b.value.helps.visibleScript||"按钮显示逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回false隐藏,否则可见"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.visibleScript,"onUpdate:modelValue":w[21]||(w[21]=M=>b.value.form.event.visibleScript=M),placeholder:"请输入按钮显示逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),e.createVNode(_,{label:"动态标题",help:b.value.helps.titleScript||"按钮显示标题控制脚本,上下文参数:ctx,当前按钮对象:btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.titleScript,"onUpdate:modelValue":w[22]||(w[22]=M=>b.value.form.event.titleScript=M),placeholder:"请输入按钮动态标题逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"])]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["visible","title"])}}}),[["__scopeId","data-v-18621ac1"]]),Cd={class:"title"},Ad={class:"opts"},xd=["src"],Nd={class:"head-title"},_d={class:"title"},Sd={class:"opts"},Vd=["src"],Bd=Z(e.defineComponent({name:"UnioneBtn",__name:"btn",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},disabled:{type:Boolean,default:!1},type:{type:String},widget:{type:Object,required:!0,default(){return{}}},preset:{type:Array,default(){return[]}},ctx:{type:Object,default(){return{}}}},emits:["click"],setup(t,{emit:n}){const l=Le(),o=t,a=e.getCurrentInstance(),i=e.computed(()=>a?.appContext?.app),s=P.useSession(),r=e.computed(()=>o.engine?.widget(o.wid)||o.widget||{});e.watch(()=>r.value.event,()=>{f()},{deep:!0}),e.onMounted(()=>{f()});const d=e.ref({});function f(){r.value?.event&&(r.value.event.clickScript?d.value.click=new Function("ctx","btn","event",r.value.event.clickScript):typeof r.value.event.click=="function"?d.value.click=r.value.event.click:r.value.event.click?.enable&&r.value.event.click.scriptText&&(d.value.click=new Function("ctx","btn","event",r.value.event.click.scriptText)),r.value.event.disableScript?d.value.disable=new Function("ctx","btn",r.value.event.disableScript):typeof r.value.event.disable=="function"?d.value.disable=r.value.event.disable:r.value.event.disable?.enable&&r.value.event.disable.scriptText&&(d.value.disable=new Function("ctx","btn",r.value.event.disable.scriptText)),r.value.event.visibleScript?d.value.visible=new Function("ctx","btn",r.value.event.visibleScript):typeof r.value.event.visible=="function"?d.value.visible=r.value.event.visible:r.value.event.visible?.enable&&r.value.event.visible.scriptText&&(d.value.visible=new Function("ctx","btn",r.value.event.visible.scriptText)),r.value.event.titleScript?d.value.title=new Function("ctx","btn",r.value.event.titleScript):typeof r.value.event.title=="function"?d.value.title=r.value.event.title:r.value.event.title?.enable&&r.value.event.title.scriptText&&(d.value.title=new Function("ctx","btn",r.value.event.title.scriptText)))}const c=e.computed(()=>d.value.title?d.value.title(b.value,r.value):typeof r.value.title=="function"?r.value.title(b.value,r.value):r.value.title),h=e.computed(()=>d.value.visible?d.value.visible(b.value,r.value)!=!1:r.value.visible!=!1),p=e.computed(()=>o.disabled==!0?!0:d.value.disable?d.value.disable(b.value,r.value):r.value.disable==!0),m=e.ref(null);function x(){m.value?.open(r.value,C=>{console.log("btn props",C),Object.keys(C).forEach(E=>{r.value[E]=C[E]}),console.log("props btn",r.value)})}const b=e.computed(()=>({...o.ctx,user:s.getPrincipal(),token:s.getToken()})),g=e.ref({open:!1,ismax:!1}),u=e.computed(()=>{if(r.value.action?.href){let C=r.value.action.href;const E=C.matchAll("{[a-zA-Z.]*}"),S=[];let A=null;for(;A=E.next();){if(A&&A.value&&A.value[0]){let O=A.value[0].substring(1,A.value[0].length-1);S.includes(O)||S.push(O)}if(A.done)break}if(S.length>0)for(let O=0;O<S.length;O++){let T=S[O],B=P.utils.obj.getValue(b.value,T);B?B instanceof Object?C=C.replaceAll("{"+T+"}",JSON.stringify(B)):Array.isArray(B)?C=C.replaceAll("{"+T+"}",B.join(",")):C=C.replaceAll("{"+T+"}",B):C=C.replaceAll("{"+T+"}","")}return C.indexOf("?")==-1&&(C+="?"),(!r.value.action.component||r.value.action.component=="iframe")&&(C=C+"&isIframe=1"),C}return""}),y=e.computed(()=>{const C={};let E=r.value.action?.href||r.value.action?.link;if(E){const S=E.matchAll("{[a-zA-Z0-9.]*}"),A=[];let O=null;for(;O=S.next();){if(O&&O.value&&O.value[0]){let B=O.value[0].substring(1,O.value[0].length-1);A.includes(B)||A.push(B)}if(O.done)break}if(A.length>0)for(let B=0;B<A.length;B++){let $=A[B],I=P.utils.obj.getValue(b.value,$);I?I instanceof Object?E=E.replaceAll("{"+$+"}",JSON.stringify(I)):Array.isArray(I)?E=E.replaceAll("{"+$+"}",I.join(",")):E=E.replaceAll("{"+$+"}",I):E=E.replaceAll("{"+$+"}","")}const T=E.split("?")[1];T&&T.split("&").forEach(B=>{const $=B.split("=");$[0]&&$[1]&&(C[$[0]]=$[1])})}return r.value.action?.params&&r.value.action.params.filter(S=>S.value+"").forEach(S=>{if(new RegExp("\\{[a-zA-Z0-9\\.]*\\}").test(S.value)){let O=P.utils.obj.getValue(b.value,S.value);C[S.name]=O}else C[S.name]=S.value}),C}),N=n,k=e.inject("route"),w=e.inject("router");function V(C){if(l.isDebug&&console.log("unione btn click",r.value,C),!(d.value.click&&d.value.click(b.value,r.value,C)==!1)){if(r.value.action?.type=="drawer"||r.value.action?.type=="dialog"){g.value.open=!0;return}else if(r.value.action?.type=="route"){if(r.value.action.component&&i.value?.component(r.value.action.component)){const E=r.value.action.psn,S=k.path+"/"+r.value.name,A=r.value.action.title||r.value.title||r.value.label||r.value.name,O=k.name+":"+r.value.name;w.hasRoute(O)||w.addRoute(k.name,{path:S,name:O,title:A,component:i.value.component(r.value.action.component)}),w.push({path:S,query:{...y.value,psn:E}});return}if(r.value.action?.href||r.value.action?.link){if(r.value.action.link&&o.engine?.type.value=="code")return;w.push({path:r.value.action.href||r.value.action?.link,query:y.value});return}}N("click",{btn:r.value,event:C,ctx:b.value})}}function _(C){N("click",C)}function v(){o.engine?.ebus.$emit("table-list-search")}return(C,E)=>{const S=e.resolveComponent("a-button"),A=e.resolveComponent("unione-btn"),O=e.resolveComponent("a-dropdown"),T=e.resolveComponent("FullscreenOutlined"),B=e.resolveComponent("FullscreenExitOutlined"),$=e.resolveComponent("CloseOutlined"),I=e.resolveComponent("a-drawer"),F=e.resolveComponent("a-modal");return r.value.enable!=!1&&h.value?(e.openBlock(),e.createBlock(ht,{key:0,class:e.normalizeClass(["unione-btn",r.value.props?.block&&"unione-btn-block"]),model:t.engine?.model.value,onSetting:x,custome:!0,"setting-title":"按钮设置"},{default:e.withCtx(()=>[!r.value.widget||r.value.widget=="button"||r.value.widget=="unione-button"?(e.openBlock(),e.createBlock(S,e.mergeProps({key:0,disabled:p.value,size:r.value.size||"small",type:t.type||t.widget.type,shape:r.value.shape,class:"unione-btn-"+r.value.name,loading:r.value.loading,target:r.value.action?.target,title:r.value.tooltip,onClick:V},r.value.props),e.createSlots({default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value)+" ",1)]),_:2},[r.value.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.icon)))]),key:"0"}:void 0]),1040,["disabled","size","type","shape","class","loading","target","title"])):e.createCommentVNode("",!0),r.value.widget=="dropdown"?(e.openBlock(),e.createBlock(O,{key:1,trigger:[r.value.trigger||"hover"],class:e.normalizeClass([r.value.size||"small"])},{overlay:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["dropdown-overlay",r.value.layout])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.items,j=>(e.openBlock(),e.createBlock(A,{key:j.name,class:"item",widget:j,engine:t.engine,preset:t.preset,ctx:t.ctx,onClick:E[0]||(E[0]=U=>_(U))},null,8,["widget","engine","preset","ctx"]))),128))],2)]),default:e.withCtx(()=>[e.createVNode(S,{size:r.value.size||"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["size"])]),_:1},8,["trigger","class"])):e.createCommentVNode("",!0),r.value.action?.type=="drawer"?(e.openBlock(),e.createBlock(I,{key:2,class:"unione-btn-drawer",open:g.value.open,"onUpdate:open":E[4]||(E[4]=j=>g.value.open=j),placement:r.value.action?.position,maskClosable:r.value.action?.maskClosable,width:g.value.ismax?"100%":r.value.action?.width,closable:!1,bodyStyle:{padding:0,overflow:!r.value.action.component||r.value.action.component=="iframe"?"hidden":"auto"}},{title:e.withCtx(()=>[e.createElementVNode("div",Cd,[r.value.action?.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action?.icon),{key:0,style:{"margin-right":"5px"}})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.value.action?.title),1)])]),extra:e.withCtx(()=>[e.createElementVNode("div",Ad,[g.value.ismax?(e.openBlock(),e.createBlock(B,{key:1,class:"opt",onClick:E[2]||(E[2]=j=>g.value.ismax=!1)})):(e.openBlock(),e.createBlock(T,{key:0,class:"opt",onClick:E[1]||(E[1]=j=>g.value.ismax=!0)})),e.createVNode($,{class:"opt",onClick:E[3]||(E[3]=j=>g.value.open=!1)})])]),footer:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["footer-btn","btn-"+r.value.wid])},null,2)]),default:e.withCtx(()=>[!r.value.action.component||r.value.action.component=="iframe"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:u.value},null,8,xd)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action.component),{key:1,psn:r.value.action.psn,params:y.value,actype:"drawer",teleport:".btn-"+r.value.wid,onReloadTableList:v},null,40,["psn","params","teleport"]))]),_:1},8,["open","placement","maskClosable","width","bodyStyle"])):e.createCommentVNode("",!0),r.value.action?.type=="dialog"?(e.openBlock(),e.createBlock(F,{key:3,class:"unione-btn-dialog",open:g.value.open,"onUpdate:open":E[8]||(E[8]=j=>g.value.open=j),width:g.value.ismax?"100%":r.value.action?.width,"wrap-class-name":[g.value.ismax&&"unione-modal-full"],maskClosable:r.value.action?.maskClosable,centered:"",closable:!1},{title:e.withCtx(()=>[e.createElementVNode("div",Nd,[e.createElementVNode("div",_d,[r.value.action?.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action?.icon),{key:0,style:{"margin-right":"5px"}})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.value.action?.title),1)]),e.createElementVNode("div",Sd,[g.value.ismax?(e.openBlock(),e.createBlock(B,{key:1,class:"opt",onClick:E[6]||(E[6]=j=>g.value.ismax=!1)})):(e.openBlock(),e.createBlock(T,{key:0,class:"opt",onClick:E[5]||(E[5]=j=>g.value.ismax=!0)})),e.createVNode($,{class:"opt",onClick:E[7]||(E[7]=j=>g.value.open=!1)})])])]),footer:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["footer-btn","btn-"+r.value.wid])},null,2)]),default:e.withCtx(()=>[!r.value.action.component||r.value.action.component=="iframe"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:u.value,style:e.normalizeStyle({height:r.value.action?.height?r.value.action?.height+"px":""})},null,12,Vd)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action.component),{key:1,psn:r.value.action.psn,params:y.value,actype:"dialog",teleport:".btn-"+r.value.wid,onReloadTableList:v},null,40,["psn","params","teleport"]))]),_:1},8,["open","width","wrap-class-name","maskClosable"])):e.createCommentVNode("",!0),e.createVNode(dl,{ref_key:"btnSetting",ref:m,preset:o.preset},null,8,["preset"])]),_:1},8,["class","model"])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-71d1608e"]]);function be(t,n=350){let l=null;return o=>{clearTimeout(l),l=setTimeout(()=>{t(o)},n)}}const Ed=e.defineComponent({name:"UnioneWidgetRender",__name:"render",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},define:{type:Object,required:!1},widget:{type:Object,required:!0}},setup(t){const n=t,l=e.computed(()=>n.engine?.widget(n.wid)||n.widget||{}),o=e.computed(()=>n.define?e.defineAsyncComponent(()=>Promise.resolve(n.define)):l.value.widget);return e.watch(()=>n.define?.style,be(a=>{if(!n.define)return;a&&(a=a.replace(/\.([a-zA-Z0-9_-]+)/g,"."+n.define.widget+" .$1"),a=a.replace("."+n.define.widget+" ."+n.define.widget,"."+n.define.widget));const i=document.querySelector('style[data-widget="'+n.define.widget+'"]');if(i)i.innerHTML=a;else{const s=document.createElement("style");s.setAttribute("data-widget",n.define.widget+""),s.innerHTML=a,document.head.appendChild(s)}},500),{immediate:!0}),(a,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.mergeProps({wid:t.wid,engine:t.engine,widget:l.value,class:l.value.widget},l.value.props),null,16,["wid","engine","widget","class"]))}}),Od={key:1},Td={key:1,class:"widget-container"},Rd=e.defineComponent({name:"UnioneContainer",__name:"container",props:e.mergeModels({wid:{type:String,required:!1},widget:{type:Object,required:!1},engine:{type:Object,required:!1},disabled:{type:Boolean,default:!1}},{formValue:{type:Object,required:!1,default:()=>{}},formValueModifiers:{}}),emits:["update:formValue"],setup(t){const n=t,l=e.useModel(t,"formValue"),o=e.ref([]),a=e.computed(()=>n.engine&&n.wid?n.engine.$widgetMap[n.wid]||n.widget||{}:n.widget||{});e.watch(()=>a.value,()=>{a.value?.widgets?o.value=[...a.value.widgets]:o.value=[]},{deep:!0,immediate:!0});const i=e.computed(()=>n.engine?.model||"run");function s(r){if(console.log("handleChange",r),r.added&&n.engine&&(r.added.element.index=r.added.newIndex,r.added.element.pid=a.value?.wid||"",n.engine.ebus.$emit("cmd:exec",{name:"add",params:r.added.element})),r.moved&&n.engine){const d=r.moved.element;n.engine.ebus.$emit("cmd:exec",{name:"move",params:{wid:d.wid,pid:d.pid,oldIndex:r.moved.oldIndex,newIndex:r.moved.newIndex}})}}return(r,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["unione-container",i.value])},[a.value&&t.engine&&i.value=="edit"?(e.openBlock(),e.createBlock(e.unref(On),{key:0,class:"widget-container",group:"widget-container",list:o.value,onChange:s,"item-key":"wid"},{item:e.withCtx(({element:f})=>[f.widget?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.widget),e.mergeProps({key:0,widget:f,engine:t.engine,disabled:t.disabled,formValue:l.value,"onUpdate:formValue":d[0]||(d[0]=c=>l.value=c)},f.props),null,16,["widget","engine","disabled","formValue"])):(e.openBlock(),e.createElementBlock("div",Od,"组件为空名称:"+e.toDisplayString(f.title||f.id),1))]),_:1},8,["list"])):(e.openBlock(),e.createElementBlock("div",Td,[e.renderSlot(r.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.wid},[f.widget?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.widget),e.mergeProps({key:0,widget:f,engine:t.engine,disabled:t.disabled,formValue:l.value,"onUpdate:formValue":d[1]||(d[1]=c=>l.value=c),ref_for:!0},f.props),null,16,["widget","engine","disabled","formValue"])):e.createCommentVNode("",!0)],64))),128))])]))],2))}}),Fd={key:0,class:"unione-widget-empty-tip"},$d=Z(e.defineComponent({name:"UnioneTabs",__name:"tabs",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1}},{formValue:{type:Object,default:()=>{}},formValueModifiers:{}}),emits:["update:formValue"],setup(t){const n=t,l=e.useModel(t,"formValue"),o=e.ref(),a=e.computed(()=>n.engine?.widget(n.wid)||n.widget);return e.watch(()=>a.value?.widgets,()=>{o.value&&!a.value?.widgets.find(s=>s.wid===o.value)&&a.value?.widgets.length&&(o.value=a.value?.widgets[0]?.wid)}),e.onMounted(()=>{o.value=a.value?.widgets[0]?.wid}),(i,s)=>{const r=e.resolveComponent("UnioneContainer"),d=e.resolveComponent("a-tab-pane"),f=e.resolveComponent("a-tabs");return e.openBlock(),e.createBlock(ht,{class:e.normalizeClass(["unione-layout","unione-layout-tabs"]),wid:a.value.wid,engine:n.engine},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(f,e.mergeProps({key:0,activeKey:o.value,"onUpdate:activeKey":s[1]||(s[1]=c=>o.value=c)},a.value.props),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.widgets,c=>(e.openBlock(),e.createBlock(d,{class:"unione-layout-tab-pane",key:c.wid},{tab:e.withCtx(()=>[e.createElementVNode("span",null,[c.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.icon),{key:0})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(c.title),1)])]),default:e.withCtx(()=>[e.createVNode(r,{engine:t.engine,wid:c.wid,widget:c,formValue:l.value,"onUpdate:formValue":s[0]||(s[0]=h=>l.value=h)},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default",{},void 0,!0)]),_:2},1032,["engine","wid","widget","formValue"]),c.widgets.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fd,e.toDisplayString(c.emptyTips),1))]),_:2},1024))),128))]),_:3},16,["activeKey"])):e.createCommentVNode("",!0)]),_:3},8,["wid","engine"])}}}),[["__scopeId","data-v-d6fb1cbe"]]),Id={class:"title"},Md={class:"text"},Dd={key:0,class:"reactive"},Ud={key:1,class:"opts"},Ld={class:"warp"},jd=Z(e.defineComponent({name:"UnioneSection",__name:"section",props:e.mergeModels({title:{type:String,required:!1},icon:{type:String,required:!1},type:{type:String,required:!1},location:{type:String,default:"left"},reactive:{type:Boolean,default:!1},wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1}},{formValue:{type:Object,default:()=>{}},formValueModifiers:{},modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:formValue","update:modelValue"],setup(t){const n=t,l=e.useModel(t,"formValue"),o=e.computed(()=>n.engine?.widget(n.wid)||n.widget||{}),a=e.computed(()=>o.value?.title||n.title),i=e.computed(()=>o.value?.props?.icon||n.icon),s=e.computed(()=>o.value?.props?.type||n.type),r=e.computed(()=>o.value?.props?.bottomLine||!1),d=e.useModel(t,"modelValue");function f(){n.reactive&&(d.value=!d.value)}return(c,h)=>{const p=e.resolveComponent("UnioneContainer");return e.openBlock(),e.createBlock(ht,{class:e.normalizeClass(["unione-layout","unione-layout-section",d.value?"open":"close"]),model:n.engine?.model},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["head",t.location,t.reactive&&"reactive",r.value&&"bottom-line"]),onClick:f},[e.createElementVNode("div",Id,[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["type",s.value])},null,2)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:1,class:"icon"})):e.createCommentVNode("",!0),e.createElementVNode("span",Md,e.toDisplayString(a.value),1)]),t.reactive?(e.openBlock(),e.createElementBlock("div",Dd,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value?"UpOutlined":"DownOutlined")))])):e.createCommentVNode("",!0),t.location=="left"?(e.openBlock(),e.createElementBlock("div",Ud,[e.renderSlot(c.$slots,"opts",{},void 0,!0)])):e.createCommentVNode("",!0)],2),e.withDirectives(e.createElementVNode("div",Ld,[e.createVNode(p,{engine:t.engine,wid:o.value.wid,formValue:l.value,"onUpdate:formValue":h[0]||(h[0]=m=>l.value=m)},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default",{},void 0,!0)]),_:3},8,["engine","wid","formValue"])],512),[[e.vShow,d.value]])]),_:3},8,["class","model"])}}}),[["__scopeId","data-v-cedcc808"]]),Pd={class:"unione-props-setting unione-form-setting"},qd={class:"unione-form-btns"},zd={key:0},Qd=["onClick"],Hd={class:"field-txt"},Kd=["onClick"],Yd={key:1,class:"field-txt"},Wd=["onClick"],Gd={key:0,class:"field-txt"},Jd={key:3,class:"edit-field"},Xd={key:0},Zd=["onClick"],ec=Z(e.defineComponent({__name:"formSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(t){const n=t,l=e.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:v})=>v+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),o=e.computed(()=>{const v=n.editor.widget(n.wid)||{};return v.configs||(v.configs={}),v.configs.settings||(v.configs.settings={}),v.configs.settings.btns||(v.configs.settings.btns=[]),v}),a=e.computed(()=>(n.editor.dataModels()||[]).map(C=>({value:C.sn,label:C.title+"("+C.name+")"}))),i=e.computed(()=>{const v=o.value.configs.settings.btns,C=v.map(E=>E.name);if(!C.includes("save")){const E={title:"保存",type:"primary",index:0,visible:!0,name:"save"};v.splice(E.index,0,E)}if(!C.includes("submit")){const E={title:"提交",type:"primary",index:1,visible:!0,name:"submit"};let S=E.index||1;v.splice(S,0,E)}if(!C.includes("reset")){const E={title:"重置",type:"default",index:2,visible:!0,props:{danger:!0},name:"reset"};v.splice(E.index,0,E)}if(!C.includes("back")){const E={title:"返回",type:"default",index:3,visible:!0,name:"back"};v.splice(E.index,0,E)}return v}),s=e.ref(null);function r(v){s.value&&s.value.open(v,C=>{C.visible=!0,Object.keys(C).forEach(E=>{v[E]=C[E]}),o.value.configs.settings.btns.sort((E,S)=>{const A=E.index||1,O=S.index||1;return A-O}),o.value.configs.settings.btns=[...o.value.configs.btns]})}function d(){const v=o.value.configs.settings.btns.length+1;let C={title:"新增",name:"new_"+v,index:v,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};C.name="new_"+o.value.configs.settings.btns.length;const E=o.value.configs.settings.btns.filter(S=>S.name==C.name).length;E>0&&(C.name=C.name+E),o.value.configs.settings.btns.push(C),n.editor.widget(n.wid,o.value),s.value.open(C,S=>{Object.keys(S).forEach(A=>{C[A]=S[A]}),o.value.configs.btns=[...o.value.configs.btns]})}function f(v){const C=()=>{if(["save","submit","reset","back"].includes(v.name))v.visible=!1,o.value.configs.settings.btns=[...o.value.configs.settings.btns];else{const E=[];o.value.configs.settings.btns.forEach(S=>{S.name!=v.name&&E.push(S)}),o.value.configs.settings.btns=E}};te.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{C()}})}const c=e.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:v=>{const C=c.value.widgets.filter(E=>E.value==v);return C[0]?C[0].label:v},toSetting:()=>{}}),h=e.ref({visible:!1,field:{},props:{},showInfo:v=>{let C="";return v.rules&&(C=v.rules.filter(E=>E.enable).length||""),C&&(C="("+C+")"),C},toSetting:()=>{const v=h.value.props,C={name:"range",trigger:v.trigger,whitespace:v.whitespace,message:v.rangeMessage};v.rangeMin!=null&&v.rangeMin!=null&&(C.min=v.rangeMin,C.enable=!0),v.rangeMax!=null&&v.rangeMax!=null&&(C.max=v.rangeMax,C.enable=!0);const E={name:"reg",trigger:v.trigger,whitespace:v.whitespace,message:v.regMessage};v.regExpress&&(E.pattern=v.regExpress,E.enable=!0),h.value.field.rules=[C,E],h.value.visible=!1,h.value.props={},console.log("rule",h.value.field.rules)}});function p(v){h.value.visible=!0,h.value.field=v;const C=v.rules||[],E={trigger:"change",whitespace:!0};C.forEach(S=>{S.name=="reg"&&(E.trigger=S.trigger,E.whitespace=S.whitespace,E.regExpress=S.pattern,E.regMessage=S.message),S.name=="range"&&(E.rangeMin=S.min,E.rangeMax=S.max,E.rangeMessage=S.message)}),h.value.props=E}const m=e.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{m.value.visible=!1}});function x(v,C){const E=y.value.filter(A=>A.name==v.name);E.forEach(A=>{C!="isSort"?A[C]=!0:A[C]=!A[C]});const S=E[0];if(!(!S||C=="isSort")){switch(m.value.prop=C,m.value.field=v,S.show||(S.show={}),C){case"isQuery":S.show.query||(S.show.query={}),m.value.show=S.show.query,m.value.title=`查询设置/${v.title}(${v.name})`;break;case"isForm":S.show.form||(S.show.form={}),m.value.show=S.show.form,m.value.title=`表单设置/${v.title}(${v.name})`;break;case"isView":S.show.view||(S.show.view={}),m.value.show=S.show.view,m.value.title=`详情设置/${v.title}(${v.name})`;break;case"isList":S.show.list||(S.show.list={}),m.value.show=S.show.list,m.value.title=`列头设置/${v.title}(${v.name})`;break}m.value.visible=!0}}const b=e.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{b.value.convert.options||(b.value.convert.options=[]),b.value.convert.options.push({label:"",value:""})},toDelOption:(v,C)=>{b.value.convert.options.splice(v,1)},toSetting:()=>{b.value.visible=!1}});function g(v){b.value.visible=!0,b.value.field=v,b.value.convert=v.convert||{}}const u=e.computed(()=>n.editor?.dataModel(o.value.dataModel||"none")||{}),y=e.computed(()=>u.value.fields?.length?u.value.fields:[]),N={mounted:v=>v.focus()},k=e.ref({});function w(v,C){const E={};C=="convertName"?E[C]=v.convert?.type:E[C]=v[C]||"",k.value={},k.value[v.name]=E}function V(v,C){{k.value={};return}}function _(v,C){y.value.filter(S=>S.name==v.name).forEach(S=>{S[C]=!S[C]})}return(v,C)=>{const E=e.resolveComponent("a-divider"),S=e.resolveComponent("CloseOutlined"),A=e.resolveComponent("a-button"),O=e.resolveComponent("PlusOutlined"),T=e.resolveComponent("a-select"),B=e.resolveComponent("ToolOutlined"),$=e.resolveComponent("a-checkbox"),I=e.resolveComponent("a-table"),F=e.resolveComponent("a-select-option"),j=e.resolveComponent("a-form-item"),U=e.resolveComponent("a-form"),M=e.resolveComponent("a-modal"),Q=e.resolveComponent("a-checkbox-group"),D=e.resolveComponent("a-input-number"),R=e.resolveComponent("a-input"),J=e.resolveComponent("a-col"),q=e.resolveComponent("a-row");return e.openBlock(),e.createElementBlock("div",Pd,[e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[23]||(C[23]=[e.createTextVNode("按钮设置")])),_:1}),e.createElementVNode("div",qd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,L=>(e.openBlock(),e.createBlock(A,e.mergeProps({key:L.name,class:["btn",L.name,!L.visible&&"deleted"],type:L.visible?L.type:"default",size:L.size,ref_for:!0},L.props||{},{onClick:ee=>r(L)}),e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(L.title)+" ",1),L.visible?(e.openBlock(),e.createBlock(S,{key:0,class:"btn-del",onClick:e.withModifiers(ee=>f(L),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)]),_:2},[L.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(L.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),e.createVNode(A,{class:e.normalizeClass(["btn","btn-add"]),size:"small",onClick:C[0]||(C[0]=L=>d())},{default:e.withCtx(()=>[e.createVNode(O)]),_:1})]),e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[24]||(C[24]=[e.createTextVNode("表单设置")])),_:1}),C[36]||(C[36]=e.createTextVNode(" 数据模型:")),e.createVNode(T,{class:"data-model-list",options:a.value,value:o.value.dataModel,"onUpdate:value":C[1]||(C[1]=L=>o.value.dataModel=L)},null,8,["options","value"]),e.createVNode(I,{columns:l.value,"data-source":y.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:e.withCtx(({column:L})=>[["widget","rules","convertName"].includes(L.key)?(e.openBlock(),e.createElementBlock("span",zd,[e.createVNode(B),e.createTextVNode(" "+e.toDisplayString(L.title),1)])):e.createCommentVNode("",!0)]),bodyCell:e.withCtx(({column:L,text:ee,record:Y})=>[["rules"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["edit-field",!h.value.showInfo(Y)&&"empty"]),onClick:se=>p(Y)},[e.createElementVNode("span",Hd,e.toDisplayString(h.value.showInfo(Y)),1),h.value.showInfo(Y)?(e.openBlock(),e.createBlock(A,{key:0,type:"link"},{default:e.withCtx(()=>C[25]||(C[25]=[e.createTextVNode("设置")])),_:1})):e.createCommentVNode("",!0)],10,Qd)):["widget"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["edit-field",(!k.value[Y.name]||!Object.keys(k.value[Y.name]).includes(L.dataIndex))&&!ee&&"empty"]),onClick:se=>w(Y,L.dataIndex)},[k.value[Y.name]&&Object.keys(k.value[Y.name]).includes(L.dataIndex)?e.withDirectives((e.openBlock(),e.createBlock(T,{key:0,value:Y[L.dataIndex],"onUpdate:value":se=>Y[L.dataIndex]=se,options:c.value.widgets,onBlur:C[2]||(C[2]=se=>V())},null,8,["value","onUpdate:value","options"])),[[N]]):(e.openBlock(),e.createElementBlock("span",Yd,e.toDisplayString(c.value.widgetName(ee)),1))],10,Kd)):["convertName"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["edit-field",(!k.value[Y.name]||!Object.keys(k.value[Y.name]).includes(L.dataIndex))&&!Y.convert?.type&&"empty"]),onClick:se=>w(Y,L.dataIndex)},[k.value[Y.name]&&Object.keys(k.value[Y.name]).includes(L.dataIndex)?e.withDirectives((e.openBlock(),e.createBlock(T,{key:0,value:Y[L.dataIndex],"onUpdate:value":se=>Y[L.dataIndex]=se,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],onBlur:C[3]||(C[3]=se=>V())},null,8,["value","onUpdate:value"])),[[N]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[Y.convert?.type?(e.openBlock(),e.createElementBlock("span",Gd,e.toDisplayString(Y.convert.type=="dict"?"字典":"静态"),1)):e.createCommentVNode("",!0),Y.convert?.type?(e.openBlock(),e.createBlock(A,{key:1,type:"link",onClick:e.withModifiers(se=>g(Y),["stop"])},{default:e.withCtx(()=>C[26]||(C[26]=[e.createTextVNode("设置")])),_:2},1032,["onClick"])):e.createCommentVNode("",!0)],64))],10,Wd)):["isForm","isView"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",Jd,[e.createVNode($,{checked:Y[L.dataIndex],onClick:se=>_(Y,L.dataIndex)},null,8,["checked","onClick"]),e.createVNode(A,{type:"link",onClick:se=>x(Y,L.dataIndex)},{default:e.withCtx(()=>C[27]||(C[27]=[e.createTextVNode("设置")])),_:2},1032,["onClick"])])):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),e.createVNode(M,{visible:c.value.visible,"onUpdate:visible":C[5]||(C[5]=L=>c.value.visible=L),title:"控件设置",onOk:c.value.toSetting},{default:e.withCtx(()=>[e.createVNode(U,{model:c.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:e.withCtx(()=>[c.value.field.widget=="a-select"?(e.openBlock(),e.createBlock(j,{key:0,label:"下拉框类型"},{default:e.withCtx(()=>[e.createVNode(T,{value:c.value.props.mode,"onUpdate:value":C[4]||(C[4]=L=>c.value.props.mode=L),allowClear:!0},{default:e.withCtx(()=>[e.createVNode(F,{value:"multiple"},{default:e.withCtx(()=>C[28]||(C[28]=[e.createTextVNode("多选")])),_:1}),e.createVNode(F,{value:"tags"},{default:e.withCtx(()=>C[29]||(C[29]=[e.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),e.createVNode(M,{visible:h.value.visible,"onUpdate:visible":C[13]||(C[13]=L=>h.value.visible=L),title:"规则设置",onOk:h.value.toSetting},{default:e.withCtx(()=>[e.createVNode(U,{model:h.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:e.withCtx(()=>[e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[30]||(C[30]=[e.createTextVNode("基本设置")])),_:1}),e.createVNode(j,{label:"触发时机"},{default:e.withCtx(()=>[e.createVNode(Q,{value:h.value.props.trigger,"onUpdate:value":C[6]||(C[6]=L=>h.value.props.trigger=L),options:["change","blur"]},null,8,["value"])]),_:1}),h.value.field.isNull?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:e.withCtx(()=>[e.createVNode($,{value:h.value.props.whitespace,"onUpdate:value":C[7]||(C[7]=L=>h.value.props.whitespace=L),checked:h.value.props.whitespace},{default:e.withCtx(()=>C[31]||(C[31]=[e.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[32]||(C[32]=[e.createTextVNode("数值区间")])),_:1}),e.createVNode(j,{label:"有效区间"},{default:e.withCtx(()=>[e.createVNode(D,{value:h.value.props.rangeMin,"onUpdate:value":C[8]||(C[8]=L=>h.value.props.rangeMin=L)},null,8,["value"]),C[33]||(C[33]=e.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),e.createVNode(D,{value:h.value.props.rangeMax,"onUpdate:value":C[9]||(C[9]=L=>h.value.props.rangeMax=L)},null,8,["value"])]),_:1}),e.createVNode(j,{label:"错误提示"},{default:e.withCtx(()=>[e.createVNode(R,{value:h.value.props.rangeMessage,"onUpdate:value":C[10]||(C[10]=L=>h.value.props.rangeMessage=L)},null,8,["value"])]),_:1}),e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[34]||(C[34]=[e.createTextVNode("正则验证")])),_:1}),e.createVNode(j,{label:"表达式"},{default:e.withCtx(()=>[e.createVNode(R,{value:h.value.props.regExpress,"onUpdate:value":C[11]||(C[11]=L=>h.value.props.regExpress=L)},null,8,["value"])]),_:1}),e.createVNode(j,{label:"错误提示"},{default:e.withCtx(()=>[e.createVNode(R,{value:h.value.props.regMessage,"onUpdate:value":C[12]||(C[12]=L=>h.value.props.regMessage=L)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),e.createVNode(M,{visible:m.value.visible,"onUpdate:visible":C[20]||(C[20]=L=>m.value.visible=L),title:m.value.title,onOk:m.value.toSetting},{default:e.withCtx(()=>[e.createVNode(U,{model:m.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:e.withCtx(()=>[e.createVNode(j,{label:"显示顺序"},{default:e.withCtx(()=>[e.createVNode(D,{value:m.value.show.index,"onUpdate:value":C[14]||(C[14]=L=>m.value.show.index=L)},null,8,["value"])]),_:1}),["isQuery"].includes(m.value.prop)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j,{key:0,label:"显示宽度"},{default:e.withCtx(()=>[e.createVNode(R,{value:m.value.show.width,"onUpdate:value":C[15]||(C[15]=L=>m.value.show.width=L)},null,8,["value"])]),_:1})),["isForm","isView"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:1,label:"标题宽度"},{default:e.withCtx(()=>[e.createVNode(R,{value:m.value.show.labelWidth,"onUpdate:value":C[16]||(C[16]=L=>m.value.show.labelWidth=L)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["isForm","isView"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:2,label:"控件宽度"},{default:e.withCtx(()=>[e.createVNode(R,{value:m.value.show.valueWidth,"onUpdate:value":C[17]||(C[17]=L=>m.value.show.valueWidth=L)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:3,label:"固定位置"},{default:e.withCtx(()=>[e.createVNode(T,{value:m.value.show.fixed,"onUpdate:value":C[18]||(C[18]=L=>m.value.show.fixed=L),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:4,label:"对齐方式"},{default:e.withCtx(()=>[e.createVNode(T,{value:m.value.show.align,"onUpdate:value":C[19]||(C[19]=L=>m.value.show.align=L),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),e.createVNode(M,{visible:b.value.visible,"onUpdate:visible":C[22]||(C[22]=L=>b.value.visible=L),title:b.value.convert.type=="dict"?"字典设置":"选项设置",onOk:b.value.toSetting},{default:e.withCtx(()=>[b.value.convert.type!="dict"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createVNode(A,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:b.value.toAddOption},{default:e.withCtx(()=>C[35]||(C[35]=[e.createTextVNode("新增")])),_:1},8,["onClick"]),e.createVNode(I,{columns:b.value.optionColumn,"data-source":b.value.convert.options,size:"small"},{bodyCell:e.withCtx(({column:L,record:ee,index:Y})=>[L.dataIndex==="label"?(e.openBlock(),e.createBlock(R,{key:0,value:ee.label,"onUpdate:value":se=>ee.label=se,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0),L.dataIndex==="value"?(e.openBlock(),e.createBlock(R,{key:1,value:ee.value,"onUpdate:value":se=>ee.value=se,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0),L.dataIndex==="action"?(e.openBlock(),e.createElementBlock("a",{key:2,onClick:se=>b.value.toDelOption(Y,ee)},"删除",8,Zd)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):e.createCommentVNode("",!0),b.value.convert.type=="dict"?(e.openBlock(),e.createBlock(U,{key:1,model:b.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:e.withCtx(()=>[e.createVNode(q,{type:"flex",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(J,{span:24,order:1},{default:e.withCtx(()=>[e.createVNode(j,{label:"字典名称:"},{default:e.withCtx(()=>[e.createVNode(R,{value:b.value.convert.dict,"onUpdate:value":C[21]||(C[21]=L=>b.value.convert.dict=L)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):e.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),e.createVNode(dl,{ref_key:"btnSetting",ref:s},null,512)])}}}),[["__scopeId","data-v-c0f75bb9"]]),tc={key:0,class:"form-left"},nc={key:1,class:"form-warp"},lc={key:2,class:"form-right"},oc=Z(e.defineComponent({__name:"form",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},form:{type:Object,required:!1},model:{type:String}},emits:["onload"],setup(t,{expose:n,emit:l}){const o=t,a=l,i=e.ref(!1),s=e.ref(!1),r=e.ref(),d=e.ref({}),f=e.ref(null);e.onMounted(()=>{if(d.value||(d.value={}),o.engine?c.value=o.engine:c.value.loadConfig({widgets:p.value}),h.value.dsn){const A=c.value.dataManager();h.value.primary&&A.psn(h.value.dsn),f.value.setDisabled=v,f.value.getValue=N,f.value.setValue=k,f.value.reset=w,r.value=A.useForm(h.value.dsn,f.value,O=>{d.value=O.body||{},a("onload",d.value)})}o.form?.model&&c.value.setModel(o.form.model),V()});const c=e.ref(new Se),h=e.computed(()=>o.wid&&c.value.$widgetMap[o.wid]?c.value.$widgetMap[o.wid]:o.widget||o.form||{widgets:[]}),p=e.computed(()=>{let A=h.value.widgets||[];!A.length&&o.form?.fields&&(A=o.form.fields);const O=T=>{T.forEach(B=>{B.wid||(B.wid=en.uniqueId("w:")),B.name&&(B.widget||(B.widget="unione-form-item"),!B.control&&B.widget=="unione-form-item"&&(B.control="a-input")),B.widgets&&O(B.widgets)})};return O(A),A}),m=e.computed(()=>p.value.filter(A=>A.float=="left")),x=e.computed(()=>p.value.filter(A=>!A.float)),b=e.computed(()=>p.value.filter(A=>A.float=="right")),g=e.inject("pageSetting",{}),u=e.computed(()=>h.value.setting||o.form?.setting||g?.form||{}),y=e.computed(()=>{const A={};return u.value&&(A.labelAlign=u.value.labelAlign||"right",A.layout="horizontal",u.value.labelAlign=="top"&&(A.labelAlign="left",A.layout="vertical"),A.size=u.value.formSize||"default"),A});e.provide("formSetting",u.value),e.provide("formChanged",A=>{i.value=A});function N(){return d.value}function k(A){d.value=A||{},i.value=!0,V()}function w(){d.value={},i.value=!1,V(),c.value.ebus.$emit("form-reset")}function V(){const A=O=>{if(O.name&&(O.value||O.value==0)){if(O.event?.visible){let B=null;if(typeof O.event.visible=="function"?B=O.event.visible:O.event.visible.enable&&(B=new Function("value","ctx",O.event.visible.scriptText)),B&&!B(O.value,d.value))return}const T=P.utils.obj.getValue(d.value,O.name);(!T&&T!=0||T=="undefined")&&P.utils.obj.setValue(d.value,O.name,O.value)}O.widgets?.forEach(T=>{A(T)})};p.value.forEach(O=>{A(O)})}function _(){return new Promise((A,O)=>{f.value.validate().then(T=>{A(d.value)}).catch(T=>{O(T)})})}function v(A=!0){s.value=A,c.value.ebus.$emit("form-disabled",A)}function C(){return h.value.widgets||[]}function E(){return i.value}function S(){i.value=!1}return n({validate:_,getValue:N,setValue:k,reset:w,setDisabled:v,getWidgets:C,isChanged:E,recover:S}),(A,O)=>{const T=e.resolveComponent("UnioneContainer"),B=e.resolveComponent("a-form");return c.value?(e.openBlock(),e.createBlock(ht,{key:0,class:"unione-form-widget","setting-title":"表单设置",engine:c.value,model:t.model},e.createSlots({default:e.withCtx(()=>[e.createVNode(B,e.mergeProps({ref_key:"formObj",ref:f,model:d.value,class:["unione-form",c.value.model,"form-layout-col-"+(u.value.showColumn||1)]},y.value,{labelCol:{span:u.value.labelWidth||4},wrapperCol:{span:24-u.value.labelWidth||4}}),{default:e.withCtx(()=>[e.createVNode(T,{engine:c.value,wid:h.value.wid,disabled:s.value,formValue:d.value,"onUpdate:formValue":O[0]||(O[0]=$=>d.value=$),class:"form-widget-container"},{default:e.withCtx(()=>[m.value?.length&&d.value?(e.openBlock(),e.createElementBlock("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,$=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent($.widget),{key:$.name,widget:$,engine:c.value,disabled:s.value,formValue:d.value},null,8,["widget","engine","disabled","formValue"]))),128))])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("div",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,$=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent($.widget),e.mergeProps({key:$.name,widget:$,engine:c.value,disabled:s.value,formValue:d.value,ref_for:!0},$.props),null,16,["widget","engine","disabled","formValue"]))),128))])):e.createCommentVNode("",!0),b.value?.length&&d.value?(e.openBlock(),e.createElementBlock("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,$=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent($.widget),e.mergeProps({key:$.name,widget:$,engine:c.value,disabled:s.value,formValue:d.value,ref_for:!0},$.props),null,16,["widget","engine","disabled","formValue"]))),128))])):e.createCommentVNode("",!0)]),_:1},8,["engine","wid","disabled","formValue"])]),_:1},16,["model","class","labelCol","wrapperCol"])]),_:2},[t.engine&&h.value.wid?{name:"widget-setting",fn:e.withCtx(()=>[e.createVNode(ec,{wid:h.value.wid,editor:t.engine},null,8,["wid","editor"])]),key:"0"}:void 0]),1032,["engine","model"])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-6a03b5fc"]]);function za(t,n=!1){const l=Le();if(!t)return Promise.reject("字典名称不能为空");const o=localStorage.getItem("UNIONE-DICT-"+t);return o&&n==!1?Promise.resolve(JSON.parse(o)):(l.isDebug&&console.log("进入:加载字典数据方法,dict name:"+t+",force:"+n),new Promise((a,i)=>{P.axios.admin({url:"/api/base/dict/load/"+t}).then(s=>{if(s.success){const r=s.body.filter(d=>d.dictName!=d.dictKey);r.forEach(d=>{d.value=d.dictKey,d.label=d.dictValue}),r.length?(localStorage.setItem("UNIONE-DICT-"+t,JSON.stringify(r)),a(r)):i("字典加载失败,dict:"+t+",字典项列表为空")}else l.isDebug&&console.error("字典加载失败,dict:"+t,s),i("字典加载失败,dict:"+t+",error:"+s.message)})}))}async function Qa(t,n){const l=Le();if(n==null||n==null||n=="undefined"||!(n+"").length)return Promise.reject("字典key为空");const o=typeof n=="number"?[n+""]:n.split(","),a=await za(t),i=a.filter(s=>o.includes(s.dictKey));return i.length>0?Promise.resolve(i):(l.isDebug&&console.log("字典项匹配失败,name:"+t+",key:"+n+"options:",a),Promise.reject("字典项匹配失败,name:"+t+",key:"+n))}async function ac(t,n){const l=await Qa(t,n);return Promise.resolve(l.map(o=>o.dictValue).join(","))}const Ha={load:za,getLabel:ac,getOption:Qa};class lt{types;convertObj;config;options;constructor(n){this.config=Le(),(!n||!n.types)&&this.config.isDebug&&console.error("转换器定义不能为空,type不能为空",n),n.valueField||(n.valueField="id"),n.labelField||(n.labelField="title"),this.types=n.types,this.convertObj=n,this.options=n.options||[]}load(n,l=!1){return!(n==null||n==null||n=="undefined"||!(n+"").length)&&this.options?.length&&this.options.filter(o=>o.value==n).length?Promise.resolve(this.options):this.convertObj.types=="dict"?new Promise((o,a)=>{if(!this.convertObj.dictName)return this.config.isDebug&&console.error("字典名称不能为空,id:"+this.convertObj.id),a();Ha.load(this.convertObj.dictName,l).then(i=>{this.options=i,typeof n=="number"&&this.options.forEach(s=>{s.value=parseInt(s.value)}),o(this.options)})}):this.convertObj.types=="option"?(this.options=this.convertObj.options||[],this.convertObj.options?.length?Promise.resolve(this.convertObj.options):(this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id,this.convertObj),Promise.reject())):!this.convertObj.id&&this.convertObj.types!="local"?(this.config.isDebug&&console.error("转换器id不能为空,type:"+this.convertObj.types),Promise.reject()):new Promise((o,a)=>{const i={body:this.convertObj.params||{}};this.convertObj.pidField&&(i.pid=-1);const s=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;if(!s)return a("转换器url不能为空,type:"+this.convertObj.types+",id:"+this.convertObj.id);P.axios[this.convertObj.ctx||"admin"]({url:s,data:i,method:"POST"}).then(r=>{r.success?(this.options=r.body,this.$processOptions(this.options),typeof n=="number"&&this.options.forEach(d=>{d.value=parseInt(d.value)}),n==null||n==null||n=="undefined"||!(n+"").length?this.options.length?o(this.options):(this.config.isDebug&&console.error("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),a("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)):this.options.filter(f=>f.value==n).length?o(this.options):(i.body||(i.body={}),i.body[this.convertObj.valueField||"id"]=n,P.axios[this.convertObj.ctx||"admin"]({url:s,data:i,method:"POST"}).then(f=>{if(f.success){const c={};this.options.forEach(h=>{c[n]=!0}),f.body.forEach(h=>{c[h.value]||this.options.push(h)}),o(this.options)}else a("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)}))):(this.config.isDebug&&console.error("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),a("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",error:"+r.message))})})}convert(n){if(n==null||n==null||n=="undefined"||!(n+"").length)return Promise.reject("value为空");if(this.convertObj.types=="dict")return this.convertObj.dictName?Ha.getLabel(this.convertObj.dictName,n):Promise.reject("字典名称不能为空");const l=typeof n=="number"?[n]:n.split(",");if(this.convertObj.types=="option"){if(this.convertObj.options?.length){const o=this.convertObj.options.filter(a=>l.includes(a.value)).map(a=>a.label);return o.length?Promise.resolve(o.join(",")):(this.config.isDebug&&console.error("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+n,this.convertObj),Promise.reject())}return this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id),Promise.reject()}if(this.options?.length){const o=this.options.filter(a=>l.includes(a.value)).map(a=>a.label);if(o.length)return Promise.resolve(o.join(","))}return new Promise((o,a)=>{this.load(n).then(i=>{const s=i.filter(r=>l.includes(r.value)).map(r=>r.label);if(s.length)return Promise.resolve(s.join(","));a()})})}children(n=-1){return this.config.isDebug&&console.log("进入:加载下级数据项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",pid:"+n),this.convertObj.pidField?this.convertObj.types=="dict"||this.convertObj.types=="option"?(this.config.isDebug&&console.error("字典/静态转换器不支持该方法,type:"+this.convertObj.types+",id:"+this.convertObj.id),Promise.reject()):new Promise((o,a)=>{const i=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;P.axios[this.convertObj.ctx||"admin"]({url:i,data:n,method:"POST"}).then(s=>{s.success?(this.$processOptions(s.body),this.options=[...this.options,...s.body],o(s.body)):(this.config.isDebug&&console.error("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+n,s),a())})}):(this.config.isDebug&&console.error("转换器未设置parentField,id:"+this.convertObj.id),Promise.reject())}search(n){if(this.config.isDebug&&console.log("进入:搜索数据选项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",keywords:"+n),this.convertObj.types=="dict"||this.convertObj.types=="option")return Promise.resolve(this.options.filter(o=>o.label.indexOf(n)>=0));const l={...this.convertObj.params||{}};return new Promise(o=>{const a=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;P.axios[this.convertObj.ctx||"admin"]({url:a,data:{body:{...l},keywords:n},method:"POST"}).then(i=>{i.success?(this.$processOptions(i.body),o(i.body)):o([])})})}$processOptions(n){return this.convertObj.types=="local"&&!this.convertObj.process&&n.forEach(l=>{this.convertObj.idField&&(l.id=l[this.convertObj.idField]),this.convertObj.pidField&&(l.pid=l[this.convertObj.pidField]),l.value=l[this.convertObj.valueField||"id"],l.label=l[this.convertObj.labelField||"title"]}),this.convertObj.process?this.convertObj.process(n):n}}const io=[{name:"number",title:"数字",express:String.raw`/^\d+$/`,error:"请输入正确的数字"},{name:"money",title:"金额",express:String.raw`/^([1-9][\d]*|0)(\.[\d]+)?$/`,error:"请输入正确的金额"},{name:"tel",title:"手机号",express:String.raw`/^1[3456789]\d{9}$/`,error:"请输入正确的手机号码"},{name:"phone",title:"手机/电话",express:String.raw`/^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/`,error:"请输入正确的联系方式"},{name:"email",title:"邮箱",express:String.raw`/^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/`,error:"请输入正确的邮箱"},{name:"idcard",title:"身份证号码",express:String.raw`/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/`,error:"请输入正确的身份证号码"}];function Ka(){const t=Le();if(t.formRules?.length){const n={};io.forEach(o=>{n[o.name]=o});const l=[...io];return t.formRules.forEach(o=>{const a=n[o.name];a?Object.assign(a,o):l.push(a)}),l}return io}const Ya={loadAdvances:Ka},ic=["innerHTML"],rc={key:2,class:"text-view"},sc=Z(e.defineComponent({__name:"formItem",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object,required:!0},disabled:{type:Boolean,defualt:!1},allowClear:{type:Boolean,default:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(t){const n=t,l=e.useModel(t,"value"),o=e.computed(()=>s.value.showFormat?s.value.showFormat.call(this,l.value,{label:w.value,form:n.formValue}):w.value||l.value),a=e.inject("formSetting"),i=e.inject("formChanged");e.onMounted(()=>{const V=P.utils.obj.getValue(n.formValue,r.value.name);V!=null&&typeof V<"u"&&V!=""&&(l.value=V),b.value=Ka()});const s=e.ref({}),r=e.computed(()=>{const V=n.engine?.widget(n.wid)||n.widget||{};return V.event&&Object.keys(V.event).forEach(_=>{const v=V.event[_];v&&(s.value[_]=null,typeof v=="function"?s.value[_]=v:v.enable&&v.scriptText&&(s.value[_]=new Function("value","ctx",v.scriptText)))}),V});e.watch(()=>P.utils.obj.getValue(n.formValue,r.value.name),(V,_)=>{V!=_&&(l.value=V)});const d=e.computed(()=>s.value.disabled?s.value.disabled(l.value,n.formValue):n.disabled),f=e.computed(()=>!(s.value.visible&&s.value.visible(l.value,n.formValue)==!1||r.value.view?.visible=="1")),c=e.computed(()=>{if(r.value.view?.hideLabel=="0")return"";if(s.value.title)return s.value.title(l.value,n.formValue)||r.value.title;if(n.engine&&r.value.name){let V=null,_=n.engine.widget(r.value.pid||"-1");for(;_;){if(_.dsn){V=_.dsn;break}if(!_.pid)break;_=n.engine.widget(_.pid)}if(V&&n.engine.dataModels){const v=n.engine.dataModels.find(C=>C.dsn===V);if(v){const C=v.fields.filter(E=>E.name==r.value.name)[0];if(C&&C.title)return r.value.title=C.title,C.title}}else if(n.engine.dataModels){const v=n.engine.dataModels[0];if(v){const C=v.fields.filter(E=>E.name==r.value.name)[0];if(C&&C.title)return r.value.title=C.title,C.title}}}return r.value.title});function h(){s.value.blur&&s.value.blur(l.value,n.formValue)}function p(V){r.value.name&&(P.utils.obj.setValue(n.formValue,r.value.name,l.value),m(V))}const m=be(()=>{if(i&&i(!0),s.value.change){s.value.change(l.value,n.formValue);return}r.value.change&&r.value.change(l.value,n.formValue)}),x=e.computed(()=>{let V=r.value.props?.required;if(s.value.required)try{V=s.value.required(l.value,n.formValue)}catch(_){console.error("form item required event error:",_)}return!!V}),b=e.ref({}),g=e.computed(()=>{const V=[],_=r.value.rule||{};if(x.value&&V.push({required:!0,whitespace:_?.whitespace||!1,trigger:_?.trigger||a?.ruleTrigger||"change",validator:(v,C)=>(_?.whitespace&&C&&typeof C=="string"&&(C=C.trim()),C!=null&&C!=null&&(C+"").replace(/\s+/g,"").length>0?Promise.resolve():Promise.reject(c.value+"不能为空!"))}),_.advance&&b.value[_.advance]){const v=b.value[_.advance];V.push({pattern:v.pattern,message:v.message||"表单验证不通过!",trigger:_.trigger||a?.ruleTrigger||"change"})}return _.regExpress&&V.push({pattern:_.regExpress,message:_.regMessage||"表单验证不通过!",trigger:_.trigger||a?.ruleTrigger||"change"}),r.value.dataLen&&V.push({validator:(v,C)=>C&&(C+"").length>r.value.dataLen?Promise.reject("最大长度["+r.value.dataLen+"],当前:["+(C+"").length+"]"):Promise.resolve(),trigger:_?.trigger||a?.ruleTrigger||"change"}),V}),u=e.computed(()=>{const V=r.value.props||{};if(r.value.control=="a-input-number"){const v=r.value.rule||{};v.rangeMin!=null&&v.rangeMin!=null&&(V.min=v.rangeMin),v.rangeMax!=null&&v.rangeMax!=null&&(V.max=v.rangeMax)}r.value.control=="a-date-picker"&&r.value.view?.dataFormat&&(V.format=r.value.view.dataFormat,V.valueFormat=r.value.view.dataFormat),r.value.required&&(V.required=r.value.required);const _={...V};return delete _.prefix,delete _.suffix,_}),y=e.computed(()=>{const V=r.value.css||{},_=["form-item-"+r.value.name];return V.cssName&&_.push(V.cssName),a?.platform=="app"?V.cssName?typeof V.cssName=="string"&&V.cssName.indexOf("all-line")<0&&_.push("all-line"):_.push("all-line"):r.value.view?.width&&(r.value.view.width>=3?(!V.cssName||typeof V.cssName=="string"&&V.cssName.indexOf("all-line")<0)&&_.push("all-line"):r.value.view.width==2&&_.push("2in-line")),_}),N=e.computed(()=>{let V=r.value.view?.labelWidth;return V?{span:V}:null}),k=e.computed(()=>({span:24-N.value?.span||0})),w=e.ref();return e.watch(l,()=>{(l.value||l.value==0)&&n.engine?.model=="view"&&r.value.convert&&new lt(r.value.convert).convert(l.value+"").then(V=>{w.value=V})}),(V,_)=>{const v=e.resolveComponent("a-form-item");return e.openBlock(),e.createBlock(ht,{class:e.normalizeClass(["unione-form-item",y.value]),style:e.normalizeStyle(r.value.css?.cssText),wid:r.value.wid,engine:n.engine},{default:e.withCtx(()=>[f.value?(e.openBlock(),e.createBlock(v,{key:0,label:c.value,name:r.value.name,labelCol:N.value,wrapperCol:k.value,required:x.value,rules:g.value,help:(!n.engine||n.engine.model.value!="view")&&r.value.props?.help,tooltip:r.value.props?.tooltip,class:e.normalizeClass([r.value.view?.gridWidth&&"ant-col-"+r.value.view?.gridWidth])},{default:e.withCtx(()=>[!n.engine||r.value.view=="self"||n.engine.model!="view"&&r.value.view!="html"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.control||r.value.widget||"a-input"),e.mergeProps({key:0,wid:r.value.wid,widget:r.value,engine:n.engine,disabled:d.value,allowClear:t.allowClear,onChange:p,onBlur:h,value:l.value,"onUpdate:value":_[0]||(_[0]=C=>l.value=C),formValue:t.formValue},u.value,{style:{width:r.value.view?.valueWidth,...r.value.css?.props}}),e.createSlots({_:2},[r.value.props?.prefix?{name:"prefix",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.props?.prefix)))]),key:"0"}:void 0,r.value.props?.suffix?{name:"suffix",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.props?.suffix)))]),key:"1"}:void 0]),1040,["wid","widget","engine","disabled","allowClear","value","formValue","style"])):r.value.view=="html"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"text-view text-html",innerHTML:o.value},null,8,ic)):(e.openBlock(),e.createElementBlock("div",rc,e.toDisplayString(o.value),1)),e.renderSlot(V.$slots,"default",{},void 0,!0)]),_:3},8,["label","name","labelCol","wrapperCol","required","rules","help","tooltip","class"])):e.createCommentVNode("",!0)]),_:3},8,["class","style","wid","engine"])}}}),[["__scopeId","data-v-800ee59e"]]),dc=Z(e.defineComponent({__name:"selectBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},mode:{type:String,default:"combobox"},valueType:{type:String,default:"string"}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=Le(),o=n,a=t,i=e.ref(),s=e.useModel(t,"value"),r=e.ref([]),d=e.computed(()=>r.value?.length?r.value:a.options?.length?a.options:[]),f=e.computed(()=>{const N=g.value.convert||a.convert||{};if(N.refValue){const k={};return N.refValue.split(",").forEach(V=>{const _=V.split("=");_.length==1?k[_[0]]=P.utils.obj.getValue(a.formValue,_[0]):k[_[0]]=P.utils.obj.getValue(a.formValue,_[1])}),k}return{}}),c=e.computed(()=>(g.value.convert||a.convert||{}).search||!1),h=be(N=>{const k=g.value.convert||a.convert||{};k.params={...x.value,...f.value},u.value.search(N).then(w=>{l.isDebug&&console.log(g.value.name+" search ",N,w),e.nextTick(()=>{r.value=[...w]})})},500);function p(N,k){b.value.select&&b.value.select(N,{option:k,formValue:a.formValue})}function m(){y()}const x=e.ref();e.onMounted(()=>{const N=g.value.convert||a.convert||{};x.value=N.params||{},N.params={...x.value,...f.value},a.mode=="multiple"&&typeof s.value=="string"&&(i.value=s.value.split(",")),u.value.load(s.value).then(k=>{r.value=k})});const b=e.ref({}),g=e.computed(()=>{const N=a.engine?.widget(a.wid)||a.widget||{};return N.event&&Object.keys(N.event).forEach(k=>{const w=N.event[k];w&&(b.value[k]=null,typeof w=="function"?b.value[k]=w:w.enable&&w.scriptText&&(b.value[k]=new Function("value","ctx",w.scriptText)))}),N}),u=e.computed(()=>{const N=g.value.convert||a.convert||{};return new lt(N)});e.watch(()=>g.value.convert||a.convert||{},be(()=>{l.isDebug&&console.log(g.value.name+" convert changed",s.value),a.engine?.model=="edit"&&u.value.load().then(N=>{r.value=N})}),{deep:!0}),e.watch(s,be(()=>{s.value!=null&&s.value!==""&&s.value!==void 0&&(s.value+"").length>0&&(a.mode=="multiple"&&typeof s.value=="string"?i.value=s.value.split(","):(i.value=s.value,r.value[0]&&(typeof r.value[0].value=="number"?i.value=Number(i.value):typeof r.value[0].value=="string"&&(i.value=String(i.value)))),u.value.types!="dict"&&u.value.types!="option"&&(r.value.find(k=>k.value===s.value)||(l.isDebug&&console.log(g.value.name+" model value changed",s.value),u.value.load(s.value).then(k=>{r.value=k}))))},200)),e.watch(()=>f.value,be(()=>{if(l.isDebug&&console.log(g.value.name+" ref value changed",f.value),f.value&&u.value.types!="dict"&&u.value.types!="option"){const N=g.value.convert||a.convert||{};N.params={...x.value,...f.value},r.value.find(w=>w.value===s.value)||u.value.load(s.value,!0).then(w=>{r.value=w})}},200),{deep:!0}),e.watch(i,y);function y(){Array.isArray(i.value)&&a.valueType=="string"?s.value=i.value.join(","):s.value=i.value,o("change",s.value)}return(N,k)=>{const w=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(w,{class:"unione-form-select",options:d.value,showSearch:c.value,mode:t.mode,filterOption:!u.value?.search,value:i.value,"onUpdate:value":k[0]||(k[0]=V=>i.value=V),onSearch:e.unref(h),onSelect:p,onChange:m},null,8,["options","showSearch","mode","filterOption","value","onSearch"])}}}),[["__scopeId","data-v-a72e89d0"]]),cc=Z(e.defineComponent({__name:"switchBox",props:e.mergeModels({engine:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=n,o=t,a=e.useModel(t,"value");function i(h){l("change",h)}const s=e.ref({});e.onMounted(()=>{f.value.load(a.value).then(h=>{c(h)})});const r=e.ref({}),d=e.computed(()=>{const h=o.widget||{};return h.event&&Object.keys(h.event).forEach(p=>{const m=h.event[p];m&&(r.value[p]=null,typeof m=="function"?r.value[p]=m:m.enable&&m.scriptText&&(r.value[p]=new Function("value","ctx",m.scriptText)))}),h}),f=e.computed(()=>{const h=d.value.convert||o.convert||{};return new lt(h)});function c(h){h.forEach(p=>{p.value&&(p.value===!0||p.value=="1"||p.value=="true"||p.value=="TRUE")?(s.value.checkedChildren=p.label,p.value===!0||p.value=="true"||p.value=="TRUE"?s.value.checkedValue=!0:s.value.checkedValue=Number.isNaN(p.value)?p.value:Number(p.value)):(s.value.unCheckedChildren=p.label,p.value===!1||p.value=="false"||p.value=="FALSE"?s.value.unCheckedValue=!1:s.value.unCheckedValue=Number.isNaN(p.value)?p.value:Number(p.value))})}return e.watch(()=>d.value.convert||o.convert||{},be(()=>{f.value.load().then(h=>{c(h)})}),{deep:!0}),(h,p)=>{const m=e.resolveComponent("a-switch");return e.openBlock(),e.createBlock(m,e.mergeProps({class:"unione-form-switch"},s.value,{checked:a.value,"onUpdate:checked":p[0]||(p[0]=x=>a.value=x),onChange:i}),null,16,["checked"])}}}),[["__scopeId","data-v-e4555df5"]]),uc=Z(e.defineComponent({__name:"radioBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},layout:{type:String,default:"horizontal"}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(t){const n=t,l=e.useModel(t,"value"),o=e.ref([]),a=e.computed(()=>o.value?.length?o.value:n.options?.length?n.options:[]),i=e.computed(()=>{const h=d.value.convert||n.convert||{};if(h.refValue){const p={};return h.refValue.split(",").forEach(x=>{const b=x.split("=");b.length==1?p[b[0]]=P.utils.obj.getValue(n.formValue,b[0]):p[b[0]]=P.utils.obj.getValue(n.formValue,b[1])}),console.log(d.value.name+" ref field:"+h.refValue+",ref value",p),p}return{}}),s=e.ref();e.onMounted(()=>{const h=d.value.convert||n.convert||{};s.value=h.params||{},h.params={...s.value,...i.value},f.value.load(l.value||d.value.value).then(p=>{o.value=p})});const r=e.ref({}),d=e.computed(()=>{const h=n.engine?.widget(n.wid)||n.widget||{};return h.event&&Object.keys(h.event).forEach(p=>{const m=h.event[p];m&&(r.value[p]=null,typeof m=="function"?r.value[p]=m:m.enable&&m.scriptText&&(r.value[p]=new Function("value","ctx",m.scriptText)))}),h}),f=e.computed(()=>{const h=d.value.convert||n.convert||{};return new lt(h)});e.watch(()=>d.value.convert||n.convert||{},be(()=>{f.value.load().then(h=>{o.value=h})}),{deep:!0}),e.watch(()=>i.value,()=>{if(console.log(d.value.name+" ref value changed",i.value),i.value){const h=d.value.convert||n.convert||{};h.params={...s.value,...i.value},f.value.load(void 0,!0).then(p=>{o.value=p})}},{deep:!0});function c(h){r.value?.select&&r.value.select(h.value,{option:h,formValue:n.formValue})}return(h,p)=>{const m=e.resolveComponent("QuestionCircleOutlined"),x=e.resolveComponent("a-tooltip"),b=e.resolveComponent("a-radio"),g=e.resolveComponent("a-radio-group");return e.openBlock(),e.createBlock(g,{class:e.normalizeClass(["unione-form-radio",t.layout]),value:l.value,"onUpdate:value":p[0]||(p[0]=u=>l.value=u)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,u=>(e.openBlock(),e.createBlock(b,{key:u.value,value:u.value,onClick:y=>c(u)},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(u.label),1),u.help?(e.openBlock(),e.createBlock(x,{key:0,title:u.help},{default:e.withCtx(()=>[e.createVNode(m,{class:"icon"})]),_:2},1032,["title"])):e.createCommentVNode("",!0)]),_:2},1032,["value","onClick"]))),128))]),_:1},8,["class","value"])}}}),[["__scopeId","data-v-747bb329"]]),pc=Z(e.defineComponent({__name:"checkBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},returnType:{type:String,default:"string"},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},layout:{type:String,default:"horizontal"}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=t,o=e.useModel(t,"value"),a=e.ref(),i=e.ref([]),s=e.computed(()=>{const x=c.value.convert||l.convert||{};return x.types=="option"?x.options||[]:i.value?.length?i.value:l.options?.length?l.options:[]}),r=e.computed(()=>{const x=c.value.convert||l.convert||{};if(x.refValue){const b={};return x.refValue.split(",").forEach(u=>{const y=u.split("=");y.length==1?b[y[0]]=P.utils.obj.getValue(l.formValue,y[0]):b[y[0]]=P.utils.obj.getValue(l.formValue,y[1])}),console.log(c.value.name+" ref field:"+x.refValue+",ref value",b),b}return{}}),d=e.ref();e.onMounted(()=>{const x=o.value||c.value.value||"";l.returnType==="string"?a.value=x.split(","):a.value=x;const b=c.value.convert||l.convert||{};d.value=b.params||{},b.params={...d.value,...r.value},m.value.load().then(g=>{i.value=g})});const f=e.ref({}),c=e.computed(()=>{const x=l.engine?.widget(l.wid)||l.widget||{};return x.event&&Object.keys(x.event).forEach(b=>{const g=x.event[b];f.value[b]=null,g.enable&&g.scriptText&&(f.value[b]=new Function("value","ctx",g.scriptText))}),x}),h=n;function p(x){l.returnType==="string"?o.value=x.join(","):o.value=x,console.log("checkbox changed",o.value),h("change",o.value)}const m=e.computed(()=>{const x=c.value.convert||l.convert||{};return new lt(x)});return e.watch(()=>c.value.convert||l.convert||{},be(()=>{m.value.load().then(x=>{i.value=x})}),{deep:!0}),e.watch(()=>o.value,()=>{a.value=Array.isArray(o.value)?o.value:[],o.value&&!Array.isArray(o.value)&&(a.value=o.value.split(","))}),e.watch(()=>r.value,()=>{if(console.log(c.value.name+" ref value changed",r.value),r.value){a.value=[],l.returnType==="string"?o.value="":o.value=[];const x=c.value.convert||l.convert||{};x.params={...d.value,...r.value},m.value.load(void 0,!0).then(b=>{i.value=b})}},{deep:!0}),(x,b)=>{const g=e.resolveComponent("QuestionCircleOutlined"),u=e.resolveComponent("a-tooltip"),y=e.resolveComponent("a-checkbox-group");return e.openBlock(),e.createBlock(y,{class:e.normalizeClass(["unione-form-checkbox",t.layout]),options:s.value,value:a.value,"onUpdate:value":b[0]||(b[0]=N=>a.value=N),onChange:p},{label:e.withCtx(N=>[e.createElementVNode("span",null,e.toDisplayString(N.label),1),N.help?(e.openBlock(),e.createBlock(u,{key:0,title:N.help},{default:e.withCtx(()=>[e.createVNode(g,{class:"icon"})]),_:2},1032,["title"])):e.createCommentVNode("",!0)]),_:1},8,["class","options","value"])}}}),[["__scopeId","data-v-676fca1e"]]),fc=Z(e.defineComponent({__name:"checkSwitch",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},model:{type:Object,default(){return{checked:!0,unchecked:!1}}},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},layout:{type:String,default:"horizontal"}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=t,o=e.useModel(t,"value"),a=e.ref([]),i=e.computed(()=>{const m=d.value.convert||l.convert||{};return m.types=="option"?m.options||[]:a.value?.length?a.value:l.options?.length?l.options:[]}),s=e.computed(()=>{const m=d.value.convert||l.convert||{};if(m.refValue){const x={};return m.refValue.split(",").forEach(g=>{const u=g.split("=");u.length==1?x[u[0]]=P.utils.obj.getValue(l.formValue,u[0]):x[u[0]]=P.utils.obj.getValue(l.formValue,u[1])}),console.log(d.value.name+" ref field:"+m.refValue+",ref value",x),x}return{}}),r=e.ref();e.onMounted(()=>{o.value||(o.value={},f("change",o.value));const m=d.value.convert||l.convert||{};r.value=m.params||{},m.params={...r.value,...s.value},p.value.load().then(x=>{a.value=x})});const d=e.computed(()=>l.engine?.widget(l.wid)||l.widget||{}),f=n;function c(m){d.value.name=="this"&&l.formValue?l.formValue[m.value]==l.model.checked?l.formValue[m.value]=l.model.unchecked:l.formValue[m.value]=l.model.checked:(o.value||(o.value={}),o.value[m.value]==l.model.checked?o.value[m.value]=l.model.unchecked:o.value[m.value]=l.model.checked,f("change",o.value))}function h(m){return d.value.name=="this"&&l.formValue?l.formValue[m.value]==l.model.checked:(o.value||(o.value={}),o.value&&o.value[m.value]==l.model.checked)}const p=e.computed(()=>{const m=d.value.convert||l.convert||{};return new lt(m)});return e.watch(()=>d.value.convert||l.convert||{},be(()=>{p.value.load().then(m=>{a.value=m})}),{deep:!0}),e.watch(()=>s.value,()=>{if(s.value){const m=d.value.convert||l.convert||{};m.params={...r.value,...s.value},p.value.load(void 0,!0).then(x=>{a.value=x})}},{deep:!0}),(m,x)=>{const b=e.resolveComponent("QuestionCircleOutlined"),g=e.resolveComponent("a-tooltip"),u=e.resolveComponent("a-checkbox");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["unione-check-switch",t.layout])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,y=>(e.openBlock(),e.createBlock(u,{key:y.value,checked:h(y),onChange:N=>c(y)},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(y.label),1),y.help?(e.openBlock(),e.createBlock(g,{key:0,title:y.help},{default:e.withCtx(()=>[e.createVNode(b,{class:"icon"})]),_:2},1032,["title"])):e.createCommentVNode("",!0)]),_:2},1032,["checked","onChange"]))),128))],2)}}}),[["__scopeId","data-v-3e89bc45"]]),mc=Z(e.defineComponent({__name:"pwdBox",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(t){const n=e.ref(),l=e.useModel(t,"value");return e.watch(()=>n.value,()=>{n.value?l.value=P.utils.sm2Encrypt(n.value):l.value=""}),(o,a)=>{const i=e.resolveComponent("a-input-password");return e.openBlock(),e.createBlock(i,{class:"unione-form-password",value:n.value,"onUpdate:value":a[0]||(a[0]=s=>n.value=s)},null,8,["value"])}}}),[["__scopeId","data-v-4515a2af"]]),gc=Z(e.defineComponent({__name:"randomInput",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},len:{type:Number,default:10},disabled:{type:Boolean,defualt:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(t){const n=t,l=e.useModel(t,"value");function o(){n.disabled||(l.value=Pa(n.len))}return e.onMounted(()=>{e.nextTick(()=>{(!l.value||typeof l.value>"u")&&(n.disabled||o())}),n.engine?.ebus.$on("form-reset",()=>{n.disabled||o()})}),(a,i)=>{const s=e.resolveComponent("SyncOutlined"),r=e.resolveComponent("a-input");return e.openBlock(),e.createBlock(r,{class:"unione-form-random-input",value:l.value,"onUpdate:value":i[0]||(i[0]=d=>l.value=d),disabled:t.disabled},{suffix:e.withCtx(()=>[e.createVNode(s,{style:{color:"rgba(0, 0, 0, 0.45)"},onClick:o})]),_:1},8,["value","disabled"])}}}),[["__scopeId","data-v-f2fb0f2e"]]),hc=["disabled"],bc=Z(e.defineComponent({__name:"uploadBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},listType:{type:String,default:"text"},formValue:{type:Object},btnLabel:{type:String,default:"上传文件"},valueType:{type:String,default:"array"},autoUpload:{type:Boolean,default:!1},beforeUpload:{type:Function,required:!1},disabled:{type:Boolean,default:!1}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=t,o=n,a=e.useModel(t,"value"),i=e.ref([]);e.watch(a,()=>{i.value=[],a.value&&(Array.isArray(a.value)?i.value=a.value:(a.value.startsWith("[")&&a.value.endsWith("]")||a.value.startsWith("{")&&a.value.endsWith("}"))&&(i.value=JSON.parse(a.value)))});function s(d){return l.beforeUpload?l.beforeUpload(d):l.autoUpload}function r({fileList:d}){l.valueType=="array"?(a.value=d,o("change",d)):(a.value=JSON.stringify(d),o("change",JSON.stringify(d)))}return(d,f)=>{const c=e.resolveComponent("upload-outlined"),h=e.resolveComponent("a-button"),p=e.resolveComponent("plus-outlined"),m=e.resolveComponent("a-upload");return e.openBlock(),e.createBlock(m,{class:"unione-form-upload-box","file-list":i.value,"onUpdate:fileList":f[0]||(f[0]=x=>i.value=x),disabled:t.disabled||t.engine?.model=="view",beforeUpload:s,"list-type":t.listType,onChange:r},{default:e.withCtx(()=>[(!t.disabled||t.engine?.model!="view")&&t.listType=="text"?(e.openBlock(),e.createBlock(h,{key:0,disabled:t.disabled},{default:e.withCtx(()=>[e.createVNode(c),e.createTextVNode(" "+e.toDisplayString(t.btnLabel),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(!t.disabled||t.engine?.model!="view")&&t.listType!="text"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"btn-upload-pic",disabled:t.disabled},[e.createVNode(p),f[1]||(f[1]=e.createElementVNode("span",{class:"text"},"Upload",-1))],8,hc)):e.createCommentVNode("",!0)]),_:1},8,["file-list","disabled","list-type"])}}}),[["__scopeId","data-v-c4b004a7"]]),ro=[{title:"线框风格",name:"Outlined",groups:[{title:"通用图标",icons:["AccountBookOutlined","AimOutlined","AlertOutlined","ApartmentOutlined","ApiOutlined","AppstoreAddOutlined","AppstoreOutlined","AudioOutlined","AudioMutedOutlined","AuditOutlined","BankOutlined","BarcodeOutlined","BarsOutlined","BellOutlined","BlockOutlined","BookOutlined","BorderOutlined","BorderlessTableOutlined","BranchesOutlined","BugOutlined","BuildOutlined","BulbOutlined","CalculatorOutlined","CalendarOutlined","CameraOutlined","CarOutlined","CarryOutOutlined","CiCircleOutlined","CiOutlined","ClearOutlined","CloudDownloadOutlined","CloudOutlined","CloudServerOutlined","CloudSyncOutlined","CloudUploadOutlined","ClusterOutlined","CodeOutlined","CoffeeOutlined","CommentOutlined","CompassOutlined","CompressOutlined","ConsoleSqlOutlined","ContactsOutlined","ContainerOutlined","ControlOutlined","CopyrightCircleOutlined","CopyrightOutlined","CreditCardOutlined","CrownOutlined","CustomerServiceOutlined","DashboardOutlined","DatabaseOutlined","DeleteColumnOutlined","DeleteRowOutlined","DeliveredProcedureOutlined","DeploymentUnitOutlined","DesktopOutlined","DingtalkOutlined","DisconnectOutlined","DislikeOutlined","DollarCircleOutlined","DollarOutlined","DownloadOutlined","EllipsisOutlined","EnvironmentOutlined","EuroCircleOutlined","EuroOutlined","ExceptionOutlined","ExpandAltOutlined","ExpandOutlined","ExperimentOutlined","ExportOutlined","EyeOutlined","EyeInvisibleOutlined","FieldBinaryOutlined","FieldNumberOutlined","FieldStringOutlined","FieldTimeOutlined","FileAddOutlined","FileDoneOutlined","FileExcelOutlined","FileExclamationOutlined","FileOutlined","FileGifOutlined","FileImageOutlined","FileJpgOutlined","FileMarkdownOutlined","FilePdfOutlined","FilePptOutlined","FileProtectOutlined","FileSearchOutlined","FileSyncOutlined","FileTextOutlined","FileUnknownOutlined","FileWordOutlined","FileZipOutlined","FilterOutlined","FireOutlined","FlagOutlined","FolderAddOutlined","FolderOutlined","FolderOpenOutlined","FolderViewOutlined","ForkOutlined","FormatPainterOutlined","FrownOutlined","FunctionOutlined","FundProjectionScreenOutlined","FundViewOutlined","FunnelPlotOutlined","GatewayOutlined","GifOutlined","GiftOutlined","GlobalOutlined","GoldOutlined","GroupOutlined","HddOutlined","HeartOutlined","HistoryOutlined","HolderOutlined","HomeOutlined","HourglassOutlined","IdcardOutlined","ImportOutlined","InboxOutlined","InsertRowAboveOutlined","InsertRowBelowOutlined","InsertRowLeftOutlined","InsertRowRightOutlined","InsuranceOutlined","InteractionOutlined","KeyOutlined","LaptopOutlined","LayoutOutlined","LikeOutlined","LineOutlined","LinkOutlined","Loading3QuartersOutlined","LoadingOutlined","LockOutlined","MacCommandOutlined","MailOutlined","ManOutlined","MedicineBoxOutlined","MehOutlined","MenuOutlined","MergeCellsOutlined","MessageOutlined","MobileOutlined","MoneyCollectOutlined","MonitorOutlined","MoreOutlined","NodeCollapseOutlined","NodeExpandOutlined","NodeIndexOutlined","NotificationOutlined","NumberOutlined","OneToOneOutlined","PaperClipOutlined","PartitionOutlined","PayCircleOutlined","PercentageOutlined","PhoneOutlined","PictureOutlined","PlaySquareOutlined","PoundCircleOutlined","PoundOutlined","PoweroffOutlined","PrinterOutlined","ProfileOutlined","ProjectOutlined","PropertySafetyOutlined","PullRequestOutlined","PushpinOutlined","QrcodeOutlined","ReadOutlined","ReconciliationOutlined","RedEnvelopeOutlined","ReloadOutlined","RestOutlined","RobotOutlined","RocketOutlined","RotateLeftOutlined","RotateRightOutlined","SafetyCertificateOutlined","SafetyOutlined","SaveOutlined","ScanOutlined","ScheduleOutlined","SearchOutlined","SecurityScanOutlined","SelectOutlined","SendOutlined","SettingOutlined","ShakeOutlined","ShareAltOutlined","ShopOutlined","ShoppingCartOutlined","ShoppingOutlined","SisternodeOutlined","SkinOutlined","SmileOutlined","SolutionOutlined","SoundOutlined","SplitCellsOutlined","StarOutlined","SubnodeOutlined","SwitcherOutlined","SyncOutlined","TableOutlined","TabletOutlined","TagOutlined","TagsOutlined","TeamOutlined","ThunderboltOutlined","ToTopOutlined","ToolOutlined","TrademarkCircleOutlined","TrademarkOutlined","TransactionOutlined","TranslationOutlined","TrophyOutlined","UngroupOutlined","UnlockOutlined","UploadOutlined","UsbOutlined","UserAddOutlined","UserDeleteOutlined","UserOutlined","UserSwitchOutlined","UsergroupAddOutlined","UsergroupDeleteOutlined","VerifiedOutlined","VideoCameraAddOutlined","VideoCameraOutlined","WalletOutlined","WhatsAppOutlined","WifiOutlined","WomanOutlined"]},{title:"方向图标",icons:["StepBackwardOutlined","StepForwardOutlined","FastBackwardOutlined","FastForwardOutlined","ShrinkOutlined","ArrowsAltOutlined","DownOutlined","UpOutlined","LeftOutlined","RightOutlined","CaretUpOutlined","CaretDownOutlined","CaretLeftOutlined","CaretRightOutlined","UpCircleOutlined","DownCircleOutlined","LeftCircleOutlined","RightCircleOutlined","DoubleRightOutlined","DoubleLeftOutlined","VerticalLeftOutlined","VerticalRightOutlined","VerticalAlignTopOutlined","VerticalAlignMiddleOutlined","VerticalAlignBottomOutlined","ForwardOutlined","BackwardOutlined","RollbackOutlined","EnterOutlined","RetweetOutlined","SwapOutlined","SwapLeftOutlined","SwapRightOutlined","ArrowUpOutlined","ArrowDownOutlined","ArrowLeftOutlined","ArrowRightOutlined","PlayCircleOutlined","UpSquareOutlined","DownSquareOutlined","LeftSquareOutlined","RightSquareOutlined","LoginOutlined","LogoutOutlined","MenuFoldOutlined","MenuUnfoldOutlined","BorderBottomOutlined","BorderHorizontalOutlined","BorderInnerOutlined","BorderOuterOutlined","BorderLeftOutlined","BorderRightOutlined","BorderTopOutlined","BorderVerticleOutlined","PicCenterOutlined","PicLeftOutlined","PicRightOutlined","RadiusBottomleftOutlined","RadiusBottomrightOutlined","RadiusUpleftOutlined","RadiusUprightOutlined","FullscreenOutlined","FullscreenExitOutlined"]},{title:"提示图标",icons:["QuestionOutlined","QuestionCircleOutlined","PlusOutlined","PlusCircleOutlined","PauseOutlined","PauseCircleOutlined","MinusOutlined","MinusCircleOutlined","PlusSquareOutlined","MinusSquareOutlined","InfoOutlined","InfoCircleOutlined","ExclamationOutlined","ExclamationCircleOutlined","CloseOutlined","CloseCircleOutlined","CloseSquareOutlined","CheckOutlined","CheckCircleOutlined","CheckSquareOutlined","ClockCircleOutlined","WarningOutlined","IssuesCloseOutlined","StopOutlined"]},{title:"编辑图标",icons:["EditOutlined","FormOutlined","CopyOutlined","ScissorOutlined","DeleteOutlined","SnippetsOutlined","DiffOutlined","HighlightOutlined","AlignCenterOutlined","AlignLeftOutlined","AlignRightOutlined","BgColorsOutlined","BoldOutlined","ItalicOutlined","UnderlineOutlined","StrikethroughOutlined","RedoOutlined","UndoOutlined","ZoomInOutlined","ZoomOutOutlined","FontColorsOutlined","FontSizeOutlined","LineHeightOutlined","DashOutlined","SmallDashOutlined","SortAscendingOutlined","SortDescendingOutlined","DragOutlined","OrderedListOutlined","UnorderedListOutlined","RadiusSettingOutlined","ColumnWidthOutlined","ColumnHeightOutlined"]},{title:"数据图标",icons:["AreaChartOutlined","PieChartOutlined","BarChartOutlined","DotChartOutlined","LineChartOutlined","RadarChartOutlined","HeatMapOutlined","FallOutlined","RiseOutlined","StockOutlined","BoxPlotOutlined","FundOutlined","SlidersOutlined"]},{title:"品牌图标",icons:["AndroidOutlined","AppleOutlined","WindowsOutlined","IeOutlined","ChromeOutlined","GithubOutlined","AliwangwangOutlined","DingdingOutlined","WeiboSquareOutlined","WeiboCircleOutlined","TaobaoCircleOutlined","Html5Outlined","WeiboOutlined","TwitterOutlined","WechatOutlined","YoutubeOutlined","AlipayCircleOutlined","TaobaoOutlined","SkypeOutlined","QqOutlined","MediumWorkmarkOutlined","GitlabOutlined","MediumOutlined","LinkedinOutlined","GooglePlusOutlined","DropboxOutlined","FacebookOutlined","CodepenOutlined","CodeSandboxOutlined","AmazonOutlined","GoogleOutlined","CodepenCircleOutlined","AlipayOutlined","AntDesignOutlined","AntCloudOutlined","AliyunOutlined","ZhihuOutlined","SlackOutlined","SlackSquareOutlined","BehanceOutlined","BehanceSquareOutlined","DribbbleOutlined","DribbbleSquareOutlined","InstagramOutlined","YuqueOutlined","AlibabaOutlined","YahooOutlined","RedditOutlined","SketchOutlined"]}]},{title:"实底风格",name:"Filled",groups:[{title:"通用图标",icons:["AccountBookFilled","AlertFilled","AlipaySquareFilled","AmazonCircleFilled","AmazonSquareFilled","ApiFilled","AppstoreFilled","AudioFilled","BankFilled","BehanceCircleFilled","BellFilled","BookFilled","BugFilled","BuildFilled","BulbFilled","CalculatorFilled","CalendarFilled","CameraFilled","CarFilled","CarryOutFilled","CiCircleFilled","CloudFilled","CodeFilled","CodeSandboxSquareFilled","CodepenSquareFilled","CompassFilled","ContactsFilled","ContainerFilled","ControlFilled","CopyrightCircleFilled","CreditCardFilled","CrownFilled","CustomerServiceFilled","DashboardFilled","DatabaseFilled","DingtalkCircleFilled","DingtalkSquareFilled","DislikeFilled","DollarCircleFilled","DribbbleCircleFilled","DropboxCircleFilled","DropboxSquareFilled","EnvironmentFilled","EuroCircleFilled","ExperimentFilled","EyeFilled","EyeInvisibleFilled","FileAddFilled","FileExcelFilled","FileExclamationFilled","FileFilled","FileImageFilled","FileMarkdownFilled","FilePdfFilled","FilePptFilled","FileTextFilled","FileUnknownFilled","FileWordFilled","FileZipFilled","FilterFilled","FireFilled","FlagFilled","FolderAddFilled","FolderFilled","FolderOpenFilled","FormatPainterFilled","FrownFilled","FunnelPlotFilled","GiftFilled","GoldFilled","GoldenFilled","GoogleCircleFilled","GooglePlusCircleFilled","GooglePlusSquareFilled","GoogleSquareFilled","HddFilled","HeartFilled","HomeFilled","HourglassFilled","IdcardFilled","IeCircleFilled","IeSquareFilled","InsuranceFilled","InteractionFilled","LayoutFilled","LikeFilled","LockFilled","MacCommandFilled","MailFilled","MedicineBoxFilled","MediumCircleFilled","MediumSquareFilled","MehFilled","MessageFilled","MobileFilled","MoneyCollectFilled","NotificationFilled","PayCircleFilled","PhoneFilled","PictureFilled","PlaySquareFilled","PoundCircleFilled","PrinterFilled","ProfileFilled","ProjectFilled","PropertySafetyFilled","PushpinFilled","QqCircleFilled","QqSquareFilled","ReadFilled","ReconciliationFilled","RedEnvelopeFilled","RedditCircleFilled","RedditSquareFilled","RestFilled","RobotFilled","RocketFilled","SafetyCertificateFilled","SaveFilled","ScheduleFilled","SecurityScanFilled","SettingFilled","ShopFilled","ShoppingFilled","SignalFilled","SketchCircleFilled","SketchSquareFilled","SkinFilled","SlackCircleFilled","SmileFilled","SoundFilled","StarFilled","SwitcherFilled","TabletFilled","TagFilled","TagsFilled","TaobaoSquareFilled","ThunderboltFilled","ToolFilled","TrademarkCircleFilled","TrophyFilled","TwitterCircleFilled","TwitterSquareFilled","UnlockFilled","UsbFilled","VideoCameraFilled","WalletFilled","ZhihuCircleFilled","ZhihuSquareFilled"]},{title:"方向图标",icons:["StepBackwardFilled","StepForwardFilled","FastBackwardFilled","FastForwardFilled","CaretUpFilled","CaretDownFilled","CaretLeftFilled","CaretRightFilled","UpCircleFilled","DownCircleFilled","LeftCircleFilled","RightCircleFilled","ForwardFilled","BackwardFilled","PlayCircleFilled","UpSquareFilled","DownSquareFilled","LeftSquareFilled","RightSquareFilled"]},{title:"提示图标",icons:["QuestionCircleFilled","PlusCircleFilled","PauseCircleFilled","MinusCircleFilled","PlusSquareFilled","MinusSquareFilled","InfoCircleFilled","ExclamationCircleFilled","CloseCircleFilled","CloseSquareFilled","CheckCircleFilled","CheckSquareFilled","ClockCircleFilled","WarningFilled","StopFilled"]},{title:"编辑图标",icons:["EditFilled","CopyFilled","DeleteFilled","SnippetsFilled","DiffFilled","HighlightFilled"]},{title:"数据图标",icons:["PieChartFilled","BoxPlotFilled","FundFilled","SlidersFilled"]},{title:"品牌图标",icons:["AndroidFilled","AppleFilled","WindowsFilled","ChromeFilled","GithubFilled","AliwangwangFilled","WeiboSquareFilled","WeiboCircleFilled","TaobaoCircleFilled","Html5Filled","WechatFilled","YoutubeFilled","AlipayCircleFilled","SkypeFilled","GitlabFilled","LinkedinFilled","FacebookFilled","CodeSandboxCircleFilled","CodepenCircleFilled","SlackSquareFilled","BehanceSquareFilled","DribbbleSquareFilled","InstagramFilled","YuqueFilled","YahooFilled"]}]},{title:"双色风格",name:"TowTone",enable:!1,groups:[{title:"方向图标",icons:["UpCircleTowTone","DownCircleTowTone","LeftCircleTowTone","RightCircleTowTone","PlayCircleTowTone","UpSquareTowTone","DownSquareTowTone","LeftSquareTowTone","RightSquareTowTone"]},{title:"提示图标",icons:["QuestionCircleTowTone","PlusCircleTowTone","PauseCircleTowTone","MinusCircleTowTone","PlusSquareTowTone","MinusSquareTowTone","InfoCircleTowTone","ExclamationCircleTowTone","CloseCircleTowTone","CloseSquareTowTone","CheckCircleTowTone","CheckSquareTowTone","ClockCircleTowTone","WarningTowTone","StopTowTone"]},{title:"编辑图标",icons:["EditTowTone","CopyTowTone","DeleteTowTone","SnippetsTowTone","DiffTowTone","HighlightTowTone"]},{title:"数据图标",icons:["PieChartTowTone","BoxPlotTowTone","FundTowTone","SlidersTowTone"]},{title:"品牌图标",icons:["Html5TowTone"]},{title:"通用图标",icons:["AccountBookTowTone","AlertTowTone","ApiTowTone","AppstoreTowTone","AudioTowTone","BankTowTone","BellTowTone","BookTowTone","BugTowTone","BuildTowTone","BulbTowTone","CalculatorTowTone","CalendarTowTone","CameraTowTone","CarTowTone","CarryOutTowTone","CiCircleTowTone","CiTowTone","CloudTowTone","CodeTowTone","CompassTowTone","ContactsTowTone","ContainerTowTone","ControlTowTone","CopyrightCircleTowTone","CopyrightTowTone","CreditCardTowTone","CrownTowTone","CustomerServiceTowTone","DashboardTowTone","DatabaseTowTone","DislikeTowTone","DollarCircleTowTone","DollarTowTone","EnvironmentTowTone","EuroCircleTowTone","EuroTowTone","ExperimentTowTone","EyeTowTone","EyeInvisibleTowTone","FileAddTowTone","FileExcelTowTone","FileExclamationTowTone","FileTowTone","FileImageTowTone","FileMarkdownTowTone","FilePdfTowTone","FilePptTowTone","FileTextTowTone","FileUnknownTowTone","FileWordTowTone","FileZipTowTone","FilterTowTone","FireTowTone","FlagTowTone","FolderAddTowTone","FolderTowTone","FolderOpenTowTone","FrownTowTone","FunnelPlotTowTone","GiftTowTone","GoldTowTone","HddTowTone","HeartTowTone","HomeTowTone","HourglassTowTone","IdcardTowTone","InsuranceTowTone","InteractionTowTone","LayoutTowTone","LikeTowTone","LockTowTone","MailTowTone","MedicineBoxTowTone","MehTowTone","MessageTowTone","MobileTowTone","MoneyCollectTowTone","NotificationTowTone","PhoneTowTone","PictureTowTone","PlaySquareTowTone","PoundCircleTowTone","PrinterTowTone","ProfileTowTone","ProjectTowTone","PropertySafetyTowTone","PushpinTowTone","ReconciliationTowTone","RedEnvelopeTowTone","RestTowTone","RocketTowTone","SafetyCertificateTowTone","SaveTowTone","ScheduleTowTone","SecurityScanTowTone","SettingTowTone","ShopTowTone","ShoppingTowTone","SkinTowTone","SmileTowTone","SoundTowTone","StarTowTone","SwitcherTowTone","TabletTowTone","TagTowTone","TagsTowTone","ThunderboltTowTone","ToolTowTone","TrademarkCircleTowTone","TrophyTowTone","UnlockTowTone","UsbTowTone","VideoCameraTowTone","WalletTowTone"]}]}],yc={class:"icon-select-warp"},vc={class:"icon-search"},kc={class:"icon-list"},wc={class:"label"},Wa=Z(e.defineComponent({__name:"icon-list",setup(t,{expose:n}){const l=e.ref(),o=e.ref(0),a=e.ref(),i=e.ref(""),s=e.ref(ro),r=be(()=>{if(!i.value){s.value=ro;return}const c=i.value.toLowerCase(),h=JSON.parse(JSON.stringify(ro));h.forEach(p=>{p.groups.forEach(m=>{m.icons=m.icons.filter(x=>x.toLowerCase().includes(c))}),p.groups=p.groups.filter(m=>m.icons.length>0)}),s.value=h});function d(c){a.value=c}function f(){return a.value}return n({getSelected:f}),(c,h)=>{const p=e.resolveComponent("a-input"),m=e.resolveComponent("a-col"),x=e.resolveComponent("a-row"),b=e.resolveComponent("a-collapse-panel"),g=e.resolveComponent("a-empty"),u=e.resolveComponent("a-collapse"),y=e.resolveComponent("a-tab-pane"),N=e.resolveComponent("a-tabs");return e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",vc,[e.createVNode(p,{value:i.value,"onUpdate:value":h[0]||(h[0]=k=>i.value=k),placeholder:"搜索icon(回车)...",allowClear:"",onChange:e.unref(r)},null,8,["value","onChange"])]),e.createElementVNode("div",kc,[e.createVNode(N,{activeKey:l.value,"onUpdate:activeKey":h[2]||(h[2]=k=>l.value=k)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,k=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k.name},[k.enable!=!1?(e.openBlock(),e.createBlock(y,{tab:k.title,key:k.name},{default:e.withCtx(()=>[k.groups.length?(e.openBlock(),e.createBlock(u,{key:0,activeKey:o.value,"onUpdate:activeKey":h[1]||(h[1]=w=>o.value=w),accordion:"",ghost:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.groups,(w,V)=>(e.openBlock(),e.createBlock(b,{class:"group",key:V,header:w.title},{default:e.withCtx(()=>[e.createVNode(x,{gutter:10},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.icons,_=>(e.openBlock(),e.createBlock(m,{span:4,key:_,class:e.normalizeClass(["icon-item","icon-"+_,a.value==_&&"selected"]),onClick:v=>d(_)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_))),e.createElementVNode("div",wc,e.toDisplayString(_.substr(0,_.length-k.name.length)),1)]),_:2},1032,["class","onClick"]))),128))]),_:2},1024)]),_:2},1032,["header"]))),128)),k.groups.length==0?(e.openBlock(),e.createBlock(g,{key:0,description:"暂无数据"})):e.createCommentVNode("",!0)]),_:2},1032,["activeKey"])):e.createCommentVNode("",!0)]),_:2},1032,["tab"])):e.createCommentVNode("",!0)],64))),128))]),_:1},8,["activeKey"])])])}}}),[["__scopeId","data-v-0f290eff"]]),Cc={class:"icon-select"},Ac={key:1,class:"empty"},xc=Z(e.defineComponent({name:"IconSelect",__name:"index",props:e.mergeModels({title:{type:String,default:"图标选择"},show:{type:String,default:"drawer"},position:{type:String,default:"right"},width:{type:Number,default:600},allowClear:{type:Boolean,default:!0}},{value:{},valueModifiers:{},visible:{},visibleModifiers:{}}),emits:e.mergeModels(["ok","change"],["update:value","update:visible"]),setup(t,{emit:n}){const l=P.useDialog(),o=t,a=e.useModel(t,"value"),i=e.useModel(t,"visible");function s(){i.value=!0}const r=n,d=e.ref();function f(){const h=d.value.getSelected();if(h){a.value=h,i.value=!1,r("change",h),r("ok",h);return}l.warning({content:"请选择图标"})}function c(){a.value="",r("change","")}return(h,p)=>{const m=e.resolveComponent("CloseCircleFilled"),x=e.resolveComponent("a-button"),b=e.resolveComponent("a-drawer"),g=e.resolveComponent("a-modal");return e.openBlock(),e.createElementBlock("div",Cc,[e.createElementVNode("div",{class:"icon-box",onClick:s},[a.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value),{key:0,class:"view"})):(e.openBlock(),e.createElementBlock("span",Ac,[p[3]||(p[3]=e.createElementVNode("span",null,"选择",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent("SearchOutlined")))])),t.allowClear&&a.value?(e.openBlock(),e.createBlock(m,{key:2,onClick:e.withModifiers(c,["stop"]),class:"clear-icon"})):e.createCommentVNode("",!0)]),o.show=="drawer"?(e.openBlock(),e.createBlock(b,{key:0,title:t.title,width:o.width,visible:i.value,"onUpdate:visible":p[1]||(p[1]=u=>i.value=u),placement:o.position,maskClosable:!1,bodyStyle:{padding:10},class:"icon-select-drawer"},{footer:e.withCtx(()=>[e.createVNode(x,{type:"primary",onClick:f},{default:e.withCtx(()=>p[4]||(p[4]=[e.createTextVNode("确定")])),_:1}),e.createVNode(x,{onClick:p[0]||(p[0]=u=>i.value=!1)},{default:e.withCtx(()=>p[5]||(p[5]=[e.createTextVNode("取消")])),_:1})]),default:e.withCtx(()=>[e.createVNode(Wa,{ref_key:"listObj",ref:d},null,512)]),_:1},8,["title","width","visible","placement"])):e.createCommentVNode("",!0),o.show=="dialog"?(e.openBlock(),e.createBlock(g,{key:1,title:t.title,width:o.width,open:i.value,"onUpdate:open":p[2]||(p[2]=u=>i.value=u),centered:o.position=="center",maskClosable:!1,class:"icon-select-dialog",onOk:f},{default:e.withCtx(()=>[e.createVNode(Wa,{ref_key:"listObj",ref:d},null,512)]),_:1},8,["title","width","open","centered"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-9d3db12b"]]),Nc={key:0,class:"unione-form-code-input"},_c={class:"opts"},Sc={class:"code-line"},Vc={class:"btns"},Bc=Z(e.defineComponent({__name:"codeInput",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},disabled:{type:Boolean,defualt:!1},placeholder:{type:String,required:!1}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=n,o=e.useModel(t,"value"),a=e.computed(()=>o.value?.scriptText?o.value.scriptText.split(`
1
+ (function(ie,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("unione-base-vue"),require("vue"),require("ant-design-vue"),require("lodash-es"),require("vue-codemirror"),require("@codemirror/lang-javascript"),require("vuedraggable"),require("@hufe921/canvas-editor"),require("dayjs"),require("prismjs"),require("@codemirror/lang-json"),require("@codemirror/lang-html"),require("@codemirror/lang-css"),require("@codemirror/lang-sql"),require("@ant-design/icons-vue"),require("uuid"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","unione-base-vue","vue","ant-design-vue","lodash-es","vue-codemirror","@codemirror/lang-javascript","vuedraggable","@hufe921/canvas-editor","dayjs","prismjs","@codemirror/lang-json","@codemirror/lang-html","@codemirror/lang-css","@codemirror/lang-sql","@ant-design/icons-vue","uuid","vue-router"],P):(ie=typeof globalThis<"u"?globalThis:ie||self,P(ie.index={},ie.UnioneBaseVue,ie.Vue,ie.antDesignVue,ie.lodashEs,ie.vueCodemirror,ie.langJavascript,ie.draggable,ie.canvasEditor,ie.dayjs,ie.prism,ie.langJson,ie.langHtml,ie.langCss,ie.langSql,ie.iconsVue,ie.uuid,ie.vueRouter))})(this,function(ie,P,e,te,en,tn,Da,On,pe,od,Ua,La,ad,id,rd,gt,sd,dd){"use strict";const cd={isDebug:!1,axios:{form:"/portal",flow:"/flow"},listPageUrl:"/data/page/list",addPageUrl:"/data/page/add",editPageUrl:"/data/page/edit",viewPageUrl:"/data/page/view",formRules:[]},to=e.ref(cd);function Le(t){return t&&(to.value=P.utils.obj.set(to.value,t)),to.value}const ud={...{...{submit:"提交","submit.ok":"已提交","submit.error":"提交失败","confirm.ok":"确定","confirm.cancel":"取消","global.setting.title":"设置"},...{"pages.home":"首页"},...{"pages.layouts.userLayout.title":"user layout"}}},pd={...{submit:"Submit","submit.ok":"Submitted","submit.error":"Submit Failed","confirm.ok":"Yes","confirm.cancel":"No","global.setting.title":"Settings"},...{"pages.home":"Home"},...{"pages.layouts.userLayout.title":"user layout"}},fd=e.ref([ud,pd]);function md(t,n){return P.locales.loadLanguage(t,()=>new Promise((l,o)=>{const a=fd.value.filter(i=>i.localeName==t);if(n)if(typeof n=="function")n().then(i=>{if(a.length==0){const s={...i,localeName:t};l(s)}else{const s={...a[0],...i};l(s)}});else if(a.length==0){const i={...n,localeName:t};l(i)}else{const i={...a[0],...n};l(i)}else a.length>0?l(a[0]):o("local language not defined ,lang:"+t)}))}const no={...P.locales};no.loadLanguage=md;class gd{$psn;$pid;$store;$forms;$model;$params;$refObj;$refData;constructor(n,l){this.$psn=n,this.$pid="",this.$store={},this.$forms={},this.$params={},this.$refObj={},this.$refData={},this.$model=l}params(n){if(n){this.$params=n,n.id&&(this.$pid=n.id,this.$psn&&this.use(this.$psn,"form").detail(this.$pid));for(const l in this.$store)this.$store[l].$params=n}return this.$params}psn(n){return n&&(this.$psn=n),this.$psn}regRef(n,l){}setRefData(n,l,o){}use(n,l,o){let a=this.$store[n];return a||(a=new lo(n,l,this.$model),this.$store[n]=a,a.$params=this.$params),o&&(a.$form=o,this.$forms[n]=o),a}useForm(n,l,o){const a=this.use(n,"form",l);return this.$psn==n&&this.$pid&&a.detail(this.$pid).then(i=>{o&&o(i)}),a}data(n){return this.$store[n]}form(n){return n?this.$forms[n]:this.$forms}primary(){return this.data(this.$psn)}dsnList(){return Object.keys(this.$store)}}class lo{$sid;$dsn;$type;$data;$dialog;$model;$form;$params;$store;constructor(n,l,o){typeof n=="string"?(this.$dsn=n,this.$store={controller:"/api/data/storage/v1"}):(this.$store=n,this.$dsn=""),this.$type=l,this.$data=e.ref(l=="form"?{}:{body:[],total:0}),this.$dialog=P.useDialog(),this.$model=e.ref(o||"run")}$isStorage(){return this.$store.controller.indexOf("/api/data/storage")>=0}store(n){return n&&(this.$store=n),this.$store}data(){return this.$type=="form"?this.$data.value||{}:this.$data.value||[]}setValue(n){this.$data.value=n,this.$form?.setValue(n)}reset(n){this.$data.value=n||{},this.$form?.setValue(n||{}),this.$form?.reset(),this.$sid=""}$processParams(n,l,o){if(o)o.forEach(a=>{if(a.name.startsWith("$")){const i=a.name.substring(1);l[i]==null&&l[i]==null&&(this.$params[i]!=null&&this.$params[i]!=null?(l[a.alias||i]=this.$params[i],P.utils.obj.setValue(l,a.alias||i,P.utils.obj.getValue(this.$params,i))):a.value!=null&&a.value!=null&&P.utils.obj.setValue(l,a.alias||i,a.value))}else l[n][a.name]==null&&l[n][a.name]==null&&(this.$params[a.name]!=null&&this.$params[a.name]!=null?P.utils.obj.setValue(l[n],a.alias||a.name,P.utils.obj.getValue(this.$params,a.name)):a.value!=null&&a.value!=null&&P.utils.obj.setValue(l[n],a.alias||a.name,a.value))});else if(this.$params)for(const a in this.$params)l[n][a]==null&&l[n][a]==null&&this.$params[a]!=null&&this.$params[a]!=null&&(l[n][a]=this.$params[a]);return l}request(n){return new Promise((l,o)=>{const a=te.message.loading("数据请求中..."),i=this.$store.controller+n.url;P.axios[this.$store.ctx||"form"]({method:"post",...n,url:i}).then(s=>{s.success?l(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"数据请求失败,model sn:"+this.$dsn+",url:"+i,options:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"数据请求失败,model sn:"+this.$dsn+",url:"+i,options:n,err:s})}).finally(()=>{a()})})}find(n){const l=this.$store.controller+(this.$store.findUrl||"/find");return!n&&this.$store.findParams&&(n={dsn:this.$dsn}),this.$isStorage()&&(n.dsn=this.$dsn+(this.$model!="run"?"@dev":"")),n&&(n=this.$processParams("body",n,this.$store.findParams)),new Promise((o,a)=>{const i=te.message.loading("数据加载中...");P.axios[this.$store.ctx||"form"]({url:l,method:"post",data:n}).then(s=>{s.success?(this.$data.value=s,o(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),a({info:"数据加载失败,model sn:"+this.$dsn,url:l,params:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),a({info:"数据加载失败,model sn:"+this.$dsn,url:l,params:n,err:s})}).finally(()=>{i()})})}save(n){const l=this.$store.controller+(this.$store.saveUrl||"/save");return this.$isStorage()?(n.dsn=this.$dsn+(this.$model!="run"?"@dev":""),n=this.$processParams("params",n,this.$store.saveParams),this.$params?.id&&(n.id=this.$params.id),this.$sid&&(n.id=this.$sid)):(n=this.$processParams("data",n,this.$store.saveParams),this.$params?.id&&(n.data.id=this.$params.id)),new Promise((o,a)=>{const i=te.message.loading("数据提交中...");P.axios[this.$store.ctx||"form"]({url:l,method:"post",data:this.$isStorage()?n:n.data}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body||{},this.$sid=s.id),s.silence||te.message.success(s.message),o(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),a({info:"数据保存失败,model sn:"+this.$dsn,url:l,data:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),a({info:"数据保存失败,model sn:"+this.$dsn,url:l,data:n,err:s})}).finally(()=>{i()})})}loadByIds(n){return new Promise((l,o)=>{const a=te.message.loading("数据加载中..."),i=this.$store.controller+"/loadByIds";P.axios[this.$store.ctx||"form"]({url:i,method:"post",data:this.$isStorage()?{ids:n,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:n}).then(s=>{s.success?l(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"数据加载失败,model sn:"+this.$dsn,ids:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"数据加载失败,model sn:"+this.$dsn,ids:n,err:s})}).finally(()=>{a()})})}detail(n){return new Promise((l,o)=>{const a=te.message.loading("数据加载中..."),i=this.$store.controller+"/detail";P.axios[this.$store.ctx||"form"]({url:i,method:"post",headers:{"Content-Type":"application/json"},data:this.$isStorage()?{id:n,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:n}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body||{},this.$sid=s.id),l(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"加载数据详情失败,model sn:"+this.$dsn,url:i,id:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"加载数据详情失败,model sn:"+this.$dsn,url:i,id:n,err:s})}).finally(()=>{a()})})}deleteByIds(n){return new Promise((l,o)=>{this.$dialog.confirm({content:"确定要删除选中记录么?共"+n.length+"条。",onOk:()=>{const a=te.message.loading("数据处理中..."),i=this.$store.controller+"/delete";P.axios[this.$store.ctx||"form"]({url:i,method:"post",data:this.$isStorage()?{ids:n,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:n}).then(s=>{s.success?l(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),o({info:"数据删除失败,model sn:"+this.$dsn,url:i,ids:n,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),o({info:"数据删除失败,model sn:"+this.$dsn,url:i,ids:n,err:s})}).finally(()=>{a()})}})})}}class hd{$event;$onces;$delayEmit;constructor(){this.$event={},this.$onces={},this.$delayEmit={}}$on(n,l){if(this.$event[n]=l,this.$delayEmit[n]){const o=this.$delayEmit[n];l(o)}}$emit(n,l){if(this.$onces[n]){const o=this.$onces[n];delete this.$onces[n],o(l)}this.$event[n]?this.$event[n](l):(this.$delayEmit[n]=l,setTimeout(()=>{delete this.$delayEmit[n]},1e3*10))}$once(n,l){this.$onces[n]=l}$off(n){delete this.$event[n]}}function oo(t){const n=t.toLowerCase().split("_"),l=[];l.push(n[0]);for(let o=1;o<n.length;o++){const a=n[o];a&&(l.push(a.charAt(0).toUpperCase()),a.length>1&&l.push(a.substring(1)))}return l.join("")}const ja="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Pa(t=10){const n=Date.now().toString(),l=new Uint32Array(t);crypto.getRandomValues(l);let o="";for(let a=0;a<t;a++){const i=(parseInt(n[a%n.length],10)+l[a])%ja.length;o+=ja[i]}return o}function qa(t,n){const l={data:{},error:[]};return t.filter(o=>o.visible!=!1).forEach(o=>{if(o.control)if(o.name=="this"){if(o.event?.validate&&typeof o.event.validate=="function"){const a=o.event.validate(n,n);a?.error&&l.error.push({name:o.name,title:o.title,message:a.error}),a?.data&&P.utils.obj.set(l.data,a.data)}}else{const a=P.utils.obj.getValue(n,o.name);if(o.event?.visible&&typeof o.event.visible=="function"&&!o.event.visible(a,n))return;if((a||a==0||a==!1)&&P.utils.obj.setValue(l.data,o.name,a),o.event?.validate&&typeof o.event.validate=="function"){const i=o.event.validate(a,n);i?.error&&l.error.push({name:o.name,title:o.title,message:i.error}),i?.data&&P.utils.obj.set(l.data,i.data)}else o.props?.required&&!a&&a!==0&&l.error.push({name:o.name,title:o.title,message:o.title+"不能为空"})}if(o.widgets?.length){const a=qa(o.widgets,n);P.utils.obj.set(l.data,a.data),l.error.push(...a.error)}}),l}const je={...P.utils,toHump:oo,randomStr:Pa,form:{validate:qa}},ao=[{name:"undo",title:"撤销",exec:t=>{t.undo()}},{name:"redo",title:"重做",exec:t=>{t.redo()}},{name:"add",title:"新增组件",exec:(t,n)=>{if(!n){te.message.error("添加组件失败,组件定义不能为空");return}if(!n.widget){te.message.error("添加组件失败,组件widget不能为空");return}if(n.wid||(n.wid=je.randomStr(32)),n.pid){const o=t.$widgetMap.value[n.pid];o&&(o.widgets||(o.widgets=[]),o.widgets.splice(n.index,0,n))}else t.$widgetList.value.splice(n.index,0,n);const l=o=>{o.widgets?.forEach(a=>{a.pid=o.wid,a.wid||(a.wid=je.randomStr(32)),t.$widgetMap.value[a.wid]=a,l(a)})};return l(n),t.widgetActive.value=n,t.$widgetMap.value[n.wid]=n,t.$status.value.size=Object.keys(t.$widgetMap.value).length,{name:"del",params:{wid:n.wid}}}},{name:"copy",title:"复制组件",exec:(t,n)=>{if(!n){te.message.error("复制组件失败,组件wid不能为空");return}let l=t.$widgetMap.value[n];if(!l){te.message.error("复制组件失败,组件定义不能为空");return}if(l=JSON.parse(JSON.stringify(l)),l.wid=je.randomStr(32),l.pid){const a=t.$widgetMap.value[l.pid];a&&(a.widgets||(a.widgets=[]),a.widgets.push(l))}else t.$widgetList.value.push(l);const o=a=>{a.widgets?.forEach(i=>{i.pid=a.wid,i.wid||(i.wid=je.randomStr(32)),t.$widgetMap.value[i.wid]=i,o(i)})};return o(l),t.widgetActive.value=l,t.$widgetMap.value[l.wid]=l,t.$status.value.size=Object.keys(t.$widgetMap.value).length,{name:"del",params:{wid:l.wid}}}},{name:"del",title:"删除组件",exec:(t,n)=>{if(!n){te.message.error("删除组件失败,组件wid不能为空");return}const l=t.$widgetMap.value[n];if(l){if(!l.pid||!t.$widgetMap.value[l.pid])t.$widgetList.value=t.$widgetList.value.filter(a=>a.wid!==l.wid);else if(l.pid){const a=t.$widgetMap.value[l.pid];a&&(a.widgets=a.widgets.filter(i=>i.wid!==l.wid))}const o=a=>{a.widgets?.forEach(i=>{o(i),delete t.$widgetMap.value[i.wid]})};return o(l),t.widgetActive.value={},delete t.$widgetMap.value[l.wid],t.$status.value.size=Object.keys(t.$widgetMap.value).length,{name:"add",params:l}}}},{name:"clear",title:"清空组件",exec:t=>{t.widgetActive.value={},t.$widgetMap.value={},t.$widgetList.value=[],t.$cmdUndo.value=[],t.$cmdRedo.value=[],t.$cmdExes.value=[],t.$cmdUndo.value=[],t.$cmdRedo.value=[],t.$cmdExes.value=[],t.$cmdMap.value=[],t.$status.value={cmdCount:0,undoCount:0,redoCount:0,exeCount:0,size:0},t.$axiosProccess.value={},t.$status.value.size=Object.keys(t.$widgetMap.value).length}},{name:"update",title:"更新组件",exec:(t,n)=>{if(!n){te.message.error("更新组件失败,组件定义不能为空");return}if(!n.wid){te.message.error("更新组件失败,组件wid不能为空");return}const l=t.$widgetMap.value[n.wid];if(l){const o=P.utils.obj.ext({},l);return P.utils.obj.set(l,n),{name:"update",params:o}}}},{name:"setActive",title:"设置组件激活",exec:(t,n)=>{if(!n){te.message.error("设置组件激活失败,组件wid不能为空");return}const l=t.$widgetMap.value[n];if(l)return t.widgetActive.value=l,{name:"disActive",params:n}}},{name:"disActive",title:"取消组件激活",exec:(t,n)=>{if(!n){te.message.error("取消组件激活失败,组件wid不能为空");return}if(t.$widgetMap.value[n])return t.widgetActive.value=null,{name:"setActive",params:n}}},{name:"move",title:"移动组件",exec:(t,{wid:n,pid:l,oldIndex:o,newIndex:a})=>{if(!n){te.message.error("移动组件失败,组件wid不能为空");return}const i=t.$widgetMap.value[n];if(i){const s=i.pid;if(l&&l!==s){const r=t.$widgetMap.value[s];r&&(r.widgets=r.widgets.filter(d=>d.wid!==i.wid))}if(l){const r=t.$widgetMap.value[l];r&&(l===s&&(r.widgets=r.widgets.filter(d=>d.wid!==i.wid)),r.widgets.splice(a,0,i),i.pid=l)}else t.$widgetList.value.splice(a,0,i);return{name:"move",params:{wid:n,pid:s,oldIndex:a,newIndex:o}}}}}];class Se{define;ebus;model;widgetActive;type;$widgetList;$widgetMap;$dataManager;dataModels;$axiosProccess;$dialog;$cmdMap;$cmdUndo;$cmdRedo;$cmdExes;$undoSize;$status;static conponents=e.ref({});static regComponent=(n,l)=>{};static buildComponent=n=>{Array.isArray(n)||(n=[n]),n.forEach(l=>{const o={...l};o.configs&&(o.configs=JSON.parse(o.configs)),o.props?o.props=JSON.parse(o.props):o.props={},Se.conponents.value[o.control||o.widget||o.name]=o}),n.filter(l=>l.isCustom==1).forEach(l=>{if(!l.configs){console.error("widget config is empty, widget id:"+l.id);return}try{const o=JSON.parse(l.configs),a=new Function("return"+o.script)();a.template=o.template,a.style=o.style,a.widget=l.widget||l.name,Se.regComponent(a.widget,e.defineAsyncComponent(()=>Promise.resolve(a)));const i=document.querySelector('style[data-widget="'+a.widget+'"]');if(o.style)if(o.style=o.style.replace(/\.([a-zA-Z0-9_-]+)/g,"."+a.widget+" .$1"),o.style=o.style.replace("."+a.widget+" ."+a.widget,"."+a.widget),i)i.innerHTML=o.style;else{const s=document.createElement("style");s.setAttribute("data-widget",a.widget+""),s.innerHTML=o.style,document.head.appendChild(s)}else i&&i.remove()}catch(o){console.error("widget script error,widget id:"+l.id,o)}})};constructor(n={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgets:[],dsnList:[]}},l){const o=n.configs||{};this.dataModels=e.ref(o.dataModels||[]),this.widgetActive=e.ref({}),this.model=e.ref(l?.model||"run"),this.type=e.ref(n.types||"setting"),this.define=n,this.ebus=new hd,this.$widgetList=e.ref([]),this.$widgetMap=e.ref({}),this.$dataManager=new gd(o.dsnList?o.dsnList[0]:"",this.model.value),this.$undoSize=e.ref(l?.undoSize||1e3),this.$cmdUndo=e.ref([]),this.$cmdRedo=e.ref([]),this.$cmdExes=e.ref([]),this.$cmdMap=e.ref({}),this.$status=e.ref({cmdCount:0,undoCount:0,redoCount:0,exeCount:0,size:0}),this.$axiosProccess=e.ref({}),this.$dialog=P.useDialog(),this.regCmd(ao),this.loadConfig(o),this.ebus.$on("cmd:exec",({name:a,params:i})=>{if(a=="undo"){this.undo();return}if(a=="redo"){this.redo();return}this.exeCmd(a,i)}),e.nextTick(()=>{this.ebus.$emit("engine:inited")})}sn(){return this.define.sn}load(n,l){if(!n)return Promise.reject("sn is empty");if(this.define.sn=n,n.endsWith(":view")&&(this.model.value="view"),n=="new_")return console.log("新建/本地页面sn:"+n+",define:",l),l&&l.configs&&(this.define=l,this.type.value=this.define.types||"setting",this.loadConfig(l.configs)),Promise.resolve();const o=sessionStorage.getItem("PAGE_DEFINE:"+n);return o&&this.model.value=="run"?(this.define=JSON.parse(o),this.type.value=this.define.types||"setting",this.loadConfig(this.define.configs),console.log("从会话缓存中加载页面sn:"+n+",define:",this.define),Promise.resolve()):new Promise((a,i)=>{P.axios.form({url:"/api/page/define/load/"+n,method:"post"}).then(s=>{s.success?(this.define=s.body,this.type.value=this.define.types||"setting",s.body.configs?this.define.configs=s.body.configs:this.define.configs={widgets:[],dsnList:[]},this.loadConfig(this.define.configs),sessionStorage.setItem("PAGE_DEFINE:"+n,JSON.stringify(this.define)),console.log("从远程服务加载页面sn:"+n+",define:",this.define),a(this.define)):l&&l.configs&&(this.define=l,this.loadConfig(l.configs),a(this.define))}).catch(s=>{i(s)})})}save(){return new Promise((n,l)=>{if(this.$axiosProccess.value.save){console.warn("unione form editor save process runing,sn:"+this.define.sn),l();return}this.$axiosProccess.value.save=!0;const o={...this.define.configs||{},widgets:this.$widgetList.value,dsnList:this.$dataManager.dsnList()},a={...this.define};a.configs=JSON.stringify(o),P.axios.form({url:"/api/page/define/save",method:"post",data:a}).then(i=>{this.$axiosProccess.value.save=!1,i.success?(te.message.success(i.message),this.define=i.body,sessionStorage.setItem("PAGE_DEFINE:"+this.define.sn,JSON.stringify(this.define)),this.load(this.define.sn,this.define),n(i.body)):(this.$dialog.error({content:i.message}),l())}).catch(i=>{console.error("页面配置保存失败",i),this.$dialog.error({content:"页面配置保存失败"})}).finally(()=>{this.$axiosProccess.value.save=!1})})}loadConfig(n){n.dsnList?.length&&this.$dataManager.psn(n.dsnList[0]),this.$widgetList.value=n.widgets||[],this.$widgetMap.value={},this.$processWidget(this.$widgetList.value),this.$status.value||(this.$status.value={}),this.$status.value.size=Object.keys(this.$widgetMap.value).length}setModel(n){this.model.value=n}widget(n){return this.$widgetMap.value?this.$widgetMap.value[n]:null}widgets(n){if(n)this.$widgetList.value=n,this.$widgetMap.value={},this.$processWidget(n);else return this.$widgetList.value}$processWidget(n,l){n.forEach(o=>{o.wid||(o.wid="w:"+en.uniqueId()),l&&(o.pid=l.wid),this.$widgetMap.value[o.wid]=o,o?.widgets&&this.$processWidget(o.widgets,o)})}dataManager(){return this.$dataManager}regCmd(n){Array.isArray(n)?n.forEach(l=>{this.$cmdMap.value[l.name]=l}):this.$cmdMap.value[n.name]=n,this.$status.value.cmdCount=Object.keys(this.$cmdMap.value).length}offCmd(n){Array.isArray(n)?n.forEach(l=>{delete this.$cmdMap.value[l]}):delete this.$cmdMap.value[n],this.$status.value.cmdCount=Object.keys(this.$cmdMap.value).length}exeCmd(n,l){const o=this.$cmdMap.value[n];if(console.log("UFEngine exe cmd,name:"+n+",cmd:",o,l),o&&o.exec){const a=o.exec(this,l);a&&(this.$cmdUndo.value.push({name:a.name,params:a.params}),this.$cmdExes.value.push({name:n,params:l}),this.$cmdUndo.value.length>this.$undoSize.value&&(this.$cmdUndo.value.shift(),this.$cmdExes.value.shift())),this.$status.value.exeCount=this.$status.value.exeCount+1,this.$status.value.undoCount=this.$cmdUndo.value.length}}undo(){if(this.$cmdUndo.value.length){const n=this.$cmdUndo.value.pop(),l=this.$cmdExes.value.pop();if(!n||!l)return;const o=this.$cmdMap.value[n.name];o&&o.exec&&(o.exec(this,n.params),this.$cmdRedo.value.push({name:l.name,params:l.params}),this.$cmdRedo.value.length>this.$undoSize.value&&this.$cmdRedo.value.shift()),this.$status.value.undoCount=this.$cmdUndo.value.length,this.$status.value.redoCount=this.$cmdRedo.value.length}}redo(){if(this.$cmdRedo.value.length){const n=this.$cmdRedo.value.pop();if(this.$status.value.redoCount=this.$cmdRedo.value.length,!n)return;this.exeCmd(n.name,n.params)}}status(){return this.$status}}const bd={key:0},yd=["onClick"],vd=e.defineComponent({__name:"btnSetting",props:{preset:{type:Array,default(){return[]}}},setup(t,{expose:n}){const l=t,o=e.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:k})=>k+1},{title:"参数名称",dataIndex:"name",key:"name",width:"60px",align:"center"},{title:"参数标题",dataIndex:"title",key:"title",width:"80px",align:"center"},{title:"参数value",dataIndex:"value",key:"value",width:"100px",align:"center"}]),a=e.ref({selectedRowKeys:[],columnWidth:"25px",onChange:k=>{a.value.selectedRowKeys=k}}),i={mounted:k=>k.focus()},s=e.ref({});function r(){const k=Object.keys(s.value);if(k.length)for(let w in k){const V=b.value.form.action.params[w];V&&s.value[w]&&Object.keys(s.value[w]).forEach(_=>{V[_]=s.value[w][_]})}s.value={}}function d(k,w,V){r();const _={};_[V]=w[V]||"",V=="showIndex"&&(_[V]=w.show?.query?.index),s.value[k]=_}function f(k,w,V){if(!w||!V){s.value={};return}const _=s.value[k][V];w[V]=_,s.value={}}function c(){b.value.form.action.params.push({title:"新建",name:"",value:""})}function h(){}const p=e.ref(""),m=e.ref({title:[{required:!0,message:"按钮标题不能为空"}],name:[{required:!0,message:"按钮名称不能为空"},{validator:(k,w)=>p.value!=w&&l.preset.includes(w)?Promise.reject("预设按钮名称,请使用其他名称,["+l.preset.join(",")+"]"):Promise.resolve(),trigger:"change"}]}),x=e.ref([Da.javascript()]),b=e.ref({title:"按钮设置",visible:!1,form:{},helps:{}}),g=e.ref();function u(k,w,V={}){k=JSON.parse(JSON.stringify(k)),k.event||(k.event={}),k.props||(k.props={}),k.action||(k.action={}),Object.keys(k.action).includes("maskClosable")||(k.action.maskClosable=!0),k.action.params||(k.action.params=[]),p.value=k.name,b.value.form=k,b.value.helps=V,b.value.visible=!0,g.value=w}const y=e.ref(null);function N(){y.value&&y.value.validate().then(()=>{b.value.visible=!1,g.value(b.value.form)})}return n({open:u,close}),(k,w)=>{const V=e.resolveComponent("a-input"),_=e.resolveComponent("a-form-item"),v=e.resolveComponent("a-select"),C=e.resolveComponent("a-input-number"),E=e.resolveComponent("a-checkbox"),S=e.resolveComponent("a-tab-pane"),A=e.resolveComponent("a-switch"),O=e.resolveComponent("a-button"),T=e.resolveComponent("a-divider"),B=e.resolveComponent("ToolOutlined"),$=e.resolveComponent("a-tooltip"),I=e.resolveComponent("a-table"),F=e.resolveComponent("a-tabs"),j=e.resolveComponent("a-form"),U=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(U,{visible:b.value.visible,"onUpdate:visible":w[23]||(w[23]=M=>b.value.visible=M),title:b.value.title,centered:"",width:"50%",onOk:N},{default:e.withCtx(()=>[e.createVNode(j,{name:"basic",ref_key:"form",ref:y,rules:m.value,model:b.value.form,"label-col":{span:5},"wrapper-col":{span:19},autocomplete:"off",class:"form-mix btn-setting-form"},{default:e.withCtx(()=>[e.createVNode(F,null,{default:e.withCtx(()=>[e.createVNode(S,{key:"base",tab:"基本设置"},{default:e.withCtx(()=>[e.createVNode(_,{label:"操作标题",required:"",name:"title"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.title,"onUpdate:value":w[0]||(w[0]=M=>b.value.form.title=M)},null,8,["value"])]),_:1}),e.createVNode(_,{label:"操作名称",name:"name",required:""},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.name,"onUpdate:value":w[1]||(w[1]=M=>b.value.form.name=M),disabled:l.preset.includes(b.value.form.name)},null,8,["value","disabled"])]),_:1}),e.createVNode(_,{label:"操作图标"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.icon,"onUpdate:value":w[2]||(w[2]=M=>b.value.form.icon=M)},null,8,["value"])]),_:1}),e.createVNode(_,{label:"按钮类型"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.type,"onUpdate:value":w[3]||(w[3]=M=>b.value.form.type=M),allowClear:"",options:[{value:"primary",label:"主要按钮"},{value:"ghost",label:"幽灵按钮"},{value:"dashed",label:"虚线按钮"},{value:"link",label:"连接按钮"},{value:"text",label:"文本按钮"},{value:"default",label:"默认按钮"}]},null,8,["value"])]),_:1}),e.createVNode(_,{label:"显示顺序"},{default:e.withCtx(()=>[e.createVNode(C,{value:b.value.form.index,"onUpdate:value":w[4]||(w[4]=M=>b.value.form.index=M)},null,8,["value"])]),_:1}),e.createVNode(_,{label:"按钮大小"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.size,"onUpdate:value":w[5]||(w[5]=M=>b.value.form.size=M),options:[{value:"small",label:"小"},{value:"middle",label:"中"},{value:"large",label:"大"}]},null,8,["value"])]),_:1}),e.createVNode(_,{label:"按钮特性"},{default:e.withCtx(()=>[e.createVNode(E,{checked:b.value.form.props.block,"onUpdate:checked":w[6]||(w[6]=M=>b.value.form.props.block=M)},{default:e.withCtx(()=>w[24]||(w[24]=[e.createTextVNode("自适应 ")])),_:1},8,["checked"]),e.createVNode(E,{checked:b.value.form.props.danger,"onUpdate:checked":w[7]||(w[7]=M=>b.value.form.props.danger=M)},{default:e.withCtx(()=>w[25]||(w[25]=[e.createTextVNode("危险 ")])),_:1},8,["checked"]),e.createVNode(E,{checked:b.value.form.props.ghost,"onUpdate:checked":w[8]||(w[8]=M=>b.value.form.props.ghost=M)},{default:e.withCtx(()=>w[26]||(w[26]=[e.createTextVNode("幽灵 ")])),_:1},8,["checked"])]),_:1})]),_:1}),e.createVNode(S,{key:"action",tab:"响应设置"},{default:e.withCtx(()=>[e.createVNode(_,{label:"响应方式",required:""},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.action.type,"onUpdate:value":w[9]||(w[9]=M=>b.value.form.action.type=M),options:[{value:"link",label:"连接"},{value:"route",label:"路由"},{value:"drawer",label:"抽屉"},{value:"dialog",label:"对话框"}]},null,8,["value"])]),_:1}),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:0,label:"页面编码",help:"根据该页面编码渲染页面内容"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.psn,"onUpdate:value":w[10]||(w[10]=M=>b.value.form.action.psn=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:1,label:"组件名称",help:"组件方式渲染,Vue全局注册的组件名称,且监听params参数,psn参数"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.component,"onUpdate:value":w[11]||(w[11]=M=>b.value.form.action.component=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(_,{label:"连接地址"},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.href,"onUpdate:value":w[12]||(w[12]=M=>b.value.form.action.href=M)},null,8,["value"])]),_:1}),["link","route"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:2,label:"连接方式"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.action.target,"onUpdate:value":w[13]||(w[13]=M=>b.value.form.action.target=M),options:[{value:"_blank",label:"新卡片页"},{value:"_self",label:"当前页面"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:3,label:"抽屉位置"},{default:e.withCtx(()=>[e.createVNode(v,{value:b.value.form.action.position,"onUpdate:value":w[14]||(w[14]=M=>b.value.form.action.position=M),options:[{value:"left",label:"左侧"},{value:"right",label:"右侧"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:4,label:"显示标题",required:""},{default:e.withCtx(()=>[e.createVNode(V,{value:b.value.form.action.title,"onUpdate:value":w[15]||(w[15]=M=>b.value.form.action.title=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:5,label:"蒙层关闭"},{default:e.withCtx(()=>[e.createVNode(A,{checked:b.value.form.action.maskClosable,"onUpdate:checked":w[16]||(w[16]=M=>b.value.form.action.maskClosable=M),"checked-children":"开","un-checked-children":"关"},null,8,["checked"])]),_:1})):e.createCommentVNode("",!0),["drawer","dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:6,label:"显示宽度"},{default:e.withCtx(()=>[e.createVNode(C,{value:b.value.form.action.width,"onUpdate:value":w[17]||(w[17]=M=>b.value.form.action.width=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["dialog"].includes(b.value.form.action.type)?(e.openBlock(),e.createBlock(_,{key:7,label:"显示高度"},{default:e.withCtx(()=>[e.createVNode(C,{value:b.value.form.action.height,"onUpdate:value":w[18]||(w[18]=M=>b.value.form.action.height=M)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(T,{orientation:"left"},{default:e.withCtx(()=>[w[29]||(w[29]=e.createTextVNode("参数列表 ")),e.createVNode(O,{size:"small",class:"param-btn",onClick:c},{default:e.withCtx(()=>w[27]||(w[27]=[e.createTextVNode("添加")])),_:1}),e.createVNode(O,{size:"small",class:"param-btn",danger:"",onClick:h},{default:e.withCtx(()=>w[28]||(w[28]=[e.createTextVNode("删除")])),_:1})]),_:1}),e.createVNode(I,{columns:o.value,"data-source":b.value.form.action.params,bordered:"",pagination:!1,"row-selection":a.value,"row-key":"name",size:"small"},{headerCell:e.withCtx(({column:M})=>[["name","title"].includes(M.key)?(e.openBlock(),e.createElementBlock("span",bd,[e.createVNode(B),e.createTextVNode(" "+e.toDisplayString(M.title),1)])):e.createCommentVNode("",!0),["value"].includes(M.key)?(e.openBlock(),e.createBlock($,{key:1,title:"支持常量和变量,变量使用{row.属性}方式获取"},{default:e.withCtx(()=>[e.createElementVNode("span",null,[e.createVNode(B),e.createTextVNode(" "+e.toDisplayString(M.title),1)])]),_:2},1024)):e.createCommentVNode("",!0)]),bodyCell:e.withCtx(({column:M,text:Q,record:D,index:R})=>[["name","title","value"].includes(M.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["edit-field",(!s.value[R]||!Object.keys(s.value[R]).includes(M.dataIndex))&&!Q&&"empty"]),onClick:J=>d(R,D,M.dataIndex)},[s.value[R]&&Object.keys(s.value[R]).includes(M.dataIndex)?e.withDirectives((e.openBlock(),e.createBlock(V,{key:0,value:s.value[R][M.dataIndex],"onUpdate:value":J=>s.value[R][M.dataIndex]=J,onBlur:J=>f(R,D,M.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[i]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(Q),1)],64))],10,yd)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])]),_:1}),e.createVNode(S,{key:"event",tab:"事件设置"},{default:e.withCtx(()=>[e.createVNode(_,{label:"点击事件",help:b.value.helps.clickScript||"点击事件处理脚本,上下文参数:ctx,当前按钮对象:btn,当前事件对象:event,返回false则不触发默认逻辑"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.clickScript,"onUpdate:modelValue":w[19]||(w[19]=M=>b.value.form.event.clickScript=M),placeholder:"请输入点击事件处理脚本",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),e.createVNode(_,{label:"禁用逻辑",help:b.value.helps.disableScript||"按钮禁用逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回true禁用,否则可用"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.disableScript,"onUpdate:modelValue":w[20]||(w[20]=M=>b.value.form.event.disableScript=M),placeholder:"请输入按钮禁用逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),e.createVNode(_,{label:"显示逻辑",help:b.value.helps.visibleScript||"按钮显示逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回false隐藏,否则可见"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.visibleScript,"onUpdate:modelValue":w[21]||(w[21]=M=>b.value.form.event.visibleScript=M),placeholder:"请输入按钮显示逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),e.createVNode(_,{label:"动态标题",help:b.value.helps.titleScript||"按钮显示标题控制脚本,上下文参数:ctx,当前按钮对象:btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(tn.Codemirror),{modelValue:b.value.form.event.titleScript,"onUpdate:modelValue":w[22]||(w[22]=M=>b.value.form.event.titleScript=M),placeholder:"请输入按钮动态标题逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:x.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"])]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["visible","title"])}}}),Z=(t,n)=>{const l=t.__vccOpts||t;for(const[o,a]of n)l[o]=a;return l},dl=Z(vd,[["__scopeId","data-v-18621ac1"]]),kd={key:0,class:"widget-opts"},wd={class:"widget-setting-dialog"},ht=Z(e.defineComponent({name:"UnioneWidget",__name:"widget",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},settingTitle:{type:String,default:"组件设置"},custome:{type:Boolean,default:!1},model:{type:String}},emits:["setting","saving"],setup(t,{expose:n,emit:l}){const o=t,a=l,i=e.ref(),s=e.ref(),r=e.ref(!1);function d(){s.value&&(r.value=!0),a("setting")}function f(){a("saving"),r.value=!1}function c(){return i.value?.clientHeight}function h(){return i.value?.clientWidth}const p=e.computed(()=>o.model||o.engine?.model||"run"),m=e.computed(()=>{const u=o.engine?.widgetActive||{};return u.wid?u.wid==o.wid:!1});function x(){o.engine&&o.wid&&p.value=="edit"&&(console.log("widget click,wid:"+o.wid+",widget",o.engine.$widgetMap[o.wid]),o.engine.ebus.$emit("cmd:exec",{name:"setActive",params:o.wid}))}function b(){o.engine&&o.wid&&o.engine.ebus.$emit("cmd:exec",{name:"del",params:o.wid})}function g(){o.engine&&o.wid&&o.engine.ebus.$emit("cmd:exec",{name:"copy",params:o.wid})}return n({getHeight:c,getWidth:h}),(u,y)=>{const N=e.resolveComponent("CopyOutlined"),k=e.resolveComponent("DeleteOutlined"),w=e.resolveComponent("SettingOutlined"),V=e.resolveComponent("a-tooltip"),_=e.resolveComponent("a-modal");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["unione-widget",p.value,m.value&&"active"]),ref_key:"widgetDom",ref:i,onClick:e.withModifiers(x,["stop"])},[p.value=="edit"?(e.openBlock(),e.createElementBlock("div",kd,[e.createVNode(N,{class:"opt",onClick:e.withModifiers(g,["stop"])}),e.createVNode(k,{class:"opt",onClick:e.withModifiers(b,["stop"])}),e.createVNode(V,{title:t.settingTitle},{default:e.withCtx(()=>[u.$slots["widget-setting"]||t.custome?(e.openBlock(),e.createBlock(w,{key:0,class:"widget-setting opt",onClick:d})):e.createCommentVNode("",!0)]),_:1},8,["title"])])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},void 0,!0),p.value=="edit"&&u.$slots["widget-setting"]?(e.openBlock(),e.createBlock(_,{key:1,title:t.settingTitle,ref_key:"settingModal",ref:s,open:r.value,"onUpdate:open":y[0]||(y[0]=v=>r.value=v),centered:"",width:"80%",onOk:f},{default:e.withCtx(()=>[e.createElementVNode("div",wd,[e.renderSlot(u.$slots,"widget-setting",{},void 0,!0)])]),_:3},8,["title","open"])):e.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-5ce8d58a"]]),Cd={class:"title"},Ad={class:"opts"},xd=["src"],Nd={class:"head-title"},_d={class:"title"},Sd={class:"opts"},Vd=["src"],Bd=Z(e.defineComponent({name:"UnioneBtn",__name:"btn",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},disabled:{type:Boolean,default:!1},type:{type:String},widget:{type:Object,required:!0,default(){return{}}},preset:{type:Array,default(){return[]}},ctx:{type:Object,default(){return{}}}},emits:["click"],setup(t,{emit:n}){const l=Le(),o=t,a=e.getCurrentInstance(),i=e.computed(()=>a?.appContext?.app),s=P.useSession(),r=e.computed(()=>o.engine?.widget(o.wid)||o.widget||{});e.watch(()=>r.value.event,()=>{f()},{deep:!0}),e.onMounted(()=>{f()});const d=e.ref({});function f(){r.value?.event&&(r.value.event.clickScript?d.value.click=new Function("ctx","btn","event",r.value.event.clickScript):typeof r.value.event.click=="function"?d.value.click=r.value.event.click:r.value.event.click?.enable&&r.value.event.click.scriptText&&(d.value.click=new Function("ctx","btn","event",r.value.event.click.scriptText)),r.value.event.disableScript?d.value.disable=new Function("ctx","btn",r.value.event.disableScript):typeof r.value.event.disable=="function"?d.value.disable=r.value.event.disable:r.value.event.disable?.enable&&r.value.event.disable.scriptText&&(d.value.disable=new Function("ctx","btn",r.value.event.disable.scriptText)),r.value.event.visibleScript?d.value.visible=new Function("ctx","btn",r.value.event.visibleScript):typeof r.value.event.visible=="function"?d.value.visible=r.value.event.visible:r.value.event.visible?.enable&&r.value.event.visible.scriptText&&(d.value.visible=new Function("ctx","btn",r.value.event.visible.scriptText)),r.value.event.titleScript?d.value.title=new Function("ctx","btn",r.value.event.titleScript):typeof r.value.event.title=="function"?d.value.title=r.value.event.title:r.value.event.title?.enable&&r.value.event.title.scriptText&&(d.value.title=new Function("ctx","btn",r.value.event.title.scriptText)))}const c=e.computed(()=>d.value.title?d.value.title(b.value,r.value):typeof r.value.title=="function"?r.value.title(b.value,r.value):r.value.title),h=e.computed(()=>d.value.visible?d.value.visible(b.value,r.value)!=!1:r.value.visible!=!1),p=e.computed(()=>o.disabled==!0?!0:d.value.disable?d.value.disable(b.value,r.value):r.value.disable==!0),m=e.ref(null);function x(){m.value?.open(r.value,C=>{console.log("btn props",C),Object.keys(C).forEach(E=>{r.value[E]=C[E]}),console.log("props btn",r.value)})}const b=e.computed(()=>({...o.ctx,user:s.getPrincipal(),token:s.getToken()})),g=e.ref({open:!1,ismax:!1}),u=e.computed(()=>{if(r.value.action?.href){let C=r.value.action.href;const E=C.matchAll("{[a-zA-Z.]*}"),S=[];let A=null;for(;A=E.next();){if(A&&A.value&&A.value[0]){let O=A.value[0].substring(1,A.value[0].length-1);S.includes(O)||S.push(O)}if(A.done)break}if(S.length>0)for(let O=0;O<S.length;O++){let T=S[O],B=P.utils.obj.getValue(b.value,T);B?B instanceof Object?C=C.replaceAll("{"+T+"}",JSON.stringify(B)):Array.isArray(B)?C=C.replaceAll("{"+T+"}",B.join(",")):C=C.replaceAll("{"+T+"}",B):C=C.replaceAll("{"+T+"}","")}return C.indexOf("?")==-1&&(C+="?"),(!r.value.action.component||r.value.action.component=="iframe")&&(C=C+"&isIframe=1"),C}return""}),y=e.computed(()=>{const C={};let E=r.value.action?.href||r.value.action?.link;if(E){const S=E.matchAll("{[a-zA-Z0-9.]*}"),A=[];let O=null;for(;O=S.next();){if(O&&O.value&&O.value[0]){let B=O.value[0].substring(1,O.value[0].length-1);A.includes(B)||A.push(B)}if(O.done)break}if(A.length>0)for(let B=0;B<A.length;B++){let $=A[B],I=P.utils.obj.getValue(b.value,$);I?I instanceof Object?E=E.replaceAll("{"+$+"}",JSON.stringify(I)):Array.isArray(I)?E=E.replaceAll("{"+$+"}",I.join(",")):E=E.replaceAll("{"+$+"}",I):E=E.replaceAll("{"+$+"}","")}const T=E.split("?")[1];T&&T.split("&").forEach(B=>{const $=B.split("=");$[0]&&$[1]&&(C[$[0]]=$[1])})}return r.value.action?.params&&r.value.action.params.filter(S=>S.value+"").forEach(S=>{if(new RegExp("\\{[a-zA-Z0-9\\.]*\\}").test(S.value)){let O=P.utils.obj.getValue(b.value,S.value);C[S.name]=O}else C[S.name]=S.value}),C}),N=n,k=e.inject("route"),w=e.inject("router");function V(C){if(l.isDebug&&console.log("unione btn click",r.value,C),!(d.value.click&&d.value.click(b.value,r.value,C)==!1)){if(r.value.action?.type=="drawer"||r.value.action?.type=="dialog"){g.value.open=!0;return}else if(r.value.action?.type=="route"){if(r.value.action.component&&i.value?.component(r.value.action.component)){const E=r.value.action.psn,S=k.path+"/"+r.value.name,A=r.value.action.title||r.value.title||r.value.label||r.value.name,O=k.name+":"+r.value.name;w.hasRoute(O)||w.addRoute(k.name,{path:S,name:O,title:A,component:i.value.component(r.value.action.component)}),w.push({path:S,query:{...y.value,psn:E}});return}if(r.value.action?.href||r.value.action?.link){if(r.value.action.link&&o.engine?.type.value=="code")return;w.push({path:r.value.action.href||r.value.action?.link,query:y.value});return}}N("click",{btn:r.value,event:C,ctx:b.value})}}function _(C){N("click",C)}function v(){o.engine?.ebus.$emit("table-list-search")}return(C,E)=>{const S=e.resolveComponent("a-button"),A=e.resolveComponent("unione-btn"),O=e.resolveComponent("a-dropdown"),T=e.resolveComponent("FullscreenOutlined"),B=e.resolveComponent("FullscreenExitOutlined"),$=e.resolveComponent("CloseOutlined"),I=e.resolveComponent("a-drawer"),F=e.resolveComponent("a-modal");return r.value.enable!=!1&&h.value?(e.openBlock(),e.createBlock(ht,{key:0,class:e.normalizeClass(["unione-btn",r.value.props?.block&&"unione-btn-block"]),model:t.engine?.model.value,onSetting:x,custome:!0,"setting-title":"按钮设置"},{default:e.withCtx(()=>[!r.value.widget||r.value.widget=="button"||r.value.widget=="unione-button"?(e.openBlock(),e.createBlock(S,e.mergeProps({key:0,disabled:p.value,size:r.value.size||"small",type:t.type||t.widget.type,shape:r.value.shape,class:"unione-btn-"+r.value.name,loading:r.value.loading,target:r.value.action?.target,title:r.value.tooltip,onClick:V},r.value.props),e.createSlots({default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value)+" ",1)]),_:2},[r.value.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.icon)))]),key:"0"}:void 0]),1040,["disabled","size","type","shape","class","loading","target","title"])):e.createCommentVNode("",!0),r.value.widget=="dropdown"?(e.openBlock(),e.createBlock(O,{key:1,trigger:[r.value.trigger||"hover"],class:e.normalizeClass([r.value.size||"small"])},{overlay:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["dropdown-overlay",r.value.layout])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.items,j=>(e.openBlock(),e.createBlock(A,{key:j.name,class:"item",widget:j,engine:t.engine,preset:t.preset,ctx:t.ctx,onClick:E[0]||(E[0]=U=>_(U))},null,8,["widget","engine","preset","ctx"]))),128))],2)]),default:e.withCtx(()=>[e.createVNode(S,{size:r.value.size||"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["size"])]),_:1},8,["trigger","class"])):e.createCommentVNode("",!0),r.value.action?.type=="drawer"?(e.openBlock(),e.createBlock(I,{key:2,class:"unione-btn-drawer",open:g.value.open,"onUpdate:open":E[4]||(E[4]=j=>g.value.open=j),placement:r.value.action?.position,maskClosable:r.value.action?.maskClosable,width:g.value.ismax?"100%":r.value.action?.width,closable:!1,bodyStyle:{padding:0,overflow:!r.value.action.component||r.value.action.component=="iframe"?"hidden":"auto"}},{title:e.withCtx(()=>[e.createElementVNode("div",Cd,[r.value.action?.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action?.icon),{key:0,style:{"margin-right":"5px"}})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.value.action?.title),1)])]),extra:e.withCtx(()=>[e.createElementVNode("div",Ad,[g.value.ismax?(e.openBlock(),e.createBlock(B,{key:1,class:"opt",onClick:E[2]||(E[2]=j=>g.value.ismax=!1)})):(e.openBlock(),e.createBlock(T,{key:0,class:"opt",onClick:E[1]||(E[1]=j=>g.value.ismax=!0)})),e.createVNode($,{class:"opt",onClick:E[3]||(E[3]=j=>g.value.open=!1)})])]),footer:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["footer-btn","btn-"+r.value.wid])},null,2)]),default:e.withCtx(()=>[!r.value.action.component||r.value.action.component=="iframe"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:u.value},null,8,xd)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action.component),{key:1,psn:r.value.action.psn,params:y.value,actype:"drawer",teleport:".btn-"+r.value.wid,onReloadTableList:v},null,40,["psn","params","teleport"]))]),_:1},8,["open","placement","maskClosable","width","bodyStyle"])):e.createCommentVNode("",!0),r.value.action?.type=="dialog"?(e.openBlock(),e.createBlock(F,{key:3,class:"unione-btn-dialog",open:g.value.open,"onUpdate:open":E[8]||(E[8]=j=>g.value.open=j),width:g.value.ismax?"100%":r.value.action?.width,"wrap-class-name":[g.value.ismax&&"unione-modal-full"],maskClosable:r.value.action?.maskClosable,centered:"",closable:!1},{title:e.withCtx(()=>[e.createElementVNode("div",Nd,[e.createElementVNode("div",_d,[r.value.action?.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action?.icon),{key:0,style:{"margin-right":"5px"}})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(r.value.action?.title),1)]),e.createElementVNode("div",Sd,[g.value.ismax?(e.openBlock(),e.createBlock(B,{key:1,class:"opt",onClick:E[6]||(E[6]=j=>g.value.ismax=!1)})):(e.openBlock(),e.createBlock(T,{key:0,class:"opt",onClick:E[5]||(E[5]=j=>g.value.ismax=!0)})),e.createVNode($,{class:"opt",onClick:E[7]||(E[7]=j=>g.value.open=!1)})])])]),footer:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["footer-btn","btn-"+r.value.wid])},null,2)]),default:e.withCtx(()=>[!r.value.action.component||r.value.action.component=="iframe"?(e.openBlock(),e.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:u.value,style:e.normalizeStyle({height:r.value.action?.height?r.value.action?.height+"px":""})},null,12,Vd)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.action.component),{key:1,psn:r.value.action.psn,params:y.value,actype:"dialog",teleport:".btn-"+r.value.wid,onReloadTableList:v},null,40,["psn","params","teleport"]))]),_:1},8,["open","width","wrap-class-name","maskClosable"])):e.createCommentVNode("",!0),e.createVNode(dl,{ref_key:"btnSetting",ref:m,preset:o.preset},null,8,["preset"])]),_:1},8,["class","model"])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-664f71aa"]]);function be(t,n=350){let l=null;return o=>{clearTimeout(l),l=setTimeout(()=>{t(o)},n)}}const Ed=e.defineComponent({name:"UnioneWidgetRender",__name:"render",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},define:{type:Object,required:!1},widget:{type:Object,required:!0}},setup(t){const n=t,l=e.computed(()=>n.engine?.widget(n.wid)||n.widget||{}),o=e.computed(()=>n.define?e.defineAsyncComponent(()=>Promise.resolve(n.define)):l.value.widget);return e.watch(()=>n.define?.style,be(a=>{if(!n.define)return;a&&(a=a.replace(/\.([a-zA-Z0-9_-]+)/g,"."+n.define.widget+" .$1"),a=a.replace("."+n.define.widget+" ."+n.define.widget,"."+n.define.widget));const i=document.querySelector('style[data-widget="'+n.define.widget+'"]');if(i)i.innerHTML=a;else{const s=document.createElement("style");s.setAttribute("data-widget",n.define.widget+""),s.innerHTML=a,document.head.appendChild(s)}},500),{immediate:!0}),(a,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.mergeProps({wid:t.wid,engine:t.engine,widget:l.value,class:l.value.widget},l.value.props),null,16,["wid","engine","widget","class"]))}}),Od={key:1},Td={key:1,class:"widget-container"},Rd=e.defineComponent({name:"UnioneContainer",__name:"container",props:e.mergeModels({wid:{type:String,required:!1},widget:{type:Object,required:!1},engine:{type:Object,required:!1},disabled:{type:Boolean,default:!1}},{formValue:{type:Object,required:!1,default:()=>{}},formValueModifiers:{}}),emits:["update:formValue"],setup(t){const n=t,l=e.useModel(t,"formValue"),o=e.ref([]),a=e.computed(()=>n.engine&&n.wid?n.engine.$widgetMap[n.wid]||n.widget||{}:n.widget||{});e.watch(()=>a.value,()=>{a.value?.widgets?o.value=[...a.value.widgets]:o.value=[]},{deep:!0,immediate:!0});const i=e.computed(()=>n.engine?.model||"run");function s(r){if(console.log("handleChange",r),r.added&&n.engine&&(r.added.element.index=r.added.newIndex,r.added.element.pid=a.value?.wid||"",n.engine.ebus.$emit("cmd:exec",{name:"add",params:r.added.element})),r.moved&&n.engine){const d=r.moved.element;n.engine.ebus.$emit("cmd:exec",{name:"move",params:{wid:d.wid,pid:d.pid,oldIndex:r.moved.oldIndex,newIndex:r.moved.newIndex}})}}return(r,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["unione-container",i.value])},[a.value&&t.engine&&i.value=="edit"?(e.openBlock(),e.createBlock(e.unref(On),{key:0,class:"widget-container",group:"widget-container",list:o.value,onChange:s,"item-key":"wid"},{item:e.withCtx(({element:f})=>[f.widget?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.widget),e.mergeProps({key:0,widget:f,engine:t.engine,disabled:t.disabled,formValue:l.value,"onUpdate:formValue":d[0]||(d[0]=c=>l.value=c)},f.props),null,16,["widget","engine","disabled","formValue"])):(e.openBlock(),e.createElementBlock("div",Od,"组件为空名称:"+e.toDisplayString(f.title||f.id),1))]),_:1},8,["list"])):(e.openBlock(),e.createElementBlock("div",Td,[e.renderSlot(r.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.wid},[f.widget?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.widget),e.mergeProps({key:0,widget:f,engine:t.engine,disabled:t.disabled,formValue:l.value,"onUpdate:formValue":d[1]||(d[1]=c=>l.value=c),ref_for:!0},f.props),null,16,["widget","engine","disabled","formValue"])):e.createCommentVNode("",!0)],64))),128))])]))],2))}}),Fd={key:0,class:"unione-widget-empty-tip"},$d=Z(e.defineComponent({name:"UnioneTabs",__name:"tabs",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1}},{formValue:{type:Object,default:()=>{}},formValueModifiers:{}}),emits:["update:formValue"],setup(t){const n=t,l=e.useModel(t,"formValue"),o=e.ref(),a=e.computed(()=>n.engine?.widget(n.wid)||n.widget);return e.watch(()=>a.value?.widgets,()=>{o.value&&!a.value?.widgets.find(s=>s.wid===o.value)&&a.value?.widgets.length&&(o.value=a.value?.widgets[0]?.wid)}),e.onMounted(()=>{o.value=a.value?.widgets[0]?.wid}),(i,s)=>{const r=e.resolveComponent("UnioneContainer"),d=e.resolveComponent("a-tab-pane"),f=e.resolveComponent("a-tabs");return e.openBlock(),e.createBlock(ht,{class:e.normalizeClass(["unione-layout","unione-layout-tabs"]),wid:a.value.wid,engine:n.engine},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(f,e.mergeProps({key:0,activeKey:o.value,"onUpdate:activeKey":s[1]||(s[1]=c=>o.value=c)},a.value.props),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.widgets,c=>(e.openBlock(),e.createBlock(d,{class:"unione-layout-tab-pane",key:c.wid},{tab:e.withCtx(()=>[e.createElementVNode("span",null,[c.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.icon),{key:0})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(c.title),1)])]),default:e.withCtx(()=>[e.createVNode(r,{engine:t.engine,wid:c.wid,widget:c,formValue:l.value,"onUpdate:formValue":s[0]||(s[0]=h=>l.value=h)},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default",{},void 0,!0)]),_:2},1032,["engine","wid","widget","formValue"]),c.widgets.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fd,e.toDisplayString(c.emptyTips),1))]),_:2},1024))),128))]),_:3},16,["activeKey"])):e.createCommentVNode("",!0)]),_:3},8,["wid","engine"])}}}),[["__scopeId","data-v-d6fb1cbe"]]),Id={class:"title"},Md={class:"text"},Dd={key:0,class:"reactive"},Ud={key:1,class:"opts"},Ld={class:"warp"},jd=Z(e.defineComponent({name:"UnioneSection",__name:"section",props:e.mergeModels({title:{type:String,required:!1},icon:{type:String,required:!1},type:{type:String,required:!1},location:{type:String,default:"left"},reactive:{type:Boolean,default:!1},wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1}},{formValue:{type:Object,default:()=>{}},formValueModifiers:{},modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:formValue","update:modelValue"],setup(t){const n=t,l=e.useModel(t,"formValue"),o=e.computed(()=>n.engine?.widget(n.wid)||n.widget||{}),a=e.computed(()=>o.value?.title||n.title),i=e.computed(()=>o.value?.props?.icon||n.icon),s=e.computed(()=>o.value?.props?.type||n.type),r=e.computed(()=>o.value?.props?.bottomLine||!1),d=e.useModel(t,"modelValue");function f(){n.reactive&&(d.value=!d.value)}return(c,h)=>{const p=e.resolveComponent("UnioneContainer");return e.openBlock(),e.createBlock(ht,{class:e.normalizeClass(["unione-layout","unione-layout-section",d.value?"open":"close"]),wid:o.value.wid,engine:n.engine},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["head",t.location,t.reactive&&"reactive",r.value&&"bottom-line"]),onClick:f},[e.createElementVNode("div",Id,[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["type",s.value])},null,2)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:1,class:"icon"})):e.createCommentVNode("",!0),e.createElementVNode("span",Md,e.toDisplayString(a.value),1)]),t.reactive?(e.openBlock(),e.createElementBlock("div",Dd,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value?"UpOutlined":"DownOutlined")))])):e.createCommentVNode("",!0),t.location=="left"?(e.openBlock(),e.createElementBlock("div",Ud,[e.renderSlot(c.$slots,"opts",{},void 0,!0)])):e.createCommentVNode("",!0)],2),e.withDirectives(e.createElementVNode("div",Ld,[e.createVNode(p,{engine:t.engine,wid:o.value.wid,formValue:l.value,"onUpdate:formValue":h[0]||(h[0]=m=>l.value=m)},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default",{},void 0,!0)]),_:3},8,["engine","wid","formValue"])],512),[[e.vShow,d.value]])]),_:3},8,["class","wid","engine"])}}}),[["__scopeId","data-v-48cb56cd"]]),Pd={class:"unione-props-setting unione-form-setting"},qd={class:"unione-form-btns"},zd={key:0},Qd=["onClick"],Hd={class:"field-txt"},Kd=["onClick"],Yd={key:1,class:"field-txt"},Wd=["onClick"],Gd={key:0,class:"field-txt"},Jd={key:3,class:"edit-field"},Xd={key:0},Zd=["onClick"],ec=Z(e.defineComponent({__name:"formSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(t){const n=t,l=e.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:v})=>v+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),o=e.computed(()=>{const v=n.editor.widget(n.wid)||{};return v.configs||(v.configs={}),v.configs.settings||(v.configs.settings={}),v.configs.settings.btns||(v.configs.settings.btns=[]),v}),a=e.computed(()=>(n.editor.dataModels()||[]).map(C=>({value:C.sn,label:C.title+"("+C.name+")"}))),i=e.computed(()=>{const v=o.value.configs.settings.btns,C=v.map(E=>E.name);if(!C.includes("save")){const E={title:"保存",type:"primary",index:0,visible:!0,name:"save"};v.splice(E.index,0,E)}if(!C.includes("submit")){const E={title:"提交",type:"primary",index:1,visible:!0,name:"submit"};let S=E.index||1;v.splice(S,0,E)}if(!C.includes("reset")){const E={title:"重置",type:"default",index:2,visible:!0,props:{danger:!0},name:"reset"};v.splice(E.index,0,E)}if(!C.includes("back")){const E={title:"返回",type:"default",index:3,visible:!0,name:"back"};v.splice(E.index,0,E)}return v}),s=e.ref(null);function r(v){s.value&&s.value.open(v,C=>{C.visible=!0,Object.keys(C).forEach(E=>{v[E]=C[E]}),o.value.configs.settings.btns.sort((E,S)=>{const A=E.index||1,O=S.index||1;return A-O}),o.value.configs.settings.btns=[...o.value.configs.btns]})}function d(){const v=o.value.configs.settings.btns.length+1;let C={title:"新增",name:"new_"+v,index:v,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};C.name="new_"+o.value.configs.settings.btns.length;const E=o.value.configs.settings.btns.filter(S=>S.name==C.name).length;E>0&&(C.name=C.name+E),o.value.configs.settings.btns.push(C),n.editor.widget(n.wid,o.value),s.value.open(C,S=>{Object.keys(S).forEach(A=>{C[A]=S[A]}),o.value.configs.btns=[...o.value.configs.btns]})}function f(v){const C=()=>{if(["save","submit","reset","back"].includes(v.name))v.visible=!1,o.value.configs.settings.btns=[...o.value.configs.settings.btns];else{const E=[];o.value.configs.settings.btns.forEach(S=>{S.name!=v.name&&E.push(S)}),o.value.configs.settings.btns=E}};te.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{C()}})}const c=e.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:v=>{const C=c.value.widgets.filter(E=>E.value==v);return C[0]?C[0].label:v},toSetting:()=>{}}),h=e.ref({visible:!1,field:{},props:{},showInfo:v=>{let C="";return v.rules&&(C=v.rules.filter(E=>E.enable).length||""),C&&(C="("+C+")"),C},toSetting:()=>{const v=h.value.props,C={name:"range",trigger:v.trigger,whitespace:v.whitespace,message:v.rangeMessage};v.rangeMin!=null&&v.rangeMin!=null&&(C.min=v.rangeMin,C.enable=!0),v.rangeMax!=null&&v.rangeMax!=null&&(C.max=v.rangeMax,C.enable=!0);const E={name:"reg",trigger:v.trigger,whitespace:v.whitespace,message:v.regMessage};v.regExpress&&(E.pattern=v.regExpress,E.enable=!0),h.value.field.rules=[C,E],h.value.visible=!1,h.value.props={},console.log("rule",h.value.field.rules)}});function p(v){h.value.visible=!0,h.value.field=v;const C=v.rules||[],E={trigger:"change",whitespace:!0};C.forEach(S=>{S.name=="reg"&&(E.trigger=S.trigger,E.whitespace=S.whitespace,E.regExpress=S.pattern,E.regMessage=S.message),S.name=="range"&&(E.rangeMin=S.min,E.rangeMax=S.max,E.rangeMessage=S.message)}),h.value.props=E}const m=e.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{m.value.visible=!1}});function x(v,C){const E=y.value.filter(A=>A.name==v.name);E.forEach(A=>{C!="isSort"?A[C]=!0:A[C]=!A[C]});const S=E[0];if(!(!S||C=="isSort")){switch(m.value.prop=C,m.value.field=v,S.show||(S.show={}),C){case"isQuery":S.show.query||(S.show.query={}),m.value.show=S.show.query,m.value.title=`查询设置/${v.title}(${v.name})`;break;case"isForm":S.show.form||(S.show.form={}),m.value.show=S.show.form,m.value.title=`表单设置/${v.title}(${v.name})`;break;case"isView":S.show.view||(S.show.view={}),m.value.show=S.show.view,m.value.title=`详情设置/${v.title}(${v.name})`;break;case"isList":S.show.list||(S.show.list={}),m.value.show=S.show.list,m.value.title=`列头设置/${v.title}(${v.name})`;break}m.value.visible=!0}}const b=e.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{b.value.convert.options||(b.value.convert.options=[]),b.value.convert.options.push({label:"",value:""})},toDelOption:(v,C)=>{b.value.convert.options.splice(v,1)},toSetting:()=>{b.value.visible=!1}});function g(v){b.value.visible=!0,b.value.field=v,b.value.convert=v.convert||{}}const u=e.computed(()=>n.editor?.dataModel(o.value.dataModel||"none")||{}),y=e.computed(()=>u.value.fields?.length?u.value.fields:[]),N={mounted:v=>v.focus()},k=e.ref({});function w(v,C){const E={};C=="convertName"?E[C]=v.convert?.type:E[C]=v[C]||"",k.value={},k.value[v.name]=E}function V(v,C){{k.value={};return}}function _(v,C){y.value.filter(S=>S.name==v.name).forEach(S=>{S[C]=!S[C]})}return(v,C)=>{const E=e.resolveComponent("a-divider"),S=e.resolveComponent("CloseOutlined"),A=e.resolveComponent("a-button"),O=e.resolveComponent("PlusOutlined"),T=e.resolveComponent("a-select"),B=e.resolveComponent("ToolOutlined"),$=e.resolveComponent("a-checkbox"),I=e.resolveComponent("a-table"),F=e.resolveComponent("a-select-option"),j=e.resolveComponent("a-form-item"),U=e.resolveComponent("a-form"),M=e.resolveComponent("a-modal"),Q=e.resolveComponent("a-checkbox-group"),D=e.resolveComponent("a-input-number"),R=e.resolveComponent("a-input"),J=e.resolveComponent("a-col"),q=e.resolveComponent("a-row");return e.openBlock(),e.createElementBlock("div",Pd,[e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[23]||(C[23]=[e.createTextVNode("按钮设置")])),_:1}),e.createElementVNode("div",qd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,L=>(e.openBlock(),e.createBlock(A,e.mergeProps({key:L.name,class:["btn",L.name,!L.visible&&"deleted"],type:L.visible?L.type:"default",size:L.size,ref_for:!0},L.props||{},{onClick:ee=>r(L)}),e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(L.title)+" ",1),L.visible?(e.openBlock(),e.createBlock(S,{key:0,class:"btn-del",onClick:e.withModifiers(ee=>f(L),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)]),_:2},[L.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(L.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),e.createVNode(A,{class:e.normalizeClass(["btn","btn-add"]),size:"small",onClick:C[0]||(C[0]=L=>d())},{default:e.withCtx(()=>[e.createVNode(O)]),_:1})]),e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[24]||(C[24]=[e.createTextVNode("表单设置")])),_:1}),C[36]||(C[36]=e.createTextVNode(" 数据模型:")),e.createVNode(T,{class:"data-model-list",options:a.value,value:o.value.dataModel,"onUpdate:value":C[1]||(C[1]=L=>o.value.dataModel=L)},null,8,["options","value"]),e.createVNode(I,{columns:l.value,"data-source":y.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:e.withCtx(({column:L})=>[["widget","rules","convertName"].includes(L.key)?(e.openBlock(),e.createElementBlock("span",zd,[e.createVNode(B),e.createTextVNode(" "+e.toDisplayString(L.title),1)])):e.createCommentVNode("",!0)]),bodyCell:e.withCtx(({column:L,text:ee,record:Y})=>[["rules"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["edit-field",!h.value.showInfo(Y)&&"empty"]),onClick:se=>p(Y)},[e.createElementVNode("span",Hd,e.toDisplayString(h.value.showInfo(Y)),1),h.value.showInfo(Y)?(e.openBlock(),e.createBlock(A,{key:0,type:"link"},{default:e.withCtx(()=>C[25]||(C[25]=[e.createTextVNode("设置")])),_:1})):e.createCommentVNode("",!0)],10,Qd)):["widget"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["edit-field",(!k.value[Y.name]||!Object.keys(k.value[Y.name]).includes(L.dataIndex))&&!ee&&"empty"]),onClick:se=>w(Y,L.dataIndex)},[k.value[Y.name]&&Object.keys(k.value[Y.name]).includes(L.dataIndex)?e.withDirectives((e.openBlock(),e.createBlock(T,{key:0,value:Y[L.dataIndex],"onUpdate:value":se=>Y[L.dataIndex]=se,options:c.value.widgets,onBlur:C[2]||(C[2]=se=>V())},null,8,["value","onUpdate:value","options"])),[[N]]):(e.openBlock(),e.createElementBlock("span",Yd,e.toDisplayString(c.value.widgetName(ee)),1))],10,Kd)):["convertName"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["edit-field",(!k.value[Y.name]||!Object.keys(k.value[Y.name]).includes(L.dataIndex))&&!Y.convert?.type&&"empty"]),onClick:se=>w(Y,L.dataIndex)},[k.value[Y.name]&&Object.keys(k.value[Y.name]).includes(L.dataIndex)?e.withDirectives((e.openBlock(),e.createBlock(T,{key:0,value:Y[L.dataIndex],"onUpdate:value":se=>Y[L.dataIndex]=se,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],onBlur:C[3]||(C[3]=se=>V())},null,8,["value","onUpdate:value"])),[[N]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[Y.convert?.type?(e.openBlock(),e.createElementBlock("span",Gd,e.toDisplayString(Y.convert.type=="dict"?"字典":"静态"),1)):e.createCommentVNode("",!0),Y.convert?.type?(e.openBlock(),e.createBlock(A,{key:1,type:"link",onClick:e.withModifiers(se=>g(Y),["stop"])},{default:e.withCtx(()=>C[26]||(C[26]=[e.createTextVNode("设置")])),_:2},1032,["onClick"])):e.createCommentVNode("",!0)],64))],10,Wd)):["isForm","isView"].includes(L.dataIndex)?(e.openBlock(),e.createElementBlock("div",Jd,[e.createVNode($,{checked:Y[L.dataIndex],onClick:se=>_(Y,L.dataIndex)},null,8,["checked","onClick"]),e.createVNode(A,{type:"link",onClick:se=>x(Y,L.dataIndex)},{default:e.withCtx(()=>C[27]||(C[27]=[e.createTextVNode("设置")])),_:2},1032,["onClick"])])):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),e.createVNode(M,{visible:c.value.visible,"onUpdate:visible":C[5]||(C[5]=L=>c.value.visible=L),title:"控件设置",onOk:c.value.toSetting},{default:e.withCtx(()=>[e.createVNode(U,{model:c.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:e.withCtx(()=>[c.value.field.widget=="a-select"?(e.openBlock(),e.createBlock(j,{key:0,label:"下拉框类型"},{default:e.withCtx(()=>[e.createVNode(T,{value:c.value.props.mode,"onUpdate:value":C[4]||(C[4]=L=>c.value.props.mode=L),allowClear:!0},{default:e.withCtx(()=>[e.createVNode(F,{value:"multiple"},{default:e.withCtx(()=>C[28]||(C[28]=[e.createTextVNode("多选")])),_:1}),e.createVNode(F,{value:"tags"},{default:e.withCtx(()=>C[29]||(C[29]=[e.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),e.createVNode(M,{visible:h.value.visible,"onUpdate:visible":C[13]||(C[13]=L=>h.value.visible=L),title:"规则设置",onOk:h.value.toSetting},{default:e.withCtx(()=>[e.createVNode(U,{model:h.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:e.withCtx(()=>[e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[30]||(C[30]=[e.createTextVNode("基本设置")])),_:1}),e.createVNode(j,{label:"触发时机"},{default:e.withCtx(()=>[e.createVNode(Q,{value:h.value.props.trigger,"onUpdate:value":C[6]||(C[6]=L=>h.value.props.trigger=L),options:["change","blur"]},null,8,["value"])]),_:1}),h.value.field.isNull?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:e.withCtx(()=>[e.createVNode($,{value:h.value.props.whitespace,"onUpdate:value":C[7]||(C[7]=L=>h.value.props.whitespace=L),checked:h.value.props.whitespace},{default:e.withCtx(()=>C[31]||(C[31]=[e.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[32]||(C[32]=[e.createTextVNode("数值区间")])),_:1}),e.createVNode(j,{label:"有效区间"},{default:e.withCtx(()=>[e.createVNode(D,{value:h.value.props.rangeMin,"onUpdate:value":C[8]||(C[8]=L=>h.value.props.rangeMin=L)},null,8,["value"]),C[33]||(C[33]=e.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),e.createVNode(D,{value:h.value.props.rangeMax,"onUpdate:value":C[9]||(C[9]=L=>h.value.props.rangeMax=L)},null,8,["value"])]),_:1}),e.createVNode(j,{label:"错误提示"},{default:e.withCtx(()=>[e.createVNode(R,{value:h.value.props.rangeMessage,"onUpdate:value":C[10]||(C[10]=L=>h.value.props.rangeMessage=L)},null,8,["value"])]),_:1}),e.createVNode(E,{orientation:"left"},{default:e.withCtx(()=>C[34]||(C[34]=[e.createTextVNode("正则验证")])),_:1}),e.createVNode(j,{label:"表达式"},{default:e.withCtx(()=>[e.createVNode(R,{value:h.value.props.regExpress,"onUpdate:value":C[11]||(C[11]=L=>h.value.props.regExpress=L)},null,8,["value"])]),_:1}),e.createVNode(j,{label:"错误提示"},{default:e.withCtx(()=>[e.createVNode(R,{value:h.value.props.regMessage,"onUpdate:value":C[12]||(C[12]=L=>h.value.props.regMessage=L)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),e.createVNode(M,{visible:m.value.visible,"onUpdate:visible":C[20]||(C[20]=L=>m.value.visible=L),title:m.value.title,onOk:m.value.toSetting},{default:e.withCtx(()=>[e.createVNode(U,{model:m.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:e.withCtx(()=>[e.createVNode(j,{label:"显示顺序"},{default:e.withCtx(()=>[e.createVNode(D,{value:m.value.show.index,"onUpdate:value":C[14]||(C[14]=L=>m.value.show.index=L)},null,8,["value"])]),_:1}),["isQuery"].includes(m.value.prop)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(j,{key:0,label:"显示宽度"},{default:e.withCtx(()=>[e.createVNode(R,{value:m.value.show.width,"onUpdate:value":C[15]||(C[15]=L=>m.value.show.width=L)},null,8,["value"])]),_:1})),["isForm","isView"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:1,label:"标题宽度"},{default:e.withCtx(()=>[e.createVNode(R,{value:m.value.show.labelWidth,"onUpdate:value":C[16]||(C[16]=L=>m.value.show.labelWidth=L)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["isForm","isView"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:2,label:"控件宽度"},{default:e.withCtx(()=>[e.createVNode(R,{value:m.value.show.valueWidth,"onUpdate:value":C[17]||(C[17]=L=>m.value.show.valueWidth=L)},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:3,label:"固定位置"},{default:e.withCtx(()=>[e.createVNode(T,{value:m.value.show.fixed,"onUpdate:value":C[18]||(C[18]=L=>m.value.show.fixed=L),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(e.openBlock(),e.createBlock(j,{key:4,label:"对齐方式"},{default:e.withCtx(()=>[e.createVNode(T,{value:m.value.show.align,"onUpdate:value":C[19]||(C[19]=L=>m.value.show.align=L),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),e.createVNode(M,{visible:b.value.visible,"onUpdate:visible":C[22]||(C[22]=L=>b.value.visible=L),title:b.value.convert.type=="dict"?"字典设置":"选项设置",onOk:b.value.toSetting},{default:e.withCtx(()=>[b.value.convert.type!="dict"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createVNode(A,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:b.value.toAddOption},{default:e.withCtx(()=>C[35]||(C[35]=[e.createTextVNode("新增")])),_:1},8,["onClick"]),e.createVNode(I,{columns:b.value.optionColumn,"data-source":b.value.convert.options,size:"small"},{bodyCell:e.withCtx(({column:L,record:ee,index:Y})=>[L.dataIndex==="label"?(e.openBlock(),e.createBlock(R,{key:0,value:ee.label,"onUpdate:value":se=>ee.label=se,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0),L.dataIndex==="value"?(e.openBlock(),e.createBlock(R,{key:1,value:ee.value,"onUpdate:value":se=>ee.value=se,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):e.createCommentVNode("",!0),L.dataIndex==="action"?(e.openBlock(),e.createElementBlock("a",{key:2,onClick:se=>b.value.toDelOption(Y,ee)},"删除",8,Zd)):e.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):e.createCommentVNode("",!0),b.value.convert.type=="dict"?(e.openBlock(),e.createBlock(U,{key:1,model:b.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:e.withCtx(()=>[e.createVNode(q,{type:"flex",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(J,{span:24,order:1},{default:e.withCtx(()=>[e.createVNode(j,{label:"字典名称:"},{default:e.withCtx(()=>[e.createVNode(R,{value:b.value.convert.dict,"onUpdate:value":C[21]||(C[21]=L=>b.value.convert.dict=L)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):e.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),e.createVNode(dl,{ref_key:"btnSetting",ref:s},null,512)])}}}),[["__scopeId","data-v-c0f75bb9"]]),tc={key:0,class:"form-left"},nc={key:1,class:"form-warp"},lc={key:2,class:"form-right"},oc=Z(e.defineComponent({__name:"form",props:{wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},form:{type:Object,required:!1},model:{type:String}},emits:["onload"],setup(t,{expose:n,emit:l}){const o=t,a=l,i=e.ref(!1),s=e.ref(!1),r=e.ref(),d=e.ref({}),f=e.ref(null);e.onMounted(()=>{if(d.value||(d.value={}),o.engine?c.value=o.engine:c.value.loadConfig({widgets:p.value}),h.value.dsn){const A=c.value.dataManager();h.value.primary&&A.psn(h.value.dsn),f.value.setDisabled=v,f.value.getValue=N,f.value.setValue=k,f.value.reset=w,r.value=A.useForm(h.value.dsn,f.value,O=>{d.value=O.body||{},a("onload",d.value)})}o.form?.model&&c.value.setModel(o.form.model),V()});const c=e.ref(new Se),h=e.computed(()=>o.wid&&c.value.$widgetMap[o.wid]?c.value.$widgetMap[o.wid]:o.widget||o.form||{widgets:[]}),p=e.computed(()=>{let A=h.value.widgets||[];!A.length&&o.form?.fields&&(A=o.form.fields);const O=T=>{T.forEach(B=>{B.wid||(B.wid=en.uniqueId("w:")),B.name&&(B.widget||(B.widget="unione-form-item"),!B.control&&B.widget=="unione-form-item"&&(B.control="a-input")),B.widgets&&O(B.widgets)})};return O(A),A}),m=e.computed(()=>p.value.filter(A=>A.float=="left")),x=e.computed(()=>p.value.filter(A=>!A.float)),b=e.computed(()=>p.value.filter(A=>A.float=="right")),g=e.inject("pageSetting",{}),u=e.computed(()=>h.value.setting||o.form?.setting||g?.form||{}),y=e.computed(()=>{const A={};return u.value&&(A.labelAlign=u.value.labelAlign||"right",A.layout="horizontal",u.value.labelAlign=="top"&&(A.labelAlign="left",A.layout="vertical"),A.size=u.value.formSize||"default"),A});e.provide("formSetting",u.value),e.provide("formChanged",A=>{i.value=A});function N(){return d.value}function k(A){d.value=A||{},i.value=!0,V()}function w(){d.value={},i.value=!1,V(),c.value.ebus.$emit("form-reset")}function V(){const A=O=>{if(O.name&&(O.value||O.value==0)){if(O.event?.visible){let B=null;if(typeof O.event.visible=="function"?B=O.event.visible:O.event.visible.enable&&(B=new Function("value","ctx",O.event.visible.scriptText)),B&&!B(O.value,d.value))return}const T=P.utils.obj.getValue(d.value,O.name);(!T&&T!=0||T=="undefined")&&P.utils.obj.setValue(d.value,O.name,O.value)}O.widgets?.forEach(T=>{A(T)})};p.value.forEach(O=>{A(O)})}function _(){return new Promise((A,O)=>{f.value.validate().then(T=>{A(d.value)}).catch(T=>{O(T)})})}function v(A=!0){s.value=A,c.value.ebus.$emit("form-disabled",A)}function C(){return h.value.widgets||[]}function E(){return i.value}function S(){i.value=!1}return n({validate:_,getValue:N,setValue:k,reset:w,setDisabled:v,getWidgets:C,isChanged:E,recover:S}),(A,O)=>{const T=e.resolveComponent("UnioneContainer"),B=e.resolveComponent("a-form");return c.value?(e.openBlock(),e.createBlock(ht,{key:0,class:"unione-form-widget","setting-title":"表单设置",engine:c.value,model:t.model},e.createSlots({default:e.withCtx(()=>[e.createVNode(B,e.mergeProps({ref_key:"formObj",ref:f,model:d.value,class:["unione-form",c.value.model,"form-layout-col-"+(u.value.showColumn||1)]},y.value,{labelCol:{span:u.value.labelWidth||4},wrapperCol:{span:24-u.value.labelWidth||4}}),{default:e.withCtx(()=>[e.createVNode(T,{engine:c.value,wid:h.value.wid,disabled:s.value,formValue:d.value,"onUpdate:formValue":O[0]||(O[0]=$=>d.value=$),class:"form-widget-container"},{default:e.withCtx(()=>[m.value?.length&&d.value?(e.openBlock(),e.createElementBlock("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,$=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent($.widget),{key:$.name,widget:$,engine:c.value,disabled:s.value,formValue:d.value},null,8,["widget","engine","disabled","formValue"]))),128))])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("div",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,$=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent($.widget),e.mergeProps({key:$.name,widget:$,engine:c.value,disabled:s.value,formValue:d.value,ref_for:!0},$.props),null,16,["widget","engine","disabled","formValue"]))),128))])):e.createCommentVNode("",!0),b.value?.length&&d.value?(e.openBlock(),e.createElementBlock("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,$=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent($.widget),e.mergeProps({key:$.name,widget:$,engine:c.value,disabled:s.value,formValue:d.value,ref_for:!0},$.props),null,16,["widget","engine","disabled","formValue"]))),128))])):e.createCommentVNode("",!0)]),_:1},8,["engine","wid","disabled","formValue"])]),_:1},16,["model","class","labelCol","wrapperCol"])]),_:2},[t.engine&&h.value.wid?{name:"widget-setting",fn:e.withCtx(()=>[e.createVNode(ec,{wid:h.value.wid,editor:t.engine},null,8,["wid","editor"])]),key:"0"}:void 0]),1032,["engine","model"])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-6a03b5fc"]]);function za(t,n=!1){const l=Le();if(!t)return Promise.reject("字典名称不能为空");const o=localStorage.getItem("UNIONE-DICT-"+t);return o&&n==!1?Promise.resolve(JSON.parse(o)):(l.isDebug&&console.log("进入:加载字典数据方法,dict name:"+t+",force:"+n),new Promise((a,i)=>{P.axios.admin({url:"/api/base/dict/load/"+t}).then(s=>{if(s.success){const r=s.body.filter(d=>d.dictName!=d.dictKey);r.forEach(d=>{d.value=d.dictKey,d.label=d.dictValue}),r.length?(localStorage.setItem("UNIONE-DICT-"+t,JSON.stringify(r)),a(r)):i("字典加载失败,dict:"+t+",字典项列表为空")}else l.isDebug&&console.error("字典加载失败,dict:"+t,s),i("字典加载失败,dict:"+t+",error:"+s.message)})}))}async function Qa(t,n){const l=Le();if(n==null||n==null||n=="undefined"||!(n+"").length)return Promise.reject("字典key为空");const o=typeof n=="number"?[n+""]:n.split(","),a=await za(t),i=a.filter(s=>o.includes(s.dictKey));return i.length>0?Promise.resolve(i):(l.isDebug&&console.log("字典项匹配失败,name:"+t+",key:"+n+"options:",a),Promise.reject("字典项匹配失败,name:"+t+",key:"+n))}async function ac(t,n){const l=await Qa(t,n);return Promise.resolve(l.map(o=>o.dictValue).join(","))}const Ha={load:za,getLabel:ac,getOption:Qa};class lt{types;convertObj;config;options;constructor(n){this.config=Le(),(!n||!n.types)&&this.config.isDebug&&console.error("转换器定义不能为空,type不能为空",n),n.valueField||(n.valueField="id"),n.labelField||(n.labelField="title"),this.types=n.types,this.convertObj=n,this.options=n.options||[]}load(n,l=!1){return!(n==null||n==null||n=="undefined"||!(n+"").length)&&this.options?.length&&this.options.filter(o=>o.value==n).length?Promise.resolve(this.options):this.convertObj.types=="dict"?new Promise((o,a)=>{if(!this.convertObj.dictName)return this.config.isDebug&&console.error("字典名称不能为空,id:"+this.convertObj.id),a();Ha.load(this.convertObj.dictName,l).then(i=>{this.options=i,typeof n=="number"&&this.options.forEach(s=>{s.value=parseInt(s.value)}),o(this.options)})}):this.convertObj.types=="option"?(this.options=this.convertObj.options||[],this.convertObj.options?.length?Promise.resolve(this.convertObj.options):(this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id,this.convertObj),Promise.reject())):!this.convertObj.id&&this.convertObj.types!="local"?(this.config.isDebug&&console.error("转换器id不能为空,type:"+this.convertObj.types),Promise.reject()):new Promise((o,a)=>{const i={body:this.convertObj.params||{}};this.convertObj.pidField&&(i.pid=-1);const s=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;if(!s)return a("转换器url不能为空,type:"+this.convertObj.types+",id:"+this.convertObj.id);P.axios[this.convertObj.ctx||"admin"]({url:s,data:i,method:"POST"}).then(r=>{r.success?(this.options=r.body,this.$processOptions(this.options),typeof n=="number"&&this.options.forEach(d=>{d.value=parseInt(d.value)}),n==null||n==null||n=="undefined"||!(n+"").length?this.options.length?o(this.options):(this.config.isDebug&&console.error("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),a("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)):this.options.filter(f=>f.value==n).length?o(this.options):(i.body||(i.body={}),i.body[this.convertObj.valueField||"id"]=n,P.axios[this.convertObj.ctx||"admin"]({url:s,data:i,method:"POST"}).then(f=>{if(f.success){const c={};this.options.forEach(h=>{c[n]=!0}),f.body.forEach(h=>{c[h.value]||this.options.push(h)}),o(this.options)}else a("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)}))):(this.config.isDebug&&console.error("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),a("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",error:"+r.message))})})}convert(n){if(n==null||n==null||n=="undefined"||!(n+"").length)return Promise.reject("value为空");if(this.convertObj.types=="dict")return this.convertObj.dictName?Ha.getLabel(this.convertObj.dictName,n):Promise.reject("字典名称不能为空");const l=typeof n=="number"?[n]:n.split(",");if(this.convertObj.types=="option"){if(this.convertObj.options?.length){const o=this.convertObj.options.filter(a=>l.includes(a.value)).map(a=>a.label);return o.length?Promise.resolve(o.join(",")):(this.config.isDebug&&console.error("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+n,this.convertObj),Promise.reject())}return this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id),Promise.reject()}if(this.options?.length){const o=this.options.filter(a=>l.includes(a.value)).map(a=>a.label);if(o.length)return Promise.resolve(o.join(","))}return new Promise((o,a)=>{this.load(n).then(i=>{const s=i.filter(r=>l.includes(r.value)).map(r=>r.label);if(s.length)return Promise.resolve(s.join(","));a()})})}children(n=-1){return this.config.isDebug&&console.log("进入:加载下级数据项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",pid:"+n),this.convertObj.pidField?this.convertObj.types=="dict"||this.convertObj.types=="option"?(this.config.isDebug&&console.error("字典/静态转换器不支持该方法,type:"+this.convertObj.types+",id:"+this.convertObj.id),Promise.reject()):new Promise((o,a)=>{const i=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;P.axios[this.convertObj.ctx||"admin"]({url:i,data:n,method:"POST"}).then(s=>{s.success?(this.$processOptions(s.body),this.options=[...this.options,...s.body],o(s.body)):(this.config.isDebug&&console.error("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+n,s),a())})}):(this.config.isDebug&&console.error("转换器未设置parentField,id:"+this.convertObj.id),Promise.reject())}search(n){if(this.config.isDebug&&console.log("进入:搜索数据选项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",keywords:"+n),this.convertObj.types=="dict"||this.convertObj.types=="option")return Promise.resolve(this.options.filter(o=>o.label.indexOf(n)>=0));const l={...this.convertObj.params||{}};return new Promise(o=>{const a=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;P.axios[this.convertObj.ctx||"admin"]({url:a,data:{body:{...l},keywords:n},method:"POST"}).then(i=>{i.success?(this.$processOptions(i.body),o(i.body)):o([])})})}$processOptions(n){return this.convertObj.types=="local"&&!this.convertObj.process&&n.forEach(l=>{this.convertObj.idField&&(l.id=l[this.convertObj.idField]),this.convertObj.pidField&&(l.pid=l[this.convertObj.pidField]),l.value=l[this.convertObj.valueField||"id"],l.label=l[this.convertObj.labelField||"title"]}),this.convertObj.process?this.convertObj.process(n):n}}const io=[{name:"number",title:"数字",express:String.raw`/^\d+$/`,error:"请输入正确的数字"},{name:"money",title:"金额",express:String.raw`/^([1-9][\d]*|0)(\.[\d]+)?$/`,error:"请输入正确的金额"},{name:"tel",title:"手机号",express:String.raw`/^1[3456789]\d{9}$/`,error:"请输入正确的手机号码"},{name:"phone",title:"手机/电话",express:String.raw`/^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/`,error:"请输入正确的联系方式"},{name:"email",title:"邮箱",express:String.raw`/^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/`,error:"请输入正确的邮箱"},{name:"idcard",title:"身份证号码",express:String.raw`/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/`,error:"请输入正确的身份证号码"}];function Ka(){const t=Le();if(t.formRules?.length){const n={};io.forEach(o=>{n[o.name]=o});const l=[...io];return t.formRules.forEach(o=>{const a=n[o.name];a?Object.assign(a,o):l.push(a)}),l}return io}const Ya={loadAdvances:Ka},ic=["innerHTML"],rc={key:2,class:"text-view"},sc=Z(e.defineComponent({__name:"formItem",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object,required:!0},disabled:{type:Boolean,defualt:!1},allowClear:{type:Boolean,default:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(t){const n=t,l=e.useModel(t,"value"),o=e.computed(()=>s.value.showFormat?s.value.showFormat.call(this,l.value,{label:w.value,form:n.formValue}):w.value||l.value),a=e.inject("formSetting"),i=e.inject("formChanged");e.onMounted(()=>{const V=P.utils.obj.getValue(n.formValue,r.value.name);V!=null&&typeof V<"u"&&V!=""&&(l.value=V),b.value=Ka()});const s=e.ref({}),r=e.computed(()=>{const V=n.engine?.widget(n.wid)||n.widget||{};return V.event&&Object.keys(V.event).forEach(_=>{const v=V.event[_];v&&(s.value[_]=null,typeof v=="function"?s.value[_]=v:v.enable&&v.scriptText&&(s.value[_]=new Function("value","ctx",v.scriptText)))}),V});e.watch(()=>P.utils.obj.getValue(n.formValue,r.value.name),(V,_)=>{V!=_&&(l.value=V)});const d=e.computed(()=>s.value.disabled?s.value.disabled(l.value,n.formValue):n.disabled),f=e.computed(()=>!(s.value.visible&&s.value.visible(l.value,n.formValue)==!1||r.value.view?.visible=="1")),c=e.computed(()=>{if(r.value.view?.hideLabel=="0")return"";if(s.value.title)return s.value.title(l.value,n.formValue)||r.value.title;if(n.engine&&r.value.name){let V=null,_=n.engine.widget(r.value.pid||"-1");for(;_;){if(_.dsn){V=_.dsn;break}if(!_.pid)break;_=n.engine.widget(_.pid)}if(V&&n.engine.dataModels){const v=n.engine.dataModels.find(C=>C.dsn===V);if(v){const C=v.fields.filter(E=>E.name==r.value.name)[0];if(C&&C.title)return r.value.title=C.title,C.title}}else if(n.engine.dataModels){const v=n.engine.dataModels[0];if(v){const C=v.fields.filter(E=>E.name==r.value.name)[0];if(C&&C.title)return r.value.title=C.title,C.title}}}return r.value.title});function h(){s.value.blur&&s.value.blur(l.value,n.formValue)}function p(V){r.value.name&&(P.utils.obj.setValue(n.formValue,r.value.name,l.value),m(V))}const m=be(()=>{if(i&&i(!0),s.value.change){s.value.change(l.value,n.formValue);return}r.value.change&&r.value.change(l.value,n.formValue)}),x=e.computed(()=>{let V=r.value.props?.required;if(s.value.required)try{V=s.value.required(l.value,n.formValue)}catch(_){console.error("form item required event error:",_)}return!!V}),b=e.ref({}),g=e.computed(()=>{const V=[],_=r.value.rule||{};if(x.value&&V.push({required:!0,whitespace:_?.whitespace||!1,trigger:_?.trigger||a?.ruleTrigger||"change",validator:(v,C)=>(_?.whitespace&&C&&typeof C=="string"&&(C=C.trim()),C!=null&&C!=null&&(C+"").replace(/\s+/g,"").length>0?Promise.resolve():Promise.reject(c.value+"不能为空!"))}),_.advance&&b.value[_.advance]){const v=b.value[_.advance];V.push({pattern:v.pattern,message:v.message||"表单验证不通过!",trigger:_.trigger||a?.ruleTrigger||"change"})}return _.regExpress&&V.push({pattern:_.regExpress,message:_.regMessage||"表单验证不通过!",trigger:_.trigger||a?.ruleTrigger||"change"}),r.value.dataLen&&V.push({validator:(v,C)=>C&&(C+"").length>r.value.dataLen?Promise.reject("最大长度["+r.value.dataLen+"],当前:["+(C+"").length+"]"):Promise.resolve(),trigger:_?.trigger||a?.ruleTrigger||"change"}),V}),u=e.computed(()=>{const V=r.value.props||{};if(r.value.control=="a-input-number"){const v=r.value.rule||{};v.rangeMin!=null&&v.rangeMin!=null&&(V.min=v.rangeMin),v.rangeMax!=null&&v.rangeMax!=null&&(V.max=v.rangeMax)}r.value.control=="a-date-picker"&&r.value.view?.dataFormat&&(V.format=r.value.view.dataFormat,V.valueFormat=r.value.view.dataFormat),r.value.required&&(V.required=r.value.required);const _={...V};return delete _.prefix,delete _.suffix,_}),y=e.computed(()=>{const V=r.value.css||{},_=["form-item-"+r.value.name];return V.cssName&&_.push(V.cssName),a?.platform=="app"?V.cssName?typeof V.cssName=="string"&&V.cssName.indexOf("all-line")<0&&_.push("all-line"):_.push("all-line"):r.value.view?.width&&(r.value.view.width>=3?(!V.cssName||typeof V.cssName=="string"&&V.cssName.indexOf("all-line")<0)&&_.push("all-line"):r.value.view.width==2&&_.push("2in-line")),_}),N=e.computed(()=>{let V=r.value.view?.labelWidth;return V?{span:V}:null}),k=e.computed(()=>({span:24-N.value?.span||0})),w=e.ref();return e.watch(l,()=>{(l.value||l.value==0)&&n.engine?.model=="view"&&r.value.convert&&new lt(r.value.convert).convert(l.value+"").then(V=>{w.value=V})}),(V,_)=>{const v=e.resolveComponent("a-form-item");return e.openBlock(),e.createBlock(ht,{class:e.normalizeClass(["unione-form-item",y.value]),style:e.normalizeStyle(r.value.css?.cssText),wid:r.value.wid,engine:n.engine},{default:e.withCtx(()=>[f.value?(e.openBlock(),e.createBlock(v,{key:0,label:c.value,name:r.value.name,labelCol:N.value,wrapperCol:k.value,required:x.value,rules:g.value,help:(!n.engine||n.engine.model.value!="view")&&r.value.props?.help,tooltip:r.value.props?.tooltip,class:e.normalizeClass([r.value.view?.gridWidth&&"ant-col-"+r.value.view?.gridWidth])},{default:e.withCtx(()=>[!n.engine||r.value.view=="self"||n.engine.model!="view"&&r.value.view!="html"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.control||r.value.widget||"a-input"),e.mergeProps({key:0,wid:r.value.wid,widget:r.value,engine:n.engine,disabled:d.value,allowClear:t.allowClear,onChange:p,onBlur:h,value:l.value,"onUpdate:value":_[0]||(_[0]=C=>l.value=C),formValue:t.formValue},u.value,{style:{width:r.value.view?.valueWidth,...r.value.css?.props}}),e.createSlots({_:2},[r.value.props?.prefix?{name:"prefix",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.props?.prefix)))]),key:"0"}:void 0,r.value.props?.suffix?{name:"suffix",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value.props?.suffix)))]),key:"1"}:void 0]),1040,["wid","widget","engine","disabled","allowClear","value","formValue","style"])):r.value.view=="html"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"text-view text-html",innerHTML:o.value},null,8,ic)):(e.openBlock(),e.createElementBlock("div",rc,e.toDisplayString(o.value),1)),e.renderSlot(V.$slots,"default",{},void 0,!0)]),_:3},8,["label","name","labelCol","wrapperCol","required","rules","help","tooltip","class"])):e.createCommentVNode("",!0)]),_:3},8,["class","style","wid","engine"])}}}),[["__scopeId","data-v-800ee59e"]]),dc=Z(e.defineComponent({__name:"selectBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},mode:{type:String,default:"combobox"},valueType:{type:String,default:"string"}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=Le(),o=n,a=t,i=e.ref(),s=e.useModel(t,"value"),r=e.ref([]),d=e.computed(()=>r.value?.length?r.value:a.options?.length?a.options:[]),f=e.computed(()=>{const N=g.value.convert||a.convert||{};if(N.refValue){const k={};return N.refValue.split(",").forEach(V=>{const _=V.split("=");_.length==1?k[_[0]]=P.utils.obj.getValue(a.formValue,_[0]):k[_[0]]=P.utils.obj.getValue(a.formValue,_[1])}),k}return{}}),c=e.computed(()=>(g.value.convert||a.convert||{}).search||!1),h=be(N=>{const k=g.value.convert||a.convert||{};k.params={...x.value,...f.value},u.value.search(N).then(w=>{l.isDebug&&console.log(g.value.name+" search ",N,w),e.nextTick(()=>{r.value=[...w]})})},500);function p(N,k){b.value.select&&b.value.select(N,{option:k,formValue:a.formValue})}function m(){y()}const x=e.ref();e.onMounted(()=>{const N=g.value.convert||a.convert||{};x.value=N.params||{},N.params={...x.value,...f.value},a.mode=="multiple"&&typeof s.value=="string"&&(i.value=s.value.split(",")),u.value.load(s.value).then(k=>{r.value=k})});const b=e.ref({}),g=e.computed(()=>{const N=a.engine?.widget(a.wid)||a.widget||{};return N.event&&Object.keys(N.event).forEach(k=>{const w=N.event[k];w&&(b.value[k]=null,typeof w=="function"?b.value[k]=w:w.enable&&w.scriptText&&(b.value[k]=new Function("value","ctx",w.scriptText)))}),N}),u=e.computed(()=>{const N=g.value.convert||a.convert||{};return new lt(N)});e.watch(()=>g.value.convert||a.convert||{},be(()=>{l.isDebug&&console.log(g.value.name+" convert changed",s.value),a.engine?.model=="edit"&&u.value.load().then(N=>{r.value=N})}),{deep:!0}),e.watch(s,be(()=>{s.value!=null&&s.value!==""&&s.value!==void 0&&(s.value+"").length>0&&(a.mode=="multiple"&&typeof s.value=="string"?i.value=s.value.split(","):(i.value=s.value,r.value[0]&&(typeof r.value[0].value=="number"?i.value=Number(i.value):typeof r.value[0].value=="string"&&(i.value=String(i.value)))),u.value.types!="dict"&&u.value.types!="option"&&(r.value.find(k=>k.value===s.value)||(l.isDebug&&console.log(g.value.name+" model value changed",s.value),u.value.load(s.value).then(k=>{r.value=k}))))},200)),e.watch(()=>f.value,be(()=>{if(l.isDebug&&console.log(g.value.name+" ref value changed",f.value),f.value&&u.value.types!="dict"&&u.value.types!="option"){const N=g.value.convert||a.convert||{};N.params={...x.value,...f.value},r.value.find(w=>w.value===s.value)||u.value.load(s.value,!0).then(w=>{r.value=w})}},200),{deep:!0}),e.watch(i,y);function y(){Array.isArray(i.value)&&a.valueType=="string"?s.value=i.value.join(","):s.value=i.value,o("change",s.value)}return(N,k)=>{const w=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(w,{class:"unione-form-select",options:d.value,showSearch:c.value,mode:t.mode,filterOption:!u.value?.search,value:i.value,"onUpdate:value":k[0]||(k[0]=V=>i.value=V),onSearch:e.unref(h),onSelect:p,onChange:m},null,8,["options","showSearch","mode","filterOption","value","onSearch"])}}}),[["__scopeId","data-v-a72e89d0"]]),cc=Z(e.defineComponent({__name:"switchBox",props:e.mergeModels({engine:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=n,o=t,a=e.useModel(t,"value");function i(h){l("change",h)}const s=e.ref({});e.onMounted(()=>{f.value.load(a.value).then(h=>{c(h)})});const r=e.ref({}),d=e.computed(()=>{const h=o.widget||{};return h.event&&Object.keys(h.event).forEach(p=>{const m=h.event[p];m&&(r.value[p]=null,typeof m=="function"?r.value[p]=m:m.enable&&m.scriptText&&(r.value[p]=new Function("value","ctx",m.scriptText)))}),h}),f=e.computed(()=>{const h=d.value.convert||o.convert||{};return new lt(h)});function c(h){h.forEach(p=>{p.value&&(p.value===!0||p.value=="1"||p.value=="true"||p.value=="TRUE")?(s.value.checkedChildren=p.label,p.value===!0||p.value=="true"||p.value=="TRUE"?s.value.checkedValue=!0:s.value.checkedValue=Number.isNaN(p.value)?p.value:Number(p.value)):(s.value.unCheckedChildren=p.label,p.value===!1||p.value=="false"||p.value=="FALSE"?s.value.unCheckedValue=!1:s.value.unCheckedValue=Number.isNaN(p.value)?p.value:Number(p.value))})}return e.watch(()=>d.value.convert||o.convert||{},be(()=>{f.value.load().then(h=>{c(h)})}),{deep:!0}),(h,p)=>{const m=e.resolveComponent("a-switch");return e.openBlock(),e.createBlock(m,e.mergeProps({class:"unione-form-switch"},s.value,{checked:a.value,"onUpdate:checked":p[0]||(p[0]=x=>a.value=x),onChange:i}),null,16,["checked"])}}}),[["__scopeId","data-v-e4555df5"]]),uc=Z(e.defineComponent({__name:"radioBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},layout:{type:String,default:"horizontal"}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(t){const n=t,l=e.useModel(t,"value"),o=e.ref([]),a=e.computed(()=>o.value?.length?o.value:n.options?.length?n.options:[]),i=e.computed(()=>{const h=d.value.convert||n.convert||{};if(h.refValue){const p={};return h.refValue.split(",").forEach(x=>{const b=x.split("=");b.length==1?p[b[0]]=P.utils.obj.getValue(n.formValue,b[0]):p[b[0]]=P.utils.obj.getValue(n.formValue,b[1])}),console.log(d.value.name+" ref field:"+h.refValue+",ref value",p),p}return{}}),s=e.ref();e.onMounted(()=>{const h=d.value.convert||n.convert||{};s.value=h.params||{},h.params={...s.value,...i.value},f.value.load(l.value||d.value.value).then(p=>{o.value=p})});const r=e.ref({}),d=e.computed(()=>{const h=n.engine?.widget(n.wid)||n.widget||{};return h.event&&Object.keys(h.event).forEach(p=>{const m=h.event[p];m&&(r.value[p]=null,typeof m=="function"?r.value[p]=m:m.enable&&m.scriptText&&(r.value[p]=new Function("value","ctx",m.scriptText)))}),h}),f=e.computed(()=>{const h=d.value.convert||n.convert||{};return new lt(h)});e.watch(()=>d.value.convert||n.convert||{},be(()=>{f.value.load().then(h=>{o.value=h})}),{deep:!0}),e.watch(()=>i.value,()=>{if(console.log(d.value.name+" ref value changed",i.value),i.value){const h=d.value.convert||n.convert||{};h.params={...s.value,...i.value},f.value.load(void 0,!0).then(p=>{o.value=p})}},{deep:!0});function c(h){r.value?.select&&r.value.select(h.value,{option:h,formValue:n.formValue})}return(h,p)=>{const m=e.resolveComponent("QuestionCircleOutlined"),x=e.resolveComponent("a-tooltip"),b=e.resolveComponent("a-radio"),g=e.resolveComponent("a-radio-group");return e.openBlock(),e.createBlock(g,{class:e.normalizeClass(["unione-form-radio",t.layout]),value:l.value,"onUpdate:value":p[0]||(p[0]=u=>l.value=u)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,u=>(e.openBlock(),e.createBlock(b,{key:u.value,value:u.value,onClick:y=>c(u)},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(u.label),1),u.help?(e.openBlock(),e.createBlock(x,{key:0,title:u.help},{default:e.withCtx(()=>[e.createVNode(m,{class:"icon"})]),_:2},1032,["title"])):e.createCommentVNode("",!0)]),_:2},1032,["value","onClick"]))),128))]),_:1},8,["class","value"])}}}),[["__scopeId","data-v-747bb329"]]),pc=Z(e.defineComponent({__name:"checkBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},returnType:{type:String,default:"string"},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},layout:{type:String,default:"horizontal"}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=t,o=e.useModel(t,"value"),a=e.ref(),i=e.ref([]),s=e.computed(()=>{const x=c.value.convert||l.convert||{};return x.types=="option"?x.options||[]:i.value?.length?i.value:l.options?.length?l.options:[]}),r=e.computed(()=>{const x=c.value.convert||l.convert||{};if(x.refValue){const b={};return x.refValue.split(",").forEach(u=>{const y=u.split("=");y.length==1?b[y[0]]=P.utils.obj.getValue(l.formValue,y[0]):b[y[0]]=P.utils.obj.getValue(l.formValue,y[1])}),console.log(c.value.name+" ref field:"+x.refValue+",ref value",b),b}return{}}),d=e.ref();e.onMounted(()=>{const x=o.value||c.value.value||"";l.returnType==="string"?a.value=x.split(","):a.value=x;const b=c.value.convert||l.convert||{};d.value=b.params||{},b.params={...d.value,...r.value},m.value.load().then(g=>{i.value=g})});const f=e.ref({}),c=e.computed(()=>{const x=l.engine?.widget(l.wid)||l.widget||{};return x.event&&Object.keys(x.event).forEach(b=>{const g=x.event[b];f.value[b]=null,g.enable&&g.scriptText&&(f.value[b]=new Function("value","ctx",g.scriptText))}),x}),h=n;function p(x){l.returnType==="string"?o.value=x.join(","):o.value=x,console.log("checkbox changed",o.value),h("change",o.value)}const m=e.computed(()=>{const x=c.value.convert||l.convert||{};return new lt(x)});return e.watch(()=>c.value.convert||l.convert||{},be(()=>{m.value.load().then(x=>{i.value=x})}),{deep:!0}),e.watch(()=>o.value,()=>{a.value=Array.isArray(o.value)?o.value:[],o.value&&!Array.isArray(o.value)&&(a.value=o.value.split(","))}),e.watch(()=>r.value,()=>{if(console.log(c.value.name+" ref value changed",r.value),r.value){a.value=[],l.returnType==="string"?o.value="":o.value=[];const x=c.value.convert||l.convert||{};x.params={...d.value,...r.value},m.value.load(void 0,!0).then(b=>{i.value=b})}},{deep:!0}),(x,b)=>{const g=e.resolveComponent("QuestionCircleOutlined"),u=e.resolveComponent("a-tooltip"),y=e.resolveComponent("a-checkbox-group");return e.openBlock(),e.createBlock(y,{class:e.normalizeClass(["unione-form-checkbox",t.layout]),options:s.value,value:a.value,"onUpdate:value":b[0]||(b[0]=N=>a.value=N),onChange:p},{label:e.withCtx(N=>[e.createElementVNode("span",null,e.toDisplayString(N.label),1),N.help?(e.openBlock(),e.createBlock(u,{key:0,title:N.help},{default:e.withCtx(()=>[e.createVNode(g,{class:"icon"})]),_:2},1032,["title"])):e.createCommentVNode("",!0)]),_:1},8,["class","options","value"])}}}),[["__scopeId","data-v-676fca1e"]]),fc=Z(e.defineComponent({__name:"checkSwitch",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},model:{type:Object,default(){return{checked:!0,unchecked:!1}}},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object},layout:{type:String,default:"horizontal"}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=t,o=e.useModel(t,"value"),a=e.ref([]),i=e.computed(()=>{const m=d.value.convert||l.convert||{};return m.types=="option"?m.options||[]:a.value?.length?a.value:l.options?.length?l.options:[]}),s=e.computed(()=>{const m=d.value.convert||l.convert||{};if(m.refValue){const x={};return m.refValue.split(",").forEach(g=>{const u=g.split("=");u.length==1?x[u[0]]=P.utils.obj.getValue(l.formValue,u[0]):x[u[0]]=P.utils.obj.getValue(l.formValue,u[1])}),console.log(d.value.name+" ref field:"+m.refValue+",ref value",x),x}return{}}),r=e.ref();e.onMounted(()=>{o.value||(o.value={},f("change",o.value));const m=d.value.convert||l.convert||{};r.value=m.params||{},m.params={...r.value,...s.value},p.value.load().then(x=>{a.value=x})});const d=e.computed(()=>l.engine?.widget(l.wid)||l.widget||{}),f=n;function c(m){d.value.name=="this"&&l.formValue?l.formValue[m.value]==l.model.checked?l.formValue[m.value]=l.model.unchecked:l.formValue[m.value]=l.model.checked:(o.value||(o.value={}),o.value[m.value]==l.model.checked?o.value[m.value]=l.model.unchecked:o.value[m.value]=l.model.checked,f("change",o.value))}function h(m){return d.value.name=="this"&&l.formValue?l.formValue[m.value]==l.model.checked:(o.value||(o.value={}),o.value&&o.value[m.value]==l.model.checked)}const p=e.computed(()=>{const m=d.value.convert||l.convert||{};return new lt(m)});return e.watch(()=>d.value.convert||l.convert||{},be(()=>{p.value.load().then(m=>{a.value=m})}),{deep:!0}),e.watch(()=>s.value,()=>{if(s.value){const m=d.value.convert||l.convert||{};m.params={...r.value,...s.value},p.value.load(void 0,!0).then(x=>{a.value=x})}},{deep:!0}),(m,x)=>{const b=e.resolveComponent("QuestionCircleOutlined"),g=e.resolveComponent("a-tooltip"),u=e.resolveComponent("a-checkbox");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["unione-check-switch",t.layout])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,y=>(e.openBlock(),e.createBlock(u,{key:y.value,checked:h(y),onChange:N=>c(y)},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(y.label),1),y.help?(e.openBlock(),e.createBlock(g,{key:0,title:y.help},{default:e.withCtx(()=>[e.createVNode(b,{class:"icon"})]),_:2},1032,["title"])):e.createCommentVNode("",!0)]),_:2},1032,["checked","onChange"]))),128))],2)}}}),[["__scopeId","data-v-3e89bc45"]]),mc=Z(e.defineComponent({__name:"pwdBox",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(t){const n=e.ref(),l=e.useModel(t,"value");return e.watch(()=>n.value,()=>{n.value?l.value=P.utils.sm2Encrypt(n.value):l.value=""}),(o,a)=>{const i=e.resolveComponent("a-input-password");return e.openBlock(),e.createBlock(i,{class:"unione-form-password",value:n.value,"onUpdate:value":a[0]||(a[0]=s=>n.value=s)},null,8,["value"])}}}),[["__scopeId","data-v-4515a2af"]]),gc=Z(e.defineComponent({__name:"randomInput",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},len:{type:Number,default:10},disabled:{type:Boolean,defualt:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(t){const n=t,l=e.useModel(t,"value");function o(){n.disabled||(l.value=Pa(n.len))}return e.onMounted(()=>{e.nextTick(()=>{(!l.value||typeof l.value>"u")&&(n.disabled||o())}),n.engine?.ebus.$on("form-reset",()=>{n.disabled||o()})}),(a,i)=>{const s=e.resolveComponent("SyncOutlined"),r=e.resolveComponent("a-input");return e.openBlock(),e.createBlock(r,{class:"unione-form-random-input",value:l.value,"onUpdate:value":i[0]||(i[0]=d=>l.value=d),disabled:t.disabled},{suffix:e.withCtx(()=>[e.createVNode(s,{style:{color:"rgba(0, 0, 0, 0.45)"},onClick:o})]),_:1},8,["value","disabled"])}}}),[["__scopeId","data-v-f2fb0f2e"]]),hc=["disabled"],bc=Z(e.defineComponent({__name:"uploadBox",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},listType:{type:String,default:"text"},formValue:{type:Object},btnLabel:{type:String,default:"上传文件"},valueType:{type:String,default:"array"},autoUpload:{type:Boolean,default:!1},beforeUpload:{type:Function,required:!1},disabled:{type:Boolean,default:!1}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=t,o=n,a=e.useModel(t,"value"),i=e.ref([]);e.watch(a,()=>{i.value=[],a.value&&(Array.isArray(a.value)?i.value=a.value:(a.value.startsWith("[")&&a.value.endsWith("]")||a.value.startsWith("{")&&a.value.endsWith("}"))&&(i.value=JSON.parse(a.value)))});function s(d){return l.beforeUpload?l.beforeUpload(d):l.autoUpload}function r({fileList:d}){l.valueType=="array"?(a.value=d,o("change",d)):(a.value=JSON.stringify(d),o("change",JSON.stringify(d)))}return(d,f)=>{const c=e.resolveComponent("upload-outlined"),h=e.resolveComponent("a-button"),p=e.resolveComponent("plus-outlined"),m=e.resolveComponent("a-upload");return e.openBlock(),e.createBlock(m,{class:"unione-form-upload-box","file-list":i.value,"onUpdate:fileList":f[0]||(f[0]=x=>i.value=x),disabled:t.disabled||t.engine?.model=="view",beforeUpload:s,"list-type":t.listType,onChange:r},{default:e.withCtx(()=>[(!t.disabled||t.engine?.model!="view")&&t.listType=="text"?(e.openBlock(),e.createBlock(h,{key:0,disabled:t.disabled},{default:e.withCtx(()=>[e.createVNode(c),e.createTextVNode(" "+e.toDisplayString(t.btnLabel),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(!t.disabled||t.engine?.model!="view")&&t.listType!="text"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"btn-upload-pic",disabled:t.disabled},[e.createVNode(p),f[1]||(f[1]=e.createElementVNode("span",{class:"text"},"Upload",-1))],8,hc)):e.createCommentVNode("",!0)]),_:1},8,["file-list","disabled","list-type"])}}}),[["__scopeId","data-v-c4b004a7"]]),ro=[{title:"线框风格",name:"Outlined",groups:[{title:"通用图标",icons:["AccountBookOutlined","AimOutlined","AlertOutlined","ApartmentOutlined","ApiOutlined","AppstoreAddOutlined","AppstoreOutlined","AudioOutlined","AudioMutedOutlined","AuditOutlined","BankOutlined","BarcodeOutlined","BarsOutlined","BellOutlined","BlockOutlined","BookOutlined","BorderOutlined","BorderlessTableOutlined","BranchesOutlined","BugOutlined","BuildOutlined","BulbOutlined","CalculatorOutlined","CalendarOutlined","CameraOutlined","CarOutlined","CarryOutOutlined","CiCircleOutlined","CiOutlined","ClearOutlined","CloudDownloadOutlined","CloudOutlined","CloudServerOutlined","CloudSyncOutlined","CloudUploadOutlined","ClusterOutlined","CodeOutlined","CoffeeOutlined","CommentOutlined","CompassOutlined","CompressOutlined","ConsoleSqlOutlined","ContactsOutlined","ContainerOutlined","ControlOutlined","CopyrightCircleOutlined","CopyrightOutlined","CreditCardOutlined","CrownOutlined","CustomerServiceOutlined","DashboardOutlined","DatabaseOutlined","DeleteColumnOutlined","DeleteRowOutlined","DeliveredProcedureOutlined","DeploymentUnitOutlined","DesktopOutlined","DingtalkOutlined","DisconnectOutlined","DislikeOutlined","DollarCircleOutlined","DollarOutlined","DownloadOutlined","EllipsisOutlined","EnvironmentOutlined","EuroCircleOutlined","EuroOutlined","ExceptionOutlined","ExpandAltOutlined","ExpandOutlined","ExperimentOutlined","ExportOutlined","EyeOutlined","EyeInvisibleOutlined","FieldBinaryOutlined","FieldNumberOutlined","FieldStringOutlined","FieldTimeOutlined","FileAddOutlined","FileDoneOutlined","FileExcelOutlined","FileExclamationOutlined","FileOutlined","FileGifOutlined","FileImageOutlined","FileJpgOutlined","FileMarkdownOutlined","FilePdfOutlined","FilePptOutlined","FileProtectOutlined","FileSearchOutlined","FileSyncOutlined","FileTextOutlined","FileUnknownOutlined","FileWordOutlined","FileZipOutlined","FilterOutlined","FireOutlined","FlagOutlined","FolderAddOutlined","FolderOutlined","FolderOpenOutlined","FolderViewOutlined","ForkOutlined","FormatPainterOutlined","FrownOutlined","FunctionOutlined","FundProjectionScreenOutlined","FundViewOutlined","FunnelPlotOutlined","GatewayOutlined","GifOutlined","GiftOutlined","GlobalOutlined","GoldOutlined","GroupOutlined","HddOutlined","HeartOutlined","HistoryOutlined","HolderOutlined","HomeOutlined","HourglassOutlined","IdcardOutlined","ImportOutlined","InboxOutlined","InsertRowAboveOutlined","InsertRowBelowOutlined","InsertRowLeftOutlined","InsertRowRightOutlined","InsuranceOutlined","InteractionOutlined","KeyOutlined","LaptopOutlined","LayoutOutlined","LikeOutlined","LineOutlined","LinkOutlined","Loading3QuartersOutlined","LoadingOutlined","LockOutlined","MacCommandOutlined","MailOutlined","ManOutlined","MedicineBoxOutlined","MehOutlined","MenuOutlined","MergeCellsOutlined","MessageOutlined","MobileOutlined","MoneyCollectOutlined","MonitorOutlined","MoreOutlined","NodeCollapseOutlined","NodeExpandOutlined","NodeIndexOutlined","NotificationOutlined","NumberOutlined","OneToOneOutlined","PaperClipOutlined","PartitionOutlined","PayCircleOutlined","PercentageOutlined","PhoneOutlined","PictureOutlined","PlaySquareOutlined","PoundCircleOutlined","PoundOutlined","PoweroffOutlined","PrinterOutlined","ProfileOutlined","ProjectOutlined","PropertySafetyOutlined","PullRequestOutlined","PushpinOutlined","QrcodeOutlined","ReadOutlined","ReconciliationOutlined","RedEnvelopeOutlined","ReloadOutlined","RestOutlined","RobotOutlined","RocketOutlined","RotateLeftOutlined","RotateRightOutlined","SafetyCertificateOutlined","SafetyOutlined","SaveOutlined","ScanOutlined","ScheduleOutlined","SearchOutlined","SecurityScanOutlined","SelectOutlined","SendOutlined","SettingOutlined","ShakeOutlined","ShareAltOutlined","ShopOutlined","ShoppingCartOutlined","ShoppingOutlined","SisternodeOutlined","SkinOutlined","SmileOutlined","SolutionOutlined","SoundOutlined","SplitCellsOutlined","StarOutlined","SubnodeOutlined","SwitcherOutlined","SyncOutlined","TableOutlined","TabletOutlined","TagOutlined","TagsOutlined","TeamOutlined","ThunderboltOutlined","ToTopOutlined","ToolOutlined","TrademarkCircleOutlined","TrademarkOutlined","TransactionOutlined","TranslationOutlined","TrophyOutlined","UngroupOutlined","UnlockOutlined","UploadOutlined","UsbOutlined","UserAddOutlined","UserDeleteOutlined","UserOutlined","UserSwitchOutlined","UsergroupAddOutlined","UsergroupDeleteOutlined","VerifiedOutlined","VideoCameraAddOutlined","VideoCameraOutlined","WalletOutlined","WhatsAppOutlined","WifiOutlined","WomanOutlined"]},{title:"方向图标",icons:["StepBackwardOutlined","StepForwardOutlined","FastBackwardOutlined","FastForwardOutlined","ShrinkOutlined","ArrowsAltOutlined","DownOutlined","UpOutlined","LeftOutlined","RightOutlined","CaretUpOutlined","CaretDownOutlined","CaretLeftOutlined","CaretRightOutlined","UpCircleOutlined","DownCircleOutlined","LeftCircleOutlined","RightCircleOutlined","DoubleRightOutlined","DoubleLeftOutlined","VerticalLeftOutlined","VerticalRightOutlined","VerticalAlignTopOutlined","VerticalAlignMiddleOutlined","VerticalAlignBottomOutlined","ForwardOutlined","BackwardOutlined","RollbackOutlined","EnterOutlined","RetweetOutlined","SwapOutlined","SwapLeftOutlined","SwapRightOutlined","ArrowUpOutlined","ArrowDownOutlined","ArrowLeftOutlined","ArrowRightOutlined","PlayCircleOutlined","UpSquareOutlined","DownSquareOutlined","LeftSquareOutlined","RightSquareOutlined","LoginOutlined","LogoutOutlined","MenuFoldOutlined","MenuUnfoldOutlined","BorderBottomOutlined","BorderHorizontalOutlined","BorderInnerOutlined","BorderOuterOutlined","BorderLeftOutlined","BorderRightOutlined","BorderTopOutlined","BorderVerticleOutlined","PicCenterOutlined","PicLeftOutlined","PicRightOutlined","RadiusBottomleftOutlined","RadiusBottomrightOutlined","RadiusUpleftOutlined","RadiusUprightOutlined","FullscreenOutlined","FullscreenExitOutlined"]},{title:"提示图标",icons:["QuestionOutlined","QuestionCircleOutlined","PlusOutlined","PlusCircleOutlined","PauseOutlined","PauseCircleOutlined","MinusOutlined","MinusCircleOutlined","PlusSquareOutlined","MinusSquareOutlined","InfoOutlined","InfoCircleOutlined","ExclamationOutlined","ExclamationCircleOutlined","CloseOutlined","CloseCircleOutlined","CloseSquareOutlined","CheckOutlined","CheckCircleOutlined","CheckSquareOutlined","ClockCircleOutlined","WarningOutlined","IssuesCloseOutlined","StopOutlined"]},{title:"编辑图标",icons:["EditOutlined","FormOutlined","CopyOutlined","ScissorOutlined","DeleteOutlined","SnippetsOutlined","DiffOutlined","HighlightOutlined","AlignCenterOutlined","AlignLeftOutlined","AlignRightOutlined","BgColorsOutlined","BoldOutlined","ItalicOutlined","UnderlineOutlined","StrikethroughOutlined","RedoOutlined","UndoOutlined","ZoomInOutlined","ZoomOutOutlined","FontColorsOutlined","FontSizeOutlined","LineHeightOutlined","DashOutlined","SmallDashOutlined","SortAscendingOutlined","SortDescendingOutlined","DragOutlined","OrderedListOutlined","UnorderedListOutlined","RadiusSettingOutlined","ColumnWidthOutlined","ColumnHeightOutlined"]},{title:"数据图标",icons:["AreaChartOutlined","PieChartOutlined","BarChartOutlined","DotChartOutlined","LineChartOutlined","RadarChartOutlined","HeatMapOutlined","FallOutlined","RiseOutlined","StockOutlined","BoxPlotOutlined","FundOutlined","SlidersOutlined"]},{title:"品牌图标",icons:["AndroidOutlined","AppleOutlined","WindowsOutlined","IeOutlined","ChromeOutlined","GithubOutlined","AliwangwangOutlined","DingdingOutlined","WeiboSquareOutlined","WeiboCircleOutlined","TaobaoCircleOutlined","Html5Outlined","WeiboOutlined","TwitterOutlined","WechatOutlined","YoutubeOutlined","AlipayCircleOutlined","TaobaoOutlined","SkypeOutlined","QqOutlined","MediumWorkmarkOutlined","GitlabOutlined","MediumOutlined","LinkedinOutlined","GooglePlusOutlined","DropboxOutlined","FacebookOutlined","CodepenOutlined","CodeSandboxOutlined","AmazonOutlined","GoogleOutlined","CodepenCircleOutlined","AlipayOutlined","AntDesignOutlined","AntCloudOutlined","AliyunOutlined","ZhihuOutlined","SlackOutlined","SlackSquareOutlined","BehanceOutlined","BehanceSquareOutlined","DribbbleOutlined","DribbbleSquareOutlined","InstagramOutlined","YuqueOutlined","AlibabaOutlined","YahooOutlined","RedditOutlined","SketchOutlined"]}]},{title:"实底风格",name:"Filled",groups:[{title:"通用图标",icons:["AccountBookFilled","AlertFilled","AlipaySquareFilled","AmazonCircleFilled","AmazonSquareFilled","ApiFilled","AppstoreFilled","AudioFilled","BankFilled","BehanceCircleFilled","BellFilled","BookFilled","BugFilled","BuildFilled","BulbFilled","CalculatorFilled","CalendarFilled","CameraFilled","CarFilled","CarryOutFilled","CiCircleFilled","CloudFilled","CodeFilled","CodeSandboxSquareFilled","CodepenSquareFilled","CompassFilled","ContactsFilled","ContainerFilled","ControlFilled","CopyrightCircleFilled","CreditCardFilled","CrownFilled","CustomerServiceFilled","DashboardFilled","DatabaseFilled","DingtalkCircleFilled","DingtalkSquareFilled","DislikeFilled","DollarCircleFilled","DribbbleCircleFilled","DropboxCircleFilled","DropboxSquareFilled","EnvironmentFilled","EuroCircleFilled","ExperimentFilled","EyeFilled","EyeInvisibleFilled","FileAddFilled","FileExcelFilled","FileExclamationFilled","FileFilled","FileImageFilled","FileMarkdownFilled","FilePdfFilled","FilePptFilled","FileTextFilled","FileUnknownFilled","FileWordFilled","FileZipFilled","FilterFilled","FireFilled","FlagFilled","FolderAddFilled","FolderFilled","FolderOpenFilled","FormatPainterFilled","FrownFilled","FunnelPlotFilled","GiftFilled","GoldFilled","GoldenFilled","GoogleCircleFilled","GooglePlusCircleFilled","GooglePlusSquareFilled","GoogleSquareFilled","HddFilled","HeartFilled","HomeFilled","HourglassFilled","IdcardFilled","IeCircleFilled","IeSquareFilled","InsuranceFilled","InteractionFilled","LayoutFilled","LikeFilled","LockFilled","MacCommandFilled","MailFilled","MedicineBoxFilled","MediumCircleFilled","MediumSquareFilled","MehFilled","MessageFilled","MobileFilled","MoneyCollectFilled","NotificationFilled","PayCircleFilled","PhoneFilled","PictureFilled","PlaySquareFilled","PoundCircleFilled","PrinterFilled","ProfileFilled","ProjectFilled","PropertySafetyFilled","PushpinFilled","QqCircleFilled","QqSquareFilled","ReadFilled","ReconciliationFilled","RedEnvelopeFilled","RedditCircleFilled","RedditSquareFilled","RestFilled","RobotFilled","RocketFilled","SafetyCertificateFilled","SaveFilled","ScheduleFilled","SecurityScanFilled","SettingFilled","ShopFilled","ShoppingFilled","SignalFilled","SketchCircleFilled","SketchSquareFilled","SkinFilled","SlackCircleFilled","SmileFilled","SoundFilled","StarFilled","SwitcherFilled","TabletFilled","TagFilled","TagsFilled","TaobaoSquareFilled","ThunderboltFilled","ToolFilled","TrademarkCircleFilled","TrophyFilled","TwitterCircleFilled","TwitterSquareFilled","UnlockFilled","UsbFilled","VideoCameraFilled","WalletFilled","ZhihuCircleFilled","ZhihuSquareFilled"]},{title:"方向图标",icons:["StepBackwardFilled","StepForwardFilled","FastBackwardFilled","FastForwardFilled","CaretUpFilled","CaretDownFilled","CaretLeftFilled","CaretRightFilled","UpCircleFilled","DownCircleFilled","LeftCircleFilled","RightCircleFilled","ForwardFilled","BackwardFilled","PlayCircleFilled","UpSquareFilled","DownSquareFilled","LeftSquareFilled","RightSquareFilled"]},{title:"提示图标",icons:["QuestionCircleFilled","PlusCircleFilled","PauseCircleFilled","MinusCircleFilled","PlusSquareFilled","MinusSquareFilled","InfoCircleFilled","ExclamationCircleFilled","CloseCircleFilled","CloseSquareFilled","CheckCircleFilled","CheckSquareFilled","ClockCircleFilled","WarningFilled","StopFilled"]},{title:"编辑图标",icons:["EditFilled","CopyFilled","DeleteFilled","SnippetsFilled","DiffFilled","HighlightFilled"]},{title:"数据图标",icons:["PieChartFilled","BoxPlotFilled","FundFilled","SlidersFilled"]},{title:"品牌图标",icons:["AndroidFilled","AppleFilled","WindowsFilled","ChromeFilled","GithubFilled","AliwangwangFilled","WeiboSquareFilled","WeiboCircleFilled","TaobaoCircleFilled","Html5Filled","WechatFilled","YoutubeFilled","AlipayCircleFilled","SkypeFilled","GitlabFilled","LinkedinFilled","FacebookFilled","CodeSandboxCircleFilled","CodepenCircleFilled","SlackSquareFilled","BehanceSquareFilled","DribbbleSquareFilled","InstagramFilled","YuqueFilled","YahooFilled"]}]},{title:"双色风格",name:"TowTone",enable:!1,groups:[{title:"方向图标",icons:["UpCircleTowTone","DownCircleTowTone","LeftCircleTowTone","RightCircleTowTone","PlayCircleTowTone","UpSquareTowTone","DownSquareTowTone","LeftSquareTowTone","RightSquareTowTone"]},{title:"提示图标",icons:["QuestionCircleTowTone","PlusCircleTowTone","PauseCircleTowTone","MinusCircleTowTone","PlusSquareTowTone","MinusSquareTowTone","InfoCircleTowTone","ExclamationCircleTowTone","CloseCircleTowTone","CloseSquareTowTone","CheckCircleTowTone","CheckSquareTowTone","ClockCircleTowTone","WarningTowTone","StopTowTone"]},{title:"编辑图标",icons:["EditTowTone","CopyTowTone","DeleteTowTone","SnippetsTowTone","DiffTowTone","HighlightTowTone"]},{title:"数据图标",icons:["PieChartTowTone","BoxPlotTowTone","FundTowTone","SlidersTowTone"]},{title:"品牌图标",icons:["Html5TowTone"]},{title:"通用图标",icons:["AccountBookTowTone","AlertTowTone","ApiTowTone","AppstoreTowTone","AudioTowTone","BankTowTone","BellTowTone","BookTowTone","BugTowTone","BuildTowTone","BulbTowTone","CalculatorTowTone","CalendarTowTone","CameraTowTone","CarTowTone","CarryOutTowTone","CiCircleTowTone","CiTowTone","CloudTowTone","CodeTowTone","CompassTowTone","ContactsTowTone","ContainerTowTone","ControlTowTone","CopyrightCircleTowTone","CopyrightTowTone","CreditCardTowTone","CrownTowTone","CustomerServiceTowTone","DashboardTowTone","DatabaseTowTone","DislikeTowTone","DollarCircleTowTone","DollarTowTone","EnvironmentTowTone","EuroCircleTowTone","EuroTowTone","ExperimentTowTone","EyeTowTone","EyeInvisibleTowTone","FileAddTowTone","FileExcelTowTone","FileExclamationTowTone","FileTowTone","FileImageTowTone","FileMarkdownTowTone","FilePdfTowTone","FilePptTowTone","FileTextTowTone","FileUnknownTowTone","FileWordTowTone","FileZipTowTone","FilterTowTone","FireTowTone","FlagTowTone","FolderAddTowTone","FolderTowTone","FolderOpenTowTone","FrownTowTone","FunnelPlotTowTone","GiftTowTone","GoldTowTone","HddTowTone","HeartTowTone","HomeTowTone","HourglassTowTone","IdcardTowTone","InsuranceTowTone","InteractionTowTone","LayoutTowTone","LikeTowTone","LockTowTone","MailTowTone","MedicineBoxTowTone","MehTowTone","MessageTowTone","MobileTowTone","MoneyCollectTowTone","NotificationTowTone","PhoneTowTone","PictureTowTone","PlaySquareTowTone","PoundCircleTowTone","PrinterTowTone","ProfileTowTone","ProjectTowTone","PropertySafetyTowTone","PushpinTowTone","ReconciliationTowTone","RedEnvelopeTowTone","RestTowTone","RocketTowTone","SafetyCertificateTowTone","SaveTowTone","ScheduleTowTone","SecurityScanTowTone","SettingTowTone","ShopTowTone","ShoppingTowTone","SkinTowTone","SmileTowTone","SoundTowTone","StarTowTone","SwitcherTowTone","TabletTowTone","TagTowTone","TagsTowTone","ThunderboltTowTone","ToolTowTone","TrademarkCircleTowTone","TrophyTowTone","UnlockTowTone","UsbTowTone","VideoCameraTowTone","WalletTowTone"]}]}],yc={class:"icon-select-warp"},vc={class:"icon-search"},kc={class:"icon-list"},wc={class:"label"},Wa=Z(e.defineComponent({__name:"icon-list",setup(t,{expose:n}){const l=e.ref(),o=e.ref(0),a=e.ref(),i=e.ref(""),s=e.ref(ro),r=be(()=>{if(!i.value){s.value=ro;return}const c=i.value.toLowerCase(),h=JSON.parse(JSON.stringify(ro));h.forEach(p=>{p.groups.forEach(m=>{m.icons=m.icons.filter(x=>x.toLowerCase().includes(c))}),p.groups=p.groups.filter(m=>m.icons.length>0)}),s.value=h});function d(c){a.value=c}function f(){return a.value}return n({getSelected:f}),(c,h)=>{const p=e.resolveComponent("a-input"),m=e.resolveComponent("a-col"),x=e.resolveComponent("a-row"),b=e.resolveComponent("a-collapse-panel"),g=e.resolveComponent("a-empty"),u=e.resolveComponent("a-collapse"),y=e.resolveComponent("a-tab-pane"),N=e.resolveComponent("a-tabs");return e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",vc,[e.createVNode(p,{value:i.value,"onUpdate:value":h[0]||(h[0]=k=>i.value=k),placeholder:"搜索icon(回车)...",allowClear:"",onChange:e.unref(r)},null,8,["value","onChange"])]),e.createElementVNode("div",kc,[e.createVNode(N,{activeKey:l.value,"onUpdate:activeKey":h[2]||(h[2]=k=>l.value=k)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,k=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k.name},[k.enable!=!1?(e.openBlock(),e.createBlock(y,{tab:k.title,key:k.name},{default:e.withCtx(()=>[k.groups.length?(e.openBlock(),e.createBlock(u,{key:0,activeKey:o.value,"onUpdate:activeKey":h[1]||(h[1]=w=>o.value=w),accordion:"",ghost:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.groups,(w,V)=>(e.openBlock(),e.createBlock(b,{class:"group",key:V,header:w.title},{default:e.withCtx(()=>[e.createVNode(x,{gutter:10},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.icons,_=>(e.openBlock(),e.createBlock(m,{span:4,key:_,class:e.normalizeClass(["icon-item","icon-"+_,a.value==_&&"selected"]),onClick:v=>d(_)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_))),e.createElementVNode("div",wc,e.toDisplayString(_.substr(0,_.length-k.name.length)),1)]),_:2},1032,["class","onClick"]))),128))]),_:2},1024)]),_:2},1032,["header"]))),128)),k.groups.length==0?(e.openBlock(),e.createBlock(g,{key:0,description:"暂无数据"})):e.createCommentVNode("",!0)]),_:2},1032,["activeKey"])):e.createCommentVNode("",!0)]),_:2},1032,["tab"])):e.createCommentVNode("",!0)],64))),128))]),_:1},8,["activeKey"])])])}}}),[["__scopeId","data-v-0f290eff"]]),Cc={class:"icon-select"},Ac={key:1,class:"empty"},xc=Z(e.defineComponent({name:"IconSelect",__name:"index",props:e.mergeModels({title:{type:String,default:"图标选择"},show:{type:String,default:"drawer"},position:{type:String,default:"right"},width:{type:Number,default:600},allowClear:{type:Boolean,default:!0}},{value:{},valueModifiers:{},visible:{},visibleModifiers:{}}),emits:e.mergeModels(["ok","change"],["update:value","update:visible"]),setup(t,{emit:n}){const l=P.useDialog(),o=t,a=e.useModel(t,"value"),i=e.useModel(t,"visible");function s(){i.value=!0}const r=n,d=e.ref();function f(){const h=d.value.getSelected();if(h){a.value=h,i.value=!1,r("change",h),r("ok",h);return}l.warning({content:"请选择图标"})}function c(){a.value="",r("change","")}return(h,p)=>{const m=e.resolveComponent("CloseCircleFilled"),x=e.resolveComponent("a-button"),b=e.resolveComponent("a-drawer"),g=e.resolveComponent("a-modal");return e.openBlock(),e.createElementBlock("div",Cc,[e.createElementVNode("div",{class:"icon-box",onClick:s},[a.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value),{key:0,class:"view"})):(e.openBlock(),e.createElementBlock("span",Ac,[p[3]||(p[3]=e.createElementVNode("span",null,"选择",-1)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent("SearchOutlined")))])),t.allowClear&&a.value?(e.openBlock(),e.createBlock(m,{key:2,onClick:e.withModifiers(c,["stop"]),class:"clear-icon"})):e.createCommentVNode("",!0)]),o.show=="drawer"?(e.openBlock(),e.createBlock(b,{key:0,title:t.title,width:o.width,visible:i.value,"onUpdate:visible":p[1]||(p[1]=u=>i.value=u),placement:o.position,maskClosable:!1,bodyStyle:{padding:10},class:"icon-select-drawer"},{footer:e.withCtx(()=>[e.createVNode(x,{type:"primary",onClick:f},{default:e.withCtx(()=>p[4]||(p[4]=[e.createTextVNode("确定")])),_:1}),e.createVNode(x,{onClick:p[0]||(p[0]=u=>i.value=!1)},{default:e.withCtx(()=>p[5]||(p[5]=[e.createTextVNode("取消")])),_:1})]),default:e.withCtx(()=>[e.createVNode(Wa,{ref_key:"listObj",ref:d},null,512)]),_:1},8,["title","width","visible","placement"])):e.createCommentVNode("",!0),o.show=="dialog"?(e.openBlock(),e.createBlock(g,{key:1,title:t.title,width:o.width,open:i.value,"onUpdate:open":p[2]||(p[2]=u=>i.value=u),centered:o.position=="center",maskClosable:!1,class:"icon-select-dialog",onOk:f},{default:e.withCtx(()=>[e.createVNode(Wa,{ref_key:"listObj",ref:d},null,512)]),_:1},8,["title","width","open","centered"])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-9d3db12b"]]),Nc={key:0,class:"unione-form-code-input"},_c={class:"opts"},Sc={class:"code-line"},Vc={class:"btns"},Bc=Z(e.defineComponent({__name:"codeInput",props:e.mergeModels({wid:{type:String,required:!1},engine:{type:Object,required:!1},widget:{type:Object,required:!1},disabled:{type:Boolean,defualt:!1},placeholder:{type:String,required:!1}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["change"],["update:value"]),setup(t,{emit:n}){const l=n,o=e.useModel(t,"value"),a=e.computed(()=>o.value?.scriptText?o.value.scriptText.split(`
2
2
  `).length:0),i=e.ref({types:"option",options:[{label:"启用",value:!0},{label:"禁用",value:!1}]}),s=e.ref(!1),r=e.ref(!1);function d(){r.value=!0,s.value=!1}return e.watch(()=>o.value,()=>{o.value||(o.value={enable:!1,scriptText:""}),l("change",o.value)},{deep:!0}),e.onMounted(()=>{o.value||(o.value={enable:!1,scriptText:""})}),(f,c)=>{const h=e.resolveComponent("unione-switch-box"),p=e.resolveComponent("CodeOutlined"),m=e.resolveComponent("EditOutlined"),x=e.resolveComponent("unione-code-editor"),b=e.resolveComponent("a-button"),g=e.resolveComponent("a-drawer");return o.value?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",_c,[e.createVNode(h,{value:o.value.enable,"onUpdate:value":c[0]||(c[0]=u=>o.value.enable=u),convert:i.value,size:"small"},null,8,["value","convert"]),e.createElementVNode("div",Sc,[e.createVNode(p),e.createTextVNode(e.toDisplayString(a.value)+"行",1)]),e.createElementVNode("div",{class:"opt code-view",onClick:c[1]||(c[1]=u=>s.value=!s.value)},[e.createVNode(p),e.createTextVNode(e.toDisplayString(s.value?"隐藏代码":"显示代码"),1)]),e.createElementVNode("div",{class:"opt edit-code",onClick:d},[e.createVNode(m),c[7]||(c[7]=e.createTextVNode("编辑代码"))])]),s.value?(e.openBlock(),e.createBlock(x,{key:0,value:o.value.scriptText,"onUpdate:value":c[2]||(c[2]=u=>o.value.scriptText=u),engine:t.engine,placeholder:t.placeholder},null,8,["value","engine","placeholder"])):e.createCommentVNode("",!0),e.createVNode(g,{title:"编辑代码",open:r.value,"onUpdate:open":c[6]||(c[6]=u=>r.value=u),placement:"right",class:"drawer-form",width:800,bodyStyle:{padding:0}},{footer:e.withCtx(()=>[e.createElementVNode("div",Vc,[e.createVNode(b,{onClick:c[4]||(c[4]=u=>r.value=!1)},{default:e.withCtx(()=>c[8]||(c[8]=[e.createTextVNode("取消")])),_:1}),e.createVNode(b,{type:"primary",onClick:c[5]||(c[5]=u=>r.value=!1)},{default:e.withCtx(()=>c[9]||(c[9]=[e.createTextVNode("保存")])),_:1})])]),default:e.withCtx(()=>[e.createVNode(x,{value:o.value.scriptText,"onUpdate:value":c[3]||(c[3]=u=>o.value.scriptText=u),engine:t.engine,placeholder:t.placeholder},null,8,["value","engine","placeholder"])]),_:1},8,["open"])])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-3119b8c7"]]);function Ga(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function It(t){return typeof t=="function"?t():e.unref(t)}const cl=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ec=Object.prototype.toString,Oc=t=>Ec.call(t)==="[object Object]",nn=()=>{},Tc=Rc();function Rc(){var t,n;return cl&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window?.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Ja(t,n){function l(...o){return new Promise((a,i)=>{Promise.resolve(t(()=>n.apply(this,o),{fn:n,thisArg:this,args:o})).then(a).catch(i)})}return l}const Xa=t=>t();function Fc(t,n={}){let l,o,a=nn;const i=r=>{clearTimeout(r),a(),a=nn};return r=>{const d=It(t),f=It(n.maxWait);return l&&i(l),d<=0||f!==void 0&&f<=0?(o&&(i(o),o=null),Promise.resolve(r())):new Promise((c,h)=>{a=n.rejectOnCancel?h:c,f&&!o&&(o=setTimeout(()=>{l&&i(l),o=null,c(r())},f)),l=setTimeout(()=>{o&&i(o),o=null,c(r())},d)})}}function $c(t=Xa){const n=e.ref(!0);function l(){n.value=!1}function o(){n.value=!0}const a=(...i)=>{n.value&&t(...i)};return{isActive:e.readonly(n),pause:l,resume:o,eventFilter:a}}function Ic(t){let n;function l(){return n||(n=t()),n}return l.reset=async()=>{const o=n;n=void 0,o&&await o},l}function Mc(t){return e.getCurrentInstance()}function bt(t,n=200,l={}){return Ja(Fc(n,l),t)}function Dc(t,n,l={}){const{eventFilter:o=Xa,...a}=l;return e.watch(t,Ja(o,n),a)}function Uc(t,n,l={}){const{eventFilter:o,...a}=l,{eventFilter:i,pause:s,resume:r,isActive:d}=$c(o);return{stop:Dc(t,n,{...a,eventFilter:i}),pause:s,resume:r,isActive:d}}function Mt(t,n=!0,l){Mc()?e.onMounted(t,l):n?t():e.nextTick(t)}function Lc(t,n,l={}){const{immediate:o=!0}=l,a=e.ref(!1);let i=null;function s(){i&&(clearTimeout(i),i=null)}function r(){a.value=!1,s()}function d(...f){s(),a.value=!0,i=setTimeout(()=>{a.value=!1,i=null,t(...f)},It(n))}return o&&(a.value=!0,cl&&d()),Ga(r),{isPending:e.readonly(a),start:d,stop:r}}function Oe(t,n,l){const o=e.watch(t,(a,i,s)=>{a&&(l?.once&&e.nextTick(()=>o()),n(a,i,s))},{...l,once:!1});return o}function Tn(t){var n;const l=It(t);return(n=l?.$el)!=null?n:l}const Rn=cl?window:void 0,Za=cl?window.navigator:void 0;function Dt(...t){let n,l,o,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([l,o,a]=t,n=Rn):[n,l,o,a]=t,!n)return nn;Array.isArray(l)||(l=[l]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(c=>c()),i.length=0},r=(c,h,p,m)=>(c.addEventListener(h,p,m),()=>c.removeEventListener(h,p,m)),d=e.watch(()=>[Tn(n),It(a)],([c,h])=>{if(s(),!c)return;const p=Oc(h)?{...h}:h;i.push(...l.flatMap(m=>o.map(x=>r(c,m,x,p))))},{immediate:!0,flush:"post"}),f=()=>{d(),s()};return Ga(f),f}let ei=!1;function jc(t,n,l={}){const{window:o=Rn,ignore:a=[],capture:i=!0,detectIframe:s=!1}=l;if(!o)return nn;Tc&&!ei&&(ei=!0,Array.from(o.document.body.children).forEach(p=>p.addEventListener("click",nn)),o.document.documentElement.addEventListener("click",nn));let r=!0;const d=p=>a.some(m=>{if(typeof m=="string")return Array.from(o.document.querySelectorAll(m)).some(x=>x===p.target||p.composedPath().includes(x));{const x=Tn(m);return x&&(p.target===x||p.composedPath().includes(x))}}),c=[Dt(o,"click",p=>{const m=Tn(t);if(!(!m||m===p.target||p.composedPath().includes(m))){if(p.detail===0&&(r=!d(p)),!r){r=!0;return}n(p)}},{passive:!0,capture:i}),Dt(o,"pointerdown",p=>{const m=Tn(t);r=!d(p)&&!!(m&&!p.composedPath().includes(m))},{passive:!0}),s&&Dt(o,"blur",p=>{setTimeout(()=>{var m;const x=Tn(t);((m=o.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!x?.contains(o.document.activeElement)&&n(p)},0)})].filter(Boolean);return()=>c.forEach(p=>p())}function Pc(){const t=e.ref(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function ti(t){const n=Pc();return e.computed(()=>(n.value,!!t()))}function ni(t,n={}){const{controls:l=!1,navigator:o=Za}=n,a=ti(()=>o&&"permissions"in o);let i;const s=typeof t=="string"?{name:t}:t,r=e.ref(),d=()=>{i&&(r.value=i.state)},f=Ic(async()=>{if(a.value){if(!i)try{i=await o.permissions.query(s),Dt(i,"change",d),d()}catch{r.value="prompt"}return i}});return f(),l?{state:r,isSupported:a,query:f}:r}function qc(t={}){const{navigator:n=Za,read:l=!1,source:o,copiedDuring:a=1500,legacy:i=!1}=t,s=ti(()=>n&&"clipboard"in n),r=ni("clipboard-read"),d=ni("clipboard-write"),f=e.computed(()=>s.value||i),c=e.ref(""),h=e.ref(!1),p=Lc(()=>h.value=!1,a);function m(){s.value&&u(r.value)?n.clipboard.readText().then(y=>{c.value=y}):c.value=g()}f.value&&l&&Dt(["copy","cut"],m);async function x(y=It(o)){f.value&&y!=null&&(s.value&&u(d.value)?await n.clipboard.writeText(y):b(y),c.value=y,h.value=!0,p.start())}function b(y){const N=document.createElement("textarea");N.value=y??"",N.style.position="absolute",N.style.opacity="0",document.body.appendChild(N),N.select(),document.execCommand("copy"),N.remove()}function g(){var y,N,k;return(k=(N=(y=document?.getSelection)==null?void 0:y.call(document))==null?void 0:N.toString())!=null?k:""}function u(y){return y==="granted"||y==="prompt"}return{isSupported:f,text:c,copied:h,copy:x}}const ul=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pl="__vueuse_ssr_handlers__",zc=Qc();function Qc(){return pl in ul||(ul[pl]=ul[pl]||{}),ul[pl]}function Hc(t,n){return zc[t]||n}function Kc(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}const Yc={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},li="vueuse-storage";function Wc(t,n,l,o={}){var a;const{flush:i="pre",deep:s=!0,listenToStorageChanges:r=!0,writeDefaults:d=!0,mergeDefaults:f=!1,shallow:c,window:h=Rn,eventFilter:p,onError:m=E=>{console.error(E)},initOnMounted:x}=o,b=(c?e.shallowRef:e.ref)(typeof n=="function"?n():n);if(!l)try{l=Hc("getDefaultStorage",()=>{var E;return(E=Rn)==null?void 0:E.localStorage})()}catch(E){m(E)}if(!l)return b;const g=It(n),u=Kc(g),y=(a=o.serializer)!=null?a:Yc[u],{pause:N,resume:k}=Uc(b,()=>V(b.value),{flush:i,deep:s,eventFilter:p});h&&r&&Mt(()=>{Dt(h,"storage",v),Dt(h,li,C),x&&v()}),x||v();function w(E,S){h&&h.dispatchEvent(new CustomEvent(li,{detail:{key:t,oldValue:E,newValue:S,storageArea:l}}))}function V(E){try{const S=l.getItem(t);if(E==null)w(S,null),l.removeItem(t);else{const A=y.write(E);S!==A&&(l.setItem(t,A),w(S,A))}}catch(S){m(S)}}function _(E){const S=E?E.newValue:l.getItem(t);if(S==null)return d&&g!=null&&l.setItem(t,y.write(g)),g;if(!E&&f){const A=y.read(S);return typeof f=="function"?f(A,g):u==="object"&&!Array.isArray(A)?{...g,...A}:A}else return typeof S!="string"?S:y.read(S)}function v(E){if(!(E&&E.storageArea!==l)){if(E&&E.key==null){b.value=g;return}if(!(E&&E.key!==t)){N();try{E?.newValue!==y.write(b.value)&&(b.value=_(E))}catch(S){m(S)}finally{E?e.nextTick(k):k()}}}}function C(E){v(E.detail)}return b}function so(t,n,l={}){const{window:o=Rn}=l;return Wc(t,n,o?.localStorage,l)}function fl(t){"@babel/helpers - typeof";return fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},fl(t)}var Gc=/^\s+/,Jc=/\s+$/;function G(t,n){if(t=t||"",n=n||{},t instanceof G)return t;if(!(this instanceof G))return new G(t,n);var l=Xc(t);this._originalInput=t,this._r=l.r,this._g=l.g,this._b=l.b,this._a=l.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||l.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=l.ok}G.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),l,o,a,i,s,r;return l=n.r/255,o=n.g/255,a=n.b/255,l<=.03928?i=l/12.92:i=Math.pow((l+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*i+.7152*s+.0722*r},setAlpha:function(n){return this._a=di(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=ai(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=ai(this._r,this._g,this._b),l=Math.round(n.h*360),o=Math.round(n.s*100),a=Math.round(n.v*100);return this._a==1?"hsv("+l+", "+o+"%, "+a+"%)":"hsva("+l+", "+o+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var n=oi(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=oi(this._r,this._g,this._b),l=Math.round(n.h*360),o=Math.round(n.s*100),a=Math.round(n.l*100);return this._a==1?"hsl("+l+", "+o+"%, "+a+"%)":"hsla("+l+", "+o+"%, "+a+"%, "+this._roundA+")"},toHex:function(n){return ii(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return nu(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ge(this._r,255)*100)+"%",g:Math.round(ge(this._g,255)*100)+"%",b:Math.round(ge(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ge(this._r,255)*100)+"%, "+Math.round(ge(this._g,255)*100)+"%, "+Math.round(ge(this._b,255)*100)+"%)":"rgba("+Math.round(ge(this._r,255)*100)+"%, "+Math.round(ge(this._g,255)*100)+"%, "+Math.round(ge(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:mu[ii(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var l="#"+ri(this._r,this._g,this._b,this._a),o=l,a=this._gradientType?"GradientType = 1, ":"";if(n){var i=G(n);o="#"+ri(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+l+",endColorstr="+o+")"},toString:function(n){var l=!!n;n=n||this._format;var o=!1,a=this._a<1&&this._a>=0,i=!l&&a&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return i?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(o=this.toRgbString()),n==="prgb"&&(o=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(o=this.toHexString()),n==="hex3"&&(o=this.toHexString(!0)),n==="hex4"&&(o=this.toHex8String(!0)),n==="hex8"&&(o=this.toHex8String()),n==="name"&&(o=this.toName()),n==="hsl"&&(o=this.toHslString()),n==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return G(this.toString())},_applyModification:function(n,l){var o=n.apply(null,[this].concat([].slice.call(l)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(iu,arguments)},brighten:function(){return this._applyModification(ru,arguments)},darken:function(){return this._applyModification(su,arguments)},desaturate:function(){return this._applyModification(lu,arguments)},saturate:function(){return this._applyModification(ou,arguments)},greyscale:function(){return this._applyModification(au,arguments)},spin:function(){return this._applyModification(du,arguments)},_applyCombination:function(n,l){return n.apply(null,[this].concat([].slice.call(l)))},analogous:function(){return this._applyCombination(pu,arguments)},complement:function(){return this._applyCombination(cu,arguments)},monochromatic:function(){return this._applyCombination(fu,arguments)},splitcomplement:function(){return this._applyCombination(uu,arguments)},triad:function(){return this._applyCombination(si,[3])},tetrad:function(){return this._applyCombination(si,[4])}},G.fromRatio=function(t,n){if(fl(t)=="object"){var l={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?l[o]=t[o]:l[o]=Fn(t[o]));t=l}return G(t,n)};function Xc(t){var n={r:0,g:0,b:0},l=1,o=null,a=null,i=null,s=!1,r=!1;return typeof t=="string"&&(t=yu(t)),fl(t)=="object"&&(yt(t.r)&&yt(t.g)&&yt(t.b)?(n=Zc(t.r,t.g,t.b),s=!0,r=String(t.r).substr(-1)==="%"?"prgb":"rgb"):yt(t.h)&&yt(t.s)&&yt(t.v)?(o=Fn(t.s),a=Fn(t.v),n=tu(t.h,o,a),s=!0,r="hsv"):yt(t.h)&&yt(t.s)&&yt(t.l)&&(o=Fn(t.s),i=Fn(t.l),n=eu(t.h,o,i),s=!0,r="hsl"),t.hasOwnProperty("a")&&(l=t.a)),l=di(l),{ok:s,format:t.format||r,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:l}}function Zc(t,n,l){return{r:ge(t,255)*255,g:ge(n,255)*255,b:ge(l,255)*255}}function oi(t,n,l){t=ge(t,255),n=ge(n,255),l=ge(l,255);var o=Math.max(t,n,l),a=Math.min(t,n,l),i,s,r=(o+a)/2;if(o==a)i=s=0;else{var d=o-a;switch(s=r>.5?d/(2-o-a):d/(o+a),o){case t:i=(n-l)/d+(n<l?6:0);break;case n:i=(l-t)/d+2;break;case l:i=(t-n)/d+4;break}i/=6}return{h:i,s,l:r}}function eu(t,n,l){var o,a,i;t=ge(t,360),n=ge(n,100),l=ge(l,100);function s(f,c,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?f+(c-f)*6*h:h<1/2?c:h<2/3?f+(c-f)*(2/3-h)*6:f}if(n===0)o=a=i=l;else{var r=l<.5?l*(1+n):l+n-l*n,d=2*l-r;o=s(d,r,t+1/3),a=s(d,r,t),i=s(d,r,t-1/3)}return{r:o*255,g:a*255,b:i*255}}function ai(t,n,l){t=ge(t,255),n=ge(n,255),l=ge(l,255);var o=Math.max(t,n,l),a=Math.min(t,n,l),i,s,r=o,d=o-a;if(s=o===0?0:d/o,o==a)i=0;else{switch(o){case t:i=(n-l)/d+(n<l?6:0);break;case n:i=(l-t)/d+2;break;case l:i=(t-n)/d+4;break}i/=6}return{h:i,s,v:r}}function tu(t,n,l){t=ge(t,360)*6,n=ge(n,100),l=ge(l,100);var o=Math.floor(t),a=t-o,i=l*(1-n),s=l*(1-a*n),r=l*(1-(1-a)*n),d=o%6,f=[l,s,i,i,r,l][d],c=[r,l,l,s,i,i][d],h=[i,i,r,l,l,s][d];return{r:f*255,g:c*255,b:h*255}}function ii(t,n,l,o){var a=[ot(Math.round(t).toString(16)),ot(Math.round(n).toString(16)),ot(Math.round(l).toString(16))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function nu(t,n,l,o,a){var i=[ot(Math.round(t).toString(16)),ot(Math.round(n).toString(16)),ot(Math.round(l).toString(16)),ot(ci(o))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function ri(t,n,l,o){var a=[ot(ci(o)),ot(Math.round(t).toString(16)),ot(Math.round(n).toString(16)),ot(Math.round(l).toString(16))];return a.join("")}G.equals=function(t,n){return!t||!n?!1:G(t).toRgbString()==G(n).toRgbString()},G.random=function(){return G.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function lu(t,n){n=n===0?0:n||10;var l=G(t).toHsl();return l.s-=n/100,l.s=ml(l.s),G(l)}function ou(t,n){n=n===0?0:n||10;var l=G(t).toHsl();return l.s+=n/100,l.s=ml(l.s),G(l)}function au(t){return G(t).desaturate(100)}function iu(t,n){n=n===0?0:n||10;var l=G(t).toHsl();return l.l+=n/100,l.l=ml(l.l),G(l)}function ru(t,n){n=n===0?0:n||10;var l=G(t).toRgb();return l.r=Math.max(0,Math.min(255,l.r-Math.round(255*-(n/100)))),l.g=Math.max(0,Math.min(255,l.g-Math.round(255*-(n/100)))),l.b=Math.max(0,Math.min(255,l.b-Math.round(255*-(n/100)))),G(l)}function su(t,n){n=n===0?0:n||10;var l=G(t).toHsl();return l.l-=n/100,l.l=ml(l.l),G(l)}function du(t,n){var l=G(t).toHsl(),o=(l.h+n)%360;return l.h=o<0?360+o:o,G(l)}function cu(t){var n=G(t).toHsl();return n.h=(n.h+180)%360,G(n)}function si(t,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var l=G(t).toHsl(),o=[G(t)],a=360/n,i=1;i<n;i++)o.push(G({h:(l.h+i*a)%360,s:l.s,l:l.l}));return o}function uu(t){var n=G(t).toHsl(),l=n.h;return[G(t),G({h:(l+72)%360,s:n.s,l:n.l}),G({h:(l+216)%360,s:n.s,l:n.l})]}function pu(t,n,l){n=n||6,l=l||30;var o=G(t).toHsl(),a=360/l,i=[G(t)];for(o.h=(o.h-(a*n>>1)+720)%360;--n;)o.h=(o.h+a)%360,i.push(G(o));return i}function fu(t,n){n=n||6;for(var l=G(t).toHsv(),o=l.h,a=l.s,i=l.v,s=[],r=1/n;n--;)s.push(G({h:o,s:a,v:i})),i=(i+r)%1;return s}G.mix=function(t,n,l){l=l===0?0:l||50;var o=G(t).toRgb(),a=G(n).toRgb(),i=l/100,s={r:(a.r-o.r)*i+o.r,g:(a.g-o.g)*i+o.g,b:(a.b-o.b)*i+o.b,a:(a.a-o.a)*i+o.a};return G(s)},G.readability=function(t,n){var l=G(t),o=G(n);return(Math.max(l.getLuminance(),o.getLuminance())+.05)/(Math.min(l.getLuminance(),o.getLuminance())+.05)},G.isReadable=function(t,n,l){var o=G.readability(t,n),a,i;switch(i=!1,a=vu(l),a.level+a.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i},G.mostReadable=function(t,n,l){var o=null,a=0,i,s,r,d;l=l||{},s=l.includeFallbackColors,r=l.level,d=l.size;for(var f=0;f<n.length;f++)i=G.readability(t,n[f]),i>a&&(a=i,o=G(n[f]));return G.isReadable(t,o,{level:r,size:d})||!s?o:(l.includeFallbackColors=!1,G.mostReadable(t,["#fff","#000"],l))};var co=G.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},mu=G.hexNames=gu(co);function gu(t){var n={};for(var l in t)t.hasOwnProperty(l)&&(n[t[l]]=l);return n}function di(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ge(t,n){hu(t)&&(t="100%");var l=bu(t);return t=Math.min(n,Math.max(0,parseFloat(t))),l&&(t=parseInt(t*n,10)/100),Math.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function ml(t){return Math.min(1,Math.max(0,t))}function Pe(t){return parseInt(t,16)}function hu(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function bu(t){return typeof t=="string"&&t.indexOf("%")!=-1}function ot(t){return t.length==1?"0"+t:""+t}function Fn(t){return t<=1&&(t=t*100+"%"),t}function ci(t){return Math.round(parseFloat(t)*255).toString(16)}function ui(t){return Pe(t)/255}var at=function(){var t="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",l="(?:"+n+")|(?:"+t+")",o="[\\s|\\(]+("+l+")[,|\\s]+("+l+")[,|\\s]+("+l+")\\s*\\)?",a="[\\s|\\(]+("+l+")[,|\\s]+("+l+")[,|\\s]+("+l+")[,|\\s]+("+l+")\\s*\\)?";return{CSS_UNIT:new RegExp(l),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function yt(t){return!!at.CSS_UNIT.exec(t)}function yu(t){t=t.replace(Gc,"").replace(Jc,"").toLowerCase();var n=!1;if(co[t])t=co[t],n=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var l;return(l=at.rgb.exec(t))?{r:l[1],g:l[2],b:l[3]}:(l=at.rgba.exec(t))?{r:l[1],g:l[2],b:l[3],a:l[4]}:(l=at.hsl.exec(t))?{h:l[1],s:l[2],l:l[3]}:(l=at.hsla.exec(t))?{h:l[1],s:l[2],l:l[3],a:l[4]}:(l=at.hsv.exec(t))?{h:l[1],s:l[2],v:l[3]}:(l=at.hsva.exec(t))?{h:l[1],s:l[2],v:l[3],a:l[4]}:(l=at.hex8.exec(t))?{r:Pe(l[1]),g:Pe(l[2]),b:Pe(l[3]),a:ui(l[4]),format:n?"name":"hex8"}:(l=at.hex6.exec(t))?{r:Pe(l[1]),g:Pe(l[2]),b:Pe(l[3]),format:n?"name":"hex"}:(l=at.hex4.exec(t))?{r:Pe(l[1]+""+l[1]),g:Pe(l[2]+""+l[2]),b:Pe(l[3]+""+l[3]),a:ui(l[4]+""+l[4]),format:n?"name":"hex8"}:(l=at.hex3.exec(t))?{r:Pe(l[1]+""+l[1]),g:Pe(l[2]+""+l[2]),b:Pe(l[3]+""+l[3]),format:n?"name":"hex"}:!1}function vu(t){var n,l;return t=t||{level:"AA",size:"small"},n=(t.level||"AA").toUpperCase(),l=(t.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),l!=="small"&&l!=="large"&&(l="small"),{level:n,size:l}}var Ut=Ut||{};Ut.stringify=function(){var t={"visit_linear-gradient":function(n){return t.visit_gradient(n)},"visit_repeating-linear-gradient":function(n){return t.visit_gradient(n)},"visit_radial-gradient":function(n){return t.visit_gradient(n)},"visit_repeating-radial-gradient":function(n){return t.visit_gradient(n)},visit_gradient:function(n){var l=t.visit(n.orientation);return l&&(l+=", "),n.type+"("+l+t.visit(n.colorStops)+")"},visit_shape:function(n){var l=n.value,o=t.visit(n.at),a=t.visit(n.style);return a&&(l+=" "+a),o&&(l+=" at "+o),l},"visit_default-radial":function(n){var l="",o=t.visit(n.at);return o&&(l+=o),l},"visit_extent-keyword":function(n){var l=n.value,o=t.visit(n.at);return o&&(l+=" at "+o),l},"visit_position-keyword":function(n){return n.value},visit_position:function(n){return t.visit(n.value.x)+" "+t.visit(n.value.y)},"visit_%":function(n){return n.value+"%"},visit_em:function(n){return n.value+"em"},visit_px:function(n){return n.value+"px"},visit_calc:function(n){return"calc("+n.value+")"},visit_literal:function(n){return t.visit_color(n.value,n)},visit_hex:function(n){return t.visit_color("#"+n.value,n)},visit_rgb:function(n){return t.visit_color("rgb("+n.value.join(", ")+")",n)},visit_rgba:function(n){return t.visit_color("rgba("+n.value.join(", ")+")",n)},visit_hsl:function(n){return t.visit_color("hsl("+n.value[0]+", "+n.value[1]+"%, "+n.value[2]+"%)",n)},visit_hsla:function(n){return t.visit_color("hsla("+n.value[0]+", "+n.value[1]+"%, "+n.value[2]+"%, "+n.value[3]+")",n)},visit_var:function(n){return t.visit_color("var("+n.value+")",n)},visit_color:function(n,l){var o=n,a=t.visit(l.length);return a&&(o+=" "+a),o},visit_angular:function(n){return n.value+"deg"},visit_directional:function(n){return"to "+n.value},visit_array:function(n){var l="",o=n.length;return n.forEach(function(a,i){l+=t.visit(a),i<o-1&&(l+=", ")}),l},visit_object:function(n){return n.width&&n.height?t.visit(n.width)+" "+t.visit(n.height):""},visit:function(n){if(!n)return"";if(n instanceof Array)return t.visit_array(n);if(typeof n=="object"&&!n.type)return t.visit_object(n);if(n.type){var l=t["visit_"+n.type];if(l)return l(n);throw Error("Missing visitor visit_"+n.type)}else throw Error("Invalid node.")}};return function(n){return t.visit(n)}}();var Ut=Ut||{};Ut.parse=function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},n="";function l(Q){var D=new Error(n+": "+Q);throw D.source=n,D}function o(){var Q=a();return n.length>0&&l("Invalid input not EOF"),Q}function a(){return N(i)}function i(){return s("linear-gradient",t.linearGradient,d)||s("repeating-linear-gradient",t.repeatingLinearGradient,d)||s("radial-gradient",t.radialGradient,h)||s("repeating-radial-gradient",t.repeatingRadialGradient,h)}function s(Q,D,R){return r(D,function(J){var q=R();return q&&(U(t.comma)||l("Missing comma before color stops")),{type:Q,orientation:q,colorStops:N(k)}})}function r(Q,D){var R=U(Q);if(R){U(t.startCall)||l("Missing (");var J=D(R);return U(t.endCall)||l("Missing )"),J}}function d(){var Q=f();if(Q)return Q;var D=j("position-keyword",t.positionKeywords,1);return D?{type:"directional",value:D.value}:c()}function f(){return j("directional",t.sideOrCorner,1)}function c(){return j("angular",t.angleValue,1)||j("angular",t.radianValue,1)}function h(){var Q,D=p(),R;return D&&(Q=[],Q.push(D),R=n,U(t.comma)&&(D=p(),D?Q.push(D):n=R)),Q}function p(){var Q=m()||x();if(Q)Q.at=g();else{var D=b();if(D){Q=D;var R=g();R&&(Q.at=R)}else{var J=g();if(J)Q={type:"default-radial",at:J};else{var q=u();q&&(Q={type:"default-radial",at:q})}}}return Q}function m(){var Q=j("shape",/^(circle)/i,0);return Q&&(Q.style=F()||b()),Q}function x(){var Q=j("shape",/^(ellipse)/i,0);return Q&&(Q.style=u()||B()||b()),Q}function b(){return j("extent-keyword",t.extentKeywords,1)}function g(){if(j("position",/^at/,0)){var Q=u();return Q||l("Missing positioning value"),Q}}function u(){var Q=y();if(Q.x||Q.y)return{type:"position",value:Q}}function y(){return{x:B(),y:B()}}function N(Q){var D=Q(),R=[];if(D)for(R.push(D);U(t.comma);)D=Q(),D?R.push(D):l("One extra comma");return R}function k(){var Q=w();return Q||l("Expected color definition"),Q.length=B(),Q}function w(){return _()||A()||S()||C()||v()||E()||V()}function V(){return j("literal",t.literalColor,0)}function _(){return j("hex",t.hexColor,1)}function v(){return r(t.rgbColor,function(){return{type:"rgb",value:N(T)}})}function C(){return r(t.rgbaColor,function(){return{type:"rgba",value:N(T)}})}function E(){return r(t.varColor,function(){return{type:"var",value:O()}})}function S(){return r(t.hslColor,function(){var Q=U(t.percentageValue);Q&&l("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var D=T();U(t.comma);var R=U(t.percentageValue),J=R?R[1]:null;U(t.comma),R=U(t.percentageValue);var q=R?R[1]:null;return(!J||!q)&&l("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[D,J,q]}})}function A(){return r(t.hslaColor,function(){var Q=T();U(t.comma);var D=U(t.percentageValue),R=D?D[1]:null;U(t.comma),D=U(t.percentageValue);var J=D?D[1]:null;U(t.comma);var q=T();return(!R||!J)&&l("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[Q,R,J,q]}})}function O(){return U(t.variableName)[1]}function T(){return U(t.number)[1]}function B(){return j("%",t.percentageValue,1)||$()||I()||F()}function $(){return j("position-keyword",t.positionKeywords,1)}function I(){return r(t.calcValue,function(){for(var Q=1,D=0;Q>0&&D<n.length;){var R=n.charAt(D);R==="("?Q++:R===")"&&Q--,D++}Q>0&&l("Missing closing parenthesis in calc() expression");var J=n.substring(0,D-1);return M(D-1),{type:"calc",value:J}})}function F(){return j("px",t.pixelValue,1)||j("em",t.emValue,1)}function j(Q,D,R){var J=U(D);if(J)return{type:Q,value:J[R]}}function U(Q){var D,R;return R=/^[\n\r\t\s]+/.exec(n),R&&M(R[0].length),D=Q.exec(n),D&&M(D[0].length),D}function M(Q){n=n.substr(Q)}return function(Q){return n=Q.toString().trim(),n.endsWith(";")&&(n=n.slice(0,-1)),o()}}();var ku=Ut.parse,wu=Ut.stringify,Me="top",We="bottom",Ge="right",De="left",uo="auto",$n=[Me,We,Ge,De],ln="start",In="end",Cu="clippingParents",pi="viewport",Mn="popper",Au="reference",fi=$n.reduce(function(t,n){return t.concat([n+"-"+ln,n+"-"+In])},[]),mi=[].concat($n,[uo]).reduce(function(t,n){return t.concat([n,n+"-"+ln,n+"-"+In])},[]),xu="beforeRead",Nu="read",_u="afterRead",Su="beforeMain",Vu="main",Bu="afterMain",Eu="beforeWrite",Ou="write",Tu="afterWrite",Ru=[xu,Nu,_u,Su,Vu,Bu,Eu,Ou,Tu];function dt(t){return t?(t.nodeName||"").toLowerCase():null}function qe(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function Lt(t){var n=qe(t).Element;return t instanceof n||t instanceof Element}function Je(t){var n=qe(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function po(t){if(typeof ShadowRoot>"u")return!1;var n=qe(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function Fu(t){var n=t.state;Object.keys(n.elements).forEach(function(l){var o=n.styles[l]||{},a=n.attributes[l]||{},i=n.elements[l];!Je(i)||!dt(i)||(Object.assign(i.style,o),Object.keys(a).forEach(function(s){var r=a[s];r===!1?i.removeAttribute(s):i.setAttribute(s,r===!0?"":r)}))})}function $u(t){var n=t.state,l={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,l.popper),n.styles=l,n.elements.arrow&&Object.assign(n.elements.arrow.style,l.arrow),function(){Object.keys(n.elements).forEach(function(o){var a=n.elements[o],i=n.attributes[o]||{},s=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:l[o]),r=s.reduce(function(d,f){return d[f]="",d},{});!Je(a)||!dt(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(d){a.removeAttribute(d)}))})}}const Iu={name:"applyStyles",enabled:!0,phase:"write",fn:Fu,effect:$u,requires:["computeStyles"]};function ct(t){return t.split("-")[0]}var jt=Math.max,gl=Math.min,on=Math.round;function fo(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function gi(){return!/^((?!chrome|android).)*safari/i.test(fo())}function an(t,n,l){n===void 0&&(n=!1),l===void 0&&(l=!1);var o=t.getBoundingClientRect(),a=1,i=1;n&&Je(t)&&(a=t.offsetWidth>0&&on(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&on(o.height)/t.offsetHeight||1);var s=Lt(t)?qe(t):window,r=s.visualViewport,d=!gi()&&l,f=(o.left+(d&&r?r.offsetLeft:0))/a,c=(o.top+(d&&r?r.offsetTop:0))/i,h=o.width/a,p=o.height/i;return{width:h,height:p,top:c,right:f+h,bottom:c+p,left:f,x:f,y:c}}function mo(t){var n=an(t),l=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-l)<=1&&(l=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:l,height:o}}function hi(t,n){var l=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(l&&po(l)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function vt(t){return qe(t).getComputedStyle(t)}function Mu(t){return["table","td","th"].indexOf(dt(t))>=0}function Vt(t){return((Lt(t)?t.ownerDocument:t.document)||window.document).documentElement}function hl(t){return dt(t)==="html"?t:t.assignedSlot||t.parentNode||(po(t)?t.host:null)||Vt(t)}function bi(t){return!Je(t)||vt(t).position==="fixed"?null:t.offsetParent}function Du(t){var n=/firefox/i.test(fo()),l=/Trident/i.test(fo());if(l&&Je(t)){var o=vt(t);if(o.position==="fixed")return null}var a=hl(t);for(po(a)&&(a=a.host);Je(a)&&["html","body"].indexOf(dt(a))<0;){var i=vt(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||n&&i.willChange==="filter"||n&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function Dn(t){for(var n=qe(t),l=bi(t);l&&Mu(l)&&vt(l).position==="static";)l=bi(l);return l&&(dt(l)==="html"||dt(l)==="body"&&vt(l).position==="static")?n:l||Du(t)||n}function go(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Un(t,n,l){return jt(t,gl(n,l))}function Uu(t,n,l){var o=Un(t,n,l);return o>l?l:o}function yi(){return{top:0,right:0,bottom:0,left:0}}function vi(t){return Object.assign({},yi(),t)}function ki(t,n){return n.reduce(function(l,o){return l[o]=t,l},{})}var Lu=function(n,l){return n=typeof n=="function"?n(Object.assign({},l.rects,{placement:l.placement})):n,vi(typeof n!="number"?n:ki(n,$n))};function ju(t){var n,l=t.state,o=t.name,a=t.options,i=l.elements.arrow,s=l.modifiersData.popperOffsets,r=ct(l.placement),d=go(r),f=[De,Ge].indexOf(r)>=0,c=f?"height":"width";if(!(!i||!s)){var h=Lu(a.padding,l),p=mo(i),m=d==="y"?Me:De,x=d==="y"?We:Ge,b=l.rects.reference[c]+l.rects.reference[d]-s[d]-l.rects.popper[c],g=s[d]-l.rects.reference[d],u=Dn(i),y=u?d==="y"?u.clientHeight||0:u.clientWidth||0:0,N=b/2-g/2,k=h[m],w=y-p[c]-h[x],V=y/2-p[c]/2+N,_=Un(k,V,w),v=d;l.modifiersData[o]=(n={},n[v]=_,n.centerOffset=_-V,n)}}function Pu(t){var n=t.state,l=t.options,o=l.element,a=o===void 0?"[data-popper-arrow]":o;a!=null&&(typeof a=="string"&&(a=n.elements.popper.querySelector(a),!a)||hi(n.elements.popper,a)&&(n.elements.arrow=a))}const qu={name:"arrow",enabled:!0,phase:"main",fn:ju,effect:Pu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function rn(t){return t.split("-")[1]}var zu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qu(t,n){var l=t.x,o=t.y,a=n.devicePixelRatio||1;return{x:on(l*a)/a||0,y:on(o*a)/a||0}}function wi(t){var n,l=t.popper,o=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,r=t.position,d=t.gpuAcceleration,f=t.adaptive,c=t.roundOffsets,h=t.isFixed,p=s.x,m=p===void 0?0:p,x=s.y,b=x===void 0?0:x,g=typeof c=="function"?c({x:m,y:b}):{x:m,y:b};m=g.x,b=g.y;var u=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),N=De,k=Me,w=window;if(f){var V=Dn(l),_="clientHeight",v="clientWidth";if(V===qe(l)&&(V=Vt(l),vt(V).position!=="static"&&r==="absolute"&&(_="scrollHeight",v="scrollWidth")),V=V,a===Me||(a===De||a===Ge)&&i===In){k=We;var C=h&&V===w&&w.visualViewport?w.visualViewport.height:V[_];b-=C-o.height,b*=d?1:-1}if(a===De||(a===Me||a===We)&&i===In){N=Ge;var E=h&&V===w&&w.visualViewport?w.visualViewport.width:V[v];m-=E-o.width,m*=d?1:-1}}var S=Object.assign({position:r},f&&zu),A=c===!0?Qu({x:m,y:b},qe(l)):{x:m,y:b};if(m=A.x,b=A.y,d){var O;return Object.assign({},S,(O={},O[k]=y?"0":"",O[N]=u?"0":"",O.transform=(w.devicePixelRatio||1)<=1?"translate("+m+"px, "+b+"px)":"translate3d("+m+"px, "+b+"px, 0)",O))}return Object.assign({},S,(n={},n[k]=y?b+"px":"",n[N]=u?m+"px":"",n.transform="",n))}function Hu(t){var n=t.state,l=t.options,o=l.gpuAcceleration,a=o===void 0?!0:o,i=l.adaptive,s=i===void 0?!0:i,r=l.roundOffsets,d=r===void 0?!0:r,f={placement:ct(n.placement),variation:rn(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:a,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,wi(Object.assign({},f,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:s,roundOffsets:d})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,wi(Object.assign({},f,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}const Ku={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Hu,data:{}};var bl={passive:!0};function Yu(t){var n=t.state,l=t.instance,o=t.options,a=o.scroll,i=a===void 0?!0:a,s=o.resize,r=s===void 0?!0:s,d=qe(n.elements.popper),f=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&f.forEach(function(c){c.addEventListener("scroll",l.update,bl)}),r&&d.addEventListener("resize",l.update,bl),function(){i&&f.forEach(function(c){c.removeEventListener("scroll",l.update,bl)}),r&&d.removeEventListener("resize",l.update,bl)}}const Wu={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Yu,data:{}};var Gu={left:"right",right:"left",bottom:"top",top:"bottom"};function yl(t){return t.replace(/left|right|bottom|top/g,function(n){return Gu[n]})}var Ju={start:"end",end:"start"};function Ci(t){return t.replace(/start|end/g,function(n){return Ju[n]})}function ho(t){var n=qe(t),l=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:l,scrollTop:o}}function bo(t){return an(Vt(t)).left+ho(t).scrollLeft}function Xu(t,n){var l=qe(t),o=Vt(t),a=l.visualViewport,i=o.clientWidth,s=o.clientHeight,r=0,d=0;if(a){i=a.width,s=a.height;var f=gi();(f||!f&&n==="fixed")&&(r=a.offsetLeft,d=a.offsetTop)}return{width:i,height:s,x:r+bo(t),y:d}}function Zu(t){var n,l=Vt(t),o=ho(t),a=(n=t.ownerDocument)==null?void 0:n.body,i=jt(l.scrollWidth,l.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=jt(l.scrollHeight,l.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),r=-o.scrollLeft+bo(t),d=-o.scrollTop;return vt(a||l).direction==="rtl"&&(r+=jt(l.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:r,y:d}}function yo(t){var n=vt(t),l=n.overflow,o=n.overflowX,a=n.overflowY;return/auto|scroll|overlay|hidden/.test(l+a+o)}function Ai(t){return["html","body","#document"].indexOf(dt(t))>=0?t.ownerDocument.body:Je(t)&&yo(t)?t:Ai(hl(t))}function Ln(t,n){var l;n===void 0&&(n=[]);var o=Ai(t),a=o===((l=t.ownerDocument)==null?void 0:l.body),i=qe(o),s=a?[i].concat(i.visualViewport||[],yo(o)?o:[]):o,r=n.concat(s);return a?r:r.concat(Ln(hl(s)))}function vo(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ep(t,n){var l=an(t,!1,n==="fixed");return l.top=l.top+t.clientTop,l.left=l.left+t.clientLeft,l.bottom=l.top+t.clientHeight,l.right=l.left+t.clientWidth,l.width=t.clientWidth,l.height=t.clientHeight,l.x=l.left,l.y=l.top,l}function xi(t,n,l){return n===pi?vo(Xu(t,l)):Lt(n)?ep(n,l):vo(Zu(Vt(t)))}function tp(t){var n=Ln(hl(t)),l=["absolute","fixed"].indexOf(vt(t).position)>=0,o=l&&Je(t)?Dn(t):t;return Lt(o)?n.filter(function(a){return Lt(a)&&hi(a,o)&&dt(a)!=="body"}):[]}function np(t,n,l,o){var a=n==="clippingParents"?tp(t):[].concat(n),i=[].concat(a,[l]),s=i[0],r=i.reduce(function(d,f){var c=xi(t,f,o);return d.top=jt(c.top,d.top),d.right=gl(c.right,d.right),d.bottom=gl(c.bottom,d.bottom),d.left=jt(c.left,d.left),d},xi(t,s,o));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function Ni(t){var n=t.reference,l=t.element,o=t.placement,a=o?ct(o):null,i=o?rn(o):null,s=n.x+n.width/2-l.width/2,r=n.y+n.height/2-l.height/2,d;switch(a){case Me:d={x:s,y:n.y-l.height};break;case We:d={x:s,y:n.y+n.height};break;case Ge:d={x:n.x+n.width,y:r};break;case De:d={x:n.x-l.width,y:r};break;default:d={x:n.x,y:n.y}}var f=a?go(a):null;if(f!=null){var c=f==="y"?"height":"width";switch(i){case ln:d[f]=d[f]-(n[c]/2-l[c]/2);break;case In:d[f]=d[f]+(n[c]/2-l[c]/2);break}}return d}function jn(t,n){n===void 0&&(n={});var l=n,o=l.placement,a=o===void 0?t.placement:o,i=l.strategy,s=i===void 0?t.strategy:i,r=l.boundary,d=r===void 0?Cu:r,f=l.rootBoundary,c=f===void 0?pi:f,h=l.elementContext,p=h===void 0?Mn:h,m=l.altBoundary,x=m===void 0?!1:m,b=l.padding,g=b===void 0?0:b,u=vi(typeof g!="number"?g:ki(g,$n)),y=p===Mn?Au:Mn,N=t.rects.popper,k=t.elements[x?y:p],w=np(Lt(k)?k:k.contextElement||Vt(t.elements.popper),d,c,s),V=an(t.elements.reference),_=Ni({reference:V,element:N,strategy:"absolute",placement:a}),v=vo(Object.assign({},N,_)),C=p===Mn?v:V,E={top:w.top-C.top+u.top,bottom:C.bottom-w.bottom+u.bottom,left:w.left-C.left+u.left,right:C.right-w.right+u.right},S=t.modifiersData.offset;if(p===Mn&&S){var A=S[a];Object.keys(E).forEach(function(O){var T=[Ge,We].indexOf(O)>=0?1:-1,B=[Me,We].indexOf(O)>=0?"y":"x";E[O]+=A[B]*T})}return E}function lp(t,n){n===void 0&&(n={});var l=n,o=l.placement,a=l.boundary,i=l.rootBoundary,s=l.padding,r=l.flipVariations,d=l.allowedAutoPlacements,f=d===void 0?mi:d,c=rn(o),h=c?r?fi:fi.filter(function(x){return rn(x)===c}):$n,p=h.filter(function(x){return f.indexOf(x)>=0});p.length===0&&(p=h);var m=p.reduce(function(x,b){return x[b]=jn(t,{placement:b,boundary:a,rootBoundary:i,padding:s})[ct(b)],x},{});return Object.keys(m).sort(function(x,b){return m[x]-m[b]})}function op(t){if(ct(t)===uo)return[];var n=yl(t);return[Ci(t),n,Ci(n)]}function ap(t){var n=t.state,l=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var a=l.mainAxis,i=a===void 0?!0:a,s=l.altAxis,r=s===void 0?!0:s,d=l.fallbackPlacements,f=l.padding,c=l.boundary,h=l.rootBoundary,p=l.altBoundary,m=l.flipVariations,x=m===void 0?!0:m,b=l.allowedAutoPlacements,g=n.options.placement,u=ct(g),y=u===g,N=d||(y||!x?[yl(g)]:op(g)),k=[g].concat(N).reduce(function(R,J){return R.concat(ct(J)===uo?lp(n,{placement:J,boundary:c,rootBoundary:h,padding:f,flipVariations:x,allowedAutoPlacements:b}):J)},[]),w=n.rects.reference,V=n.rects.popper,_=new Map,v=!0,C=k[0],E=0;E<k.length;E++){var S=k[E],A=ct(S),O=rn(S)===ln,T=[Me,We].indexOf(A)>=0,B=T?"width":"height",$=jn(n,{placement:S,boundary:c,rootBoundary:h,altBoundary:p,padding:f}),I=T?O?Ge:De:O?We:Me;w[B]>V[B]&&(I=yl(I));var F=yl(I),j=[];if(i&&j.push($[A]<=0),r&&j.push($[I]<=0,$[F]<=0),j.every(function(R){return R})){C=S,v=!1;break}_.set(S,j)}if(v)for(var U=x?3:1,M=function(J){var q=k.find(function(L){var ee=_.get(L);if(ee)return ee.slice(0,J).every(function(Y){return Y})});if(q)return C=q,"break"},Q=U;Q>0;Q--){var D=M(Q);if(D==="break")break}n.placement!==C&&(n.modifiersData[o]._skip=!0,n.placement=C,n.reset=!0)}}const ip={name:"flip",enabled:!0,phase:"main",fn:ap,requiresIfExists:["offset"],data:{_skip:!1}};function _i(t,n,l){return l===void 0&&(l={x:0,y:0}),{top:t.top-n.height-l.y,right:t.right-n.width+l.x,bottom:t.bottom-n.height+l.y,left:t.left-n.width-l.x}}function Si(t){return[Me,Ge,We,De].some(function(n){return t[n]>=0})}function rp(t){var n=t.state,l=t.name,o=n.rects.reference,a=n.rects.popper,i=n.modifiersData.preventOverflow,s=jn(n,{elementContext:"reference"}),r=jn(n,{altBoundary:!0}),d=_i(s,o),f=_i(r,a,i),c=Si(d),h=Si(f);n.modifiersData[l]={referenceClippingOffsets:d,popperEscapeOffsets:f,isReferenceHidden:c,hasPopperEscaped:h},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const sp={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rp};function dp(t,n,l){var o=ct(t),a=[De,Me].indexOf(o)>=0?-1:1,i=typeof l=="function"?l(Object.assign({},n,{placement:t})):l,s=i[0],r=i[1];return s=s||0,r=(r||0)*a,[De,Ge].indexOf(o)>=0?{x:r,y:s}:{x:s,y:r}}function cp(t){var n=t.state,l=t.options,o=t.name,a=l.offset,i=a===void 0?[0,0]:a,s=mi.reduce(function(c,h){return c[h]=dp(h,n.rects,i),c},{}),r=s[n.placement],d=r.x,f=r.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=d,n.modifiersData.popperOffsets.y+=f),n.modifiersData[o]=s}const up={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cp};function pp(t){var n=t.state,l=t.name;n.modifiersData[l]=Ni({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}const fp={name:"popperOffsets",enabled:!0,phase:"read",fn:pp,data:{}};function mp(t){return t==="x"?"y":"x"}function gp(t){var n=t.state,l=t.options,o=t.name,a=l.mainAxis,i=a===void 0?!0:a,s=l.altAxis,r=s===void 0?!1:s,d=l.boundary,f=l.rootBoundary,c=l.altBoundary,h=l.padding,p=l.tether,m=p===void 0?!0:p,x=l.tetherOffset,b=x===void 0?0:x,g=jn(n,{boundary:d,rootBoundary:f,padding:h,altBoundary:c}),u=ct(n.placement),y=rn(n.placement),N=!y,k=go(u),w=mp(k),V=n.modifiersData.popperOffsets,_=n.rects.reference,v=n.rects.popper,C=typeof b=="function"?b(Object.assign({},n.rects,{placement:n.placement})):b,E=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),S=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,A={x:0,y:0};if(V){if(i){var O,T=k==="y"?Me:De,B=k==="y"?We:Ge,$=k==="y"?"height":"width",I=V[k],F=I+g[T],j=I-g[B],U=m?-v[$]/2:0,M=y===ln?_[$]:v[$],Q=y===ln?-v[$]:-_[$],D=n.elements.arrow,R=m&&D?mo(D):{width:0,height:0},J=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:yi(),q=J[T],L=J[B],ee=Un(0,_[$],R[$]),Y=N?_[$]/2-U-ee-q-E.mainAxis:M-ee-q-E.mainAxis,se=N?-_[$]/2+U+ee+L+E.mainAxis:Q+ee+L+E.mainAxis,z=n.elements.arrow&&Dn(n.elements.arrow),H=z?k==="y"?z.clientTop||0:z.clientLeft||0:0,K=(O=S?.[k])!=null?O:0,X=I+Y-K-H,ne=I+se-K,fe=Un(m?gl(F,X):F,I,m?jt(j,ne):j);V[k]=fe,A[k]=fe-I}if(r){var nt,St=k==="x"?Me:De,ue=k==="x"?We:Ge,st=V[w],En=w==="y"?"height":"width",Xs=st+g[St],Zs=st-g[ue],Ma=[Me,De].indexOf(u)!==-1,ed=(nt=S?.[w])!=null?nt:0,td=Ma?Xs:st-_[En]-v[En]-ed+E.altAxis,nd=Ma?st+_[En]+v[En]-ed-E.altAxis:Zs,ld=m&&Ma?Uu(td,st,nd):Un(m?td:Xs,st,m?nd:Zs);V[w]=ld,A[w]=ld-st}n.modifiersData[o]=A}}const hp={name:"preventOverflow",enabled:!0,phase:"main",fn:gp,requiresIfExists:["offset"]};function bp(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function yp(t){return t===qe(t)||!Je(t)?ho(t):bp(t)}function vp(t){var n=t.getBoundingClientRect(),l=on(n.width)/t.offsetWidth||1,o=on(n.height)/t.offsetHeight||1;return l!==1||o!==1}function kp(t,n,l){l===void 0&&(l=!1);var o=Je(n),a=Je(n)&&vp(n),i=Vt(n),s=an(t,a,l),r={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(o||!o&&!l)&&((dt(n)!=="body"||yo(i))&&(r=yp(n)),Je(n)?(d=an(n,!0),d.x+=n.clientLeft,d.y+=n.clientTop):i&&(d.x=bo(i))),{x:s.left+r.scrollLeft-d.x,y:s.top+r.scrollTop-d.y,width:s.width,height:s.height}}function wp(t){var n=new Map,l=new Set,o=[];t.forEach(function(i){n.set(i.name,i)});function a(i){l.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(r){if(!l.has(r)){var d=n.get(r);d&&a(d)}}),o.push(i)}return t.forEach(function(i){l.has(i.name)||a(i)}),o}function Cp(t){var n=wp(t);return Ru.reduce(function(l,o){return l.concat(n.filter(function(a){return a.phase===o}))},[])}function Ap(t){var n;return function(){return n||(n=new Promise(function(l){Promise.resolve().then(function(){n=void 0,l(t())})})),n}}function xp(t){var n=t.reduce(function(l,o){var a=l[o.name];return l[o.name]=a?Object.assign({},a,o,{options:Object.assign({},a.options,o.options),data:Object.assign({},a.data,o.data)}):o,l},{});return Object.keys(n).map(function(l){return n[l]})}var Vi={placement:"bottom",modifiers:[],strategy:"absolute"};function Bi(){for(var t=arguments.length,n=new Array(t),l=0;l<t;l++)n[l]=arguments[l];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Np(t){t===void 0&&(t={});var n=t,l=n.defaultModifiers,o=l===void 0?[]:l,a=n.defaultOptions,i=a===void 0?Vi:a;return function(r,d,f){f===void 0&&(f=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vi,i),modifiersData:{},elements:{reference:r,popper:d},attributes:{},styles:{}},h=[],p=!1,m={state:c,setOptions:function(u){var y=typeof u=="function"?u(c.options):u;b(),c.options=Object.assign({},i,c.options,y),c.scrollParents={reference:Lt(r)?Ln(r):r.contextElement?Ln(r.contextElement):[],popper:Ln(d)};var N=Cp(xp([].concat(o,c.options.modifiers)));return c.orderedModifiers=N.filter(function(k){return k.enabled}),x(),m.update()},forceUpdate:function(){if(!p){var u=c.elements,y=u.reference,N=u.popper;if(Bi(y,N)){c.rects={reference:kp(y,Dn(N),c.options.strategy==="fixed"),popper:mo(N)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(E){return c.modifiersData[E.name]=Object.assign({},E.data)});for(var k=0;k<c.orderedModifiers.length;k++){if(c.reset===!0){c.reset=!1,k=-1;continue}var w=c.orderedModifiers[k],V=w.fn,_=w.options,v=_===void 0?{}:_,C=w.name;typeof V=="function"&&(c=V({state:c,options:v,name:C,instance:m})||c)}}}},update:Ap(function(){return new Promise(function(g){m.forceUpdate(),g(c)})}),destroy:function(){b(),p=!0}};if(!Bi(r,d))return m;m.setOptions(f).then(function(g){!p&&f.onFirstUpdate&&f.onFirstUpdate(g)});function x(){c.orderedModifiers.forEach(function(g){var u=g.name,y=g.options,N=y===void 0?{}:y,k=g.effect;if(typeof k=="function"){var w=k({state:c,name:u,instance:m,options:N}),V=function(){};h.push(w||V)}})}function b(){h.forEach(function(g){return g()}),h=[]}return m}}var _p=[Wu,fp,Ku,Iu,up,ip,hp,qu,sp],Sp=Np({defaultModifiers:_p});/*!
3
3
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
4
  *